Detailed description of the invention
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
As it is shown in figure 1, first embodiment of the invention proposes a kind of method updating white list, it is applied to service end, the party
Method includes:
Step 101, when newly-increased operation being detected, obtains newly-increased white list link, generates very first time stamp, will be newly-increased
White list link, the very first time stamp corresponding with increasing operator newly preservation.
Specifically, when newly-increased operation being detected, newly-increased white list link can be obtained, for newly-increased white list link
Distribution white list mark, generates very first time stamp, by white list mark with increase operator newly, newly-increased white list links and first
Timestamp correspondence preserves.
In the present embodiment, can by white list mark with increase operator newly, newly-increased white list link and the very first time stab
Correspondence is saved in local data base.
Further, after obtaining newly-increased white list link, it is also possible to newly-increased operator, white list are identified and new
The white list link correspondence increased is saved in the first memory block, is saved in the second storage by corresponding with very first time stamp for white list mark
District.Wherein, the first memory block and the second memory block may be located in memory database.
Step 102, when deletion action being detected, is updated to deletion action symbol by the operator corresponding with deletion action,
Generate the second timestamp, be the second timestamp by the update of time stamp corresponding with deletion action.
Specifically, when deletion action being detected, white list mark can be obtained, generate the second timestamp, self is protected
The operator corresponding with white list mark deposited and timestamp are respectively modified as deletion action symbol and the second timestamp.
Further, when deletion action being detected, it is also possible to right with white list mark by what the first memory block preserved
The operator answered is revised as deletion action symbol, the timestamp corresponding with white list mark preserved is revised as in the second memory block
Second timestamp.
Additionally, when amendment operation being detected, white list mark can be obtained and white list links, generate for the 3rd time
Stamp, self is preserved link with white list white list corresponding to mark, operator and timestamp are respectively modified as getting
White list link, amendment operator and the 3rd timestamp.
Further, when amendment operation being detected, it is also possible to right with white list mark by what the first memory block preserved
The white list link answered and operator are respectively modified as white list link and the amendment operator got, by the second memory block
The timestamp corresponding with white list mark preserved is revised as the 3rd timestamp.
The embodiment of the present invention one arranges operator and the timestamp of correspondence for every white list link, and is updating white name
Dan Shi, updates and links corresponding operator and timestamp, the most newly-built Operation Log with white list, it is to avoid big in service end accumulation
The Operation Log of amount, improves write and the query performance of service end.
As in figure 2 it is shown, second embodiment of the invention proposes a kind of method updating white list, including:
Step 201, when service end detects renewal operation, judges action type, if newly-increased operation, then holds
Row step 202;If amendment operation, then perform step 208;If deletion action, then perform step 214.
Step 202, service end obtains white list link and site name.
Such as, service end gets white list link and site name are respectively " www.aaa.com " and " AAA net
Stand ".
Step 203, service end judges whether there is the white list link got in data base, if it is, perform step
Rapid 204;Otherwise, step 205 is performed.
Step 204, service end returns error message, terminates flow process.
Step 205, service end is white list link distribution white list mark, obtains current time and stabs as the very first time,
White list mark, site name, white list link, the very first time are stabbed and increase operator newly and be saved in data base.
Wherein, very first time stamp can be 13 bit data, and data base can be Mysql relevant database.
Such as, service end is white list link " www.aaa.com " distribution white list mark " 10010 ", when obtaining current
Between " 2016071809155 " as the very first time stab, by white list mark " 10010 ", site name " AAA website ", white list
Link " www.aaa.com ", very first time stamp " 2016071809155 " and newly-increased operator " A " are saved in Mysql relationship type
In data base.
Step 206, white list is identified by service end, white list links and increases operator newly as white list details data
It is saved in the first memory block.
Wherein, the first memory block may be located in memory database.
In the present embodiment, the first memory block can be the hash (Hash) of Redis cache, and hash includes multiple thresholding
Can be word, integer, floating number or binary data to (field-value pair), the territory of hash and value, same
Each territory inside individual hash is unique, different.
Such as, white list is linked as " www.aaa.com ", and white list is designated " 10010 ", and white list is identified by service end
" 10010 ", white list link " www.aaa.com " and newly-increased operator " A " are saved in Redis as white list details data
In the hash of cache.Wherein, the territory of hash is respectively white list mark, white list link and operator, and corresponding value is divided
Wei " 10010 ", " www.aaa.com " and " A ".
Step 207, white list mark and very first time stamp are saved in second as white list index data and deposit by service end
Storage area, terminates flow process.
Wherein, the second memory block may be located in memory database.
In the present embodiment, the second memory block can be the ordered list (Sorted set) of Redis cache, has sequence
Table includes mark field and value.White list mark and very first time stamp are preserved by service end as value and scoring field
In ordered list.
Such as, white list is designated " 10010 " and very first time stamp " 2016071809155 " as white list by service end
Index data is saved in the ordered list of Redis cache, and wherein, the scoring field of ordered list is very first time stamp
" 2016071809155 ", value is " 10010 ".
Step 208, service end obtains white list mark, white list link and site name.
Such as, service end gets white list mark, white list link and site name be respectively " 10010 ",
" www.aaa111.com " and " AAA111 website ".
Step 209, service end judges whether there is the white list mark got in data base, if it is, perform step
Rapid 211;Otherwise, step 210 is performed.
Step 210, service end returns error message, terminates flow process.
Step 211, service end obtains current time as the 3rd timestamp, by data base with the white list mark got
Know corresponding white list link, site name, operator and timestamp, be respectively modified as white list link, the acquisition got
Site name, amendment operator and the 3rd timestamp arrived.
Such as, white list corresponding with white list mark " 10010 " in data base is linked by service end
" www.aaa.com ", site name " AAA website ", operator " A " and timestamp " 2016071809155 ", be respectively modified as
" www.aaa111.com ", " AAA111 website ", operator " U " and timestamp " 2016071811352 ".
Step 212, service end is according to the white list mark got, and in the first memory block, inquiry comprises this white list mark
The white list details data known, white list link and operator in the white list details data that will inquire are updated to obtain respectively
The white list link got and amendment operator.
Such as, the white list that service end gets is designated " 10010 ", and the white list inquired in the first memory block is detailed
Feelings packet mark containing white list " 10010 ", white list link " www.aaa.com " and operator " A ", service end will inquire
White list details data in white list link " www.aaa.com " and operator " A " be respectively modified as
" www.aaa111.com " and operator " U ".
Step 213, service end is according to the white list mark got, and in the second memory block, inquiry comprises this white list mark
The white list index data known, the update of time stamp in the white list index data that will inquire is the 3rd timestamp, terminates stream
Journey.
Such as, the white list that service end gets is designated " 10010 ", the white list rope inquired in the second memory block
Argument is according to comprising white list mark " 10010 " and timestamp " 2016071809155 ", and service end is by timestamp
" 2016071809155 " are revised as timestamp " 2016071811352 ".
Step 214, service end obtains white list mark.
Such as, the white list that service end gets is designated " 10010 ".
Step 215, service end judges whether there is the white list mark got in data base, if it is, perform step
Rapid 217;Otherwise, step 216 is performed.
Step 216, service end returns error message, terminates flow process.
Step 217, service end obtains current time as the second timestamp, by data base with the white list mark got
Know corresponding operator and timestamp, be respectively modified as deletion action symbol and the second timestamp.
Such as, service end is by operator " A " corresponding with white list mark " 10010 " in data base and timestamp
" 2016071809155 ", are respectively modified as operator " D " and timestamp " 2016071811352 ".
Step 218, service end is according to the white list mark got, and in the first memory block, inquiry comprises this white list mark
The white list details data known, the operator in the white list details data that will inquire is updated to deletion action symbol.
Such as, the white list that service end gets is designated " 10010 ", and the white list inquired in the first memory block is detailed
Feelings packet mark containing white list " 10010 ", white list link " www.aaa.com " and operator " A ", service end will inquire
White list details data in operator " A " be revised as operator " D ".
Step 219, service end is according to the white list mark got, and in the second memory block, inquiry comprises this white list mark
The white list index data known, the update of time stamp in the white list index data that will inquire is the second timestamp, terminates stream
Journey.
Such as, the white list that service end gets is designated " 10010 ", the white list rope inquired in the second memory block
Argument is according to comprising white list mark " 10010 " and timestamp " 2016071809155 ", and service end is by timestamp
" 2016071809155 " are revised as timestamp " 2016071811352 ".
The embodiment of the present invention two arranges operator and the timestamp of correspondence for every white list link, and is updating white name
Dan Shi, updates and links corresponding operator and timestamp, the most newly-built Operation Log with white list, it is to avoid big in service end accumulation
The Operation Log of amount, improves write and the query performance of service end.Additionally, store white list details data in internal memory with white
List index data, it is simple to the white list of client is carried out Fast synchronization.
As it is shown on figure 3, third embodiment of the invention proposes a kind of method processing white list updating request, including:
Step 301, the white list updating that service end receives from client is asked, and returns maximum time stamp to client.
Wherein, the timestamp of the numerical value maximum that maximum time stamp currently preserves for service end.
Such as, service end returns maximum time stamp " 2016071809155 " to client.
Step 302, service end, according to the timestamp progress msg in white list updating request, is inquired about from the second memory block
More than the timestamp of timestamp progress msg, and obtain the white list mark corresponding with the timestamp inquired.
Wherein, the second memory block may be located in memory database.
In the present embodiment, the second memory block can be the ordered list of Redis cache, and ordered list includes word score
Section and value.
Such as, the timestamp progress msg in white list updating request is " 2016070607349 ", and service end is from there being sequence
In table, inquiry is more than the timestamp of " 2016070607349 ", i.e. " 2016070819343 ", " 2016071023190 " and
" 2016071809155 ", and obtain the white list corresponding with the timestamp inquired identify " 10001 ", " 10009 " and
“10005”。
Step 303, service end is according to the white list mark got, right with this white list mark from the first memory block inquiry
The white list link answered and operator, and by the white list link inquired and operator, and the white list mark got
It is sent to client as white list incremental data.
Wherein, the first memory block may be located in memory database.
In the present embodiment, the first memory block can be the hash of Redis cache, and hash includes multiple thresholding pair, dissipates
Territory and the value of row can be word, integer, floating number or binary data, and each territory inside same hash is only one
Without two, different.
Such as, service end, according to white list mark " 10001 ", " 10009 " and " 10005 " got, is looked into from hash
Asking corresponding white list link and operator, wherein, the white list corresponding with " 10001 " links and operator is respectively
" www.bbb.com " and operator " A ", the white list corresponding with " 10009 " links and operator is respectively " www.ccc.com "
With operator " U ", the white list corresponding with " 10005 " links and operator is respectively " www.aaa.com " and operator " D ",
Above-mentioned white list is linked by service end, operator and white list mark be sent to client as white list incremental data.
The embodiment of the present invention three arranges operator and the timestamp of correspondence for every white list link, and is updating white name
Dan Shi, updates and links corresponding operator and timestamp, the most newly-built Operation Log with white list, it is to avoid big in service end accumulation
The Operation Log of amount, improves write and the query performance of service end.Additionally, it is detailed to will be read by the white list of storage in internal memory
Feelings data and white list index data, send white list incremental data to client, it is possible to carry out the white list of client soon
Speed synchronizes.
As shown in Figure 4, fourth embodiment of the invention proposes a kind of method synchronizing white list, including:
Step 401, client receives the white list mark from service end, white list link and operator.
Step 402, when operator is for newly-increased operator, the white list mark received and white list are linked by client
Corresponding preservation;When operator is deletion action symbol, it is corresponding with the white list mark received that self is preserved by client
White list link is deleted.
Specifically, when operator is for newly-increased operator, client can be by corresponding white list mark and white list chain
Connect and be saved in local data base.When operator is deletion action symbol, whether client may determine that in local data base and preserves
Have receive white list mark, if it is, by local data base preserve this white list mark and with this white list
The link deletion that mark is corresponding;Otherwise, flow process is terminated.
Additionally, when operator is for amendment operator, it is right with the white list mark received that self is preserved by client
The white list link answered is revised as the white list link received.
In the present embodiment, when operator is for amendment operator, whether client may determine that in local data base and preserves
There is the white list mark received, if it is, repair local data base identifies corresponding linking with the white list received
Change the white list link received into;Otherwise, the white list received link and white list mark are added to local data base.
Client in the embodiment of the present invention four updates white list according to the operator received, and no longer pulls intermediate data
Sync client, thus eliminate mass of redundancy data, improve the operational efficiency of client.
As it is shown in figure 5, fifth embodiment of the invention proposes a kind of method synchronizing white list, including:
Step 501, client sends white list updating request to service end.
Wherein, white list updating request comprises timestamp progress msg.
Such as, white list updating request comprises timestamp progress msg for " 2016070607349 ".
Step 502, client receives white list incremental data and the maximum time stamp that service end returns.
Wherein, white list incremental data includes the link of one or more white list and links corresponding white name with white list
Single mark and operator.
Step 503, the timestamp progress msg self preserved is updated to the maximum time stamp received by client.
Such as, when the maximum time stamp received is for " 2016071809155 ", the timestamp that self preserves is entered by client
Degree information " 2016070607349 " is updated to " 2016071809155 ".
Step 504, client obtains the white list chain of a not processed mistake from the white list incremental data received
Connect as current link, the operator that current link is corresponding is judged, if newly-increased operator, then perform step 505;
If amendment operator, then perform step 506;If deletion action symbol, then perform step 509.
Step 505, current link and the white list corresponding with current link are identified by client adds local data to
Storehouse, and perform step 511.
Step 506, client judges whether preserve the white list mark that current link is corresponding in local data base, if
It is then to perform step 507;Otherwise, step 508 is performed.
Step 507, client according to corresponding with current link white list mark, by local data base with this white list
The link of mark correspondence is revised as current link, and performs step 511.
Step 508, current link and the white list corresponding with current link are identified by client adds local data to
Storehouse, and perform step 511.
Step 509, client judges whether preserve the white list mark that current link is corresponding in local data base, if
It is then to perform step 510;Otherwise, step 511 is performed.
Step 510, client according to corresponding with current link white list mark, by local data base preserves this is white
List mark and corresponding with this white list mark link deletion, and perform step 511.
Step 511, client judges the white list link whether also having not processed mistake in white list incremental data, if
Have, then perform step 504;Otherwise, flow process is terminated.
Client in the embodiment of the present invention five updates white list according to the operator received, and no longer pulls intermediate data
Sync client, thus eliminate mass of redundancy data, decrease the number of times of operation local data base, improve the fortune of client
Line efficiency.
As shown in Figure 6, sixth embodiment of the invention proposes a kind of device updating white list, is applied to service end, including:
Detection module 610, for detecting whether occur to update operation.
Newly-increased module 620, for when detection module 610 detects newly-increased operation, obtains newly-increased white list link, raw
Become timestamp, preserve corresponding with newly-increased operator for the timestamp of newly-increased white list link, generation.
Removing module 630, for when detection module 610 detects deletion action, by the operation corresponding with deletion action
Symbol is updated to deletion action symbol, generates timestamp, is the timestamp generated by the update of time stamp corresponding with deletion action.
Further, above-mentioned newly-increased module 620, it is additionally operable to identify into newly-increased white list link distribution white list, will be white
List mark with increase operator newly, newly-increased white list link and timestamp corresponding preservation.
Further, said apparatus, also include:
Modified module 640, for when detection module 610 detects amendment operation, obtaining white list mark and white list
Link, generates timestamp, self is preserved link with white list white list corresponding to mark, operator and timestamp are repaiied respectively
Change white list link, amendment operator and the timestamp of generation got into.
Above-mentioned removing module 630, specifically for when detection module 610 detects deletion action, obtains white list mark,
Generate timestamp, self is preserved be respectively modified as with white list operator corresponding to mark and timestamp deletion action accord with and
The timestamp generated.
Further, above-mentioned newly-increased module 620, it is additionally operable to newly-increased operator, white list mark and newly-increased white list
Link correspondence is saved in the first memory block, is saved in the second memory block by corresponding with timestamp for white list mark.
Correspondingly, above-mentioned modified module 640, it is additionally operable to corresponding white with white list mark by what the first memory block preserved
Name singular link and operator are respectively modified as white list link and the amendment operator got, by preserve in the second memory block
The timestamp corresponding with white list mark is revised as the timestamp generated.
Above-mentioned removing module 630, is additionally operable to repair the operator corresponding with white list mark preserved in the first memory block
Change deletion action symbol into, the timestamp corresponding with white list mark preserved in the second memory block is revised as the time generated
Stamp.
Further, said apparatus, also include:
Receiver module, asks for receiving the white list updating from client;
Acquisition module, the timestamp progress msg in asking according to white list updating, inquire about from the second memory block
More than the timestamp of timestamp progress msg, and obtain the white list mark corresponding with the timestamp inquired;
Enquiry module, for the white list mark got according to acquisition module, from the first memory block inquiry and this white name
The white list link of single mark correspondence and operator;
Sending module, for the white list link that enquiry module is inquired and operator, and the white list got
Mark is sent to client.
The embodiment of the present invention six arranges operator and the timestamp of correspondence for every white list link, and is updating white name
Dan Shi, updates and links corresponding operator and timestamp, the most newly-built Operation Log with white list, it is to avoid big in service end accumulation
The Operation Log of amount, improves write and the query performance of service end.Additionally, store white list details data in internal memory with white
List index data, it is simple to the white list of client is carried out Fast synchronization.
As it is shown in fig. 7, seventh embodiment of the invention proposes a kind of device synchronizing white list, it is applied to client, including:
First receiver module 710, for receiving white list mark, white list link and the operator from service end.
First more new module 720, for when operator is for newly-increased operator, receiving the first receiver module 710
White list mark is corresponding with white list link to be preserved;When operator is deletion action symbol, self is preserved with receive
The white list link deletion that white list mark is corresponding.
Further, the above-mentioned first more new module 720, it is additionally operable to, when operator is for amendment operator, self be preserved
Link, with white list white list corresponding to mark received, the white list being revised as receiving and link.
Specifically, the above-mentioned first more new module 720, specifically for when operator is for newly-increased operator, by corresponding white
List mark and white list link are saved in local data base;
When operator is for amendment operator, it is judged that whether local data base is preserved the white list mark received,
If it is, local data base, with the white list received, the white list chain that corresponding linking is revised as receiving will be identified
Connect;Otherwise, the white list received link and white list mark are added to local data base;
When operator is deletion action symbol, it is judged that whether local data base is preserved the white list mark received,
And when preserving, in judging local data base, the white list mark received, this white list that will preserve in local data base
Mark and corresponding with this white list mark link deletion.
Further, said apparatus, also include:
Sending module, for sending white list updating request to service end, comprises timestamp in white list updating request and enters
Degree information;
Second receiver module, for receiving the maximum time stamp that service end returns;
Second more new module, for being updated to maximum time stamp by the timestamp progress msg that self preserves.
In the embodiment of the present invention seven first more new module 720 updates white list according to the operator received, and no longer draws
Take intermediate data sync client, thus eliminate mass of redundancy data, decrease the number of times of operation local data base, improve
The operational efficiency of client.
As shown in Figure 8, in eighth embodiment of the invention a kind of renewal and synchronize white list system construction drawing, including
Service end 810 and client 820.
Wherein, service end 810, for when newly-increased operation being detected, obtain newly-increased white list link, when generating first
Between stab, by newly-increased white list link, the preservation corresponding with increasing operator newly of very first time stamp;When deletion action being detected, will
The operator corresponding with deletion action is updated to deletion action symbol, generates the second timestamp, by the time corresponding with deletion action
Stamp is updated to the second timestamp.
Further, above-mentioned service end 810, it is additionally operable to after obtaining newly-increased white list link, for newly-increased white name
Singular link distribution white list mark, by white list mark with increase operator newly, newly-increased white list link and the very first time stab right
Should preserve.
Further, above-mentioned service end 810, specifically for when amendment operation being detected, obtain white list mark with white
Name singular link, generates the 3rd timestamp, self is preserved link with white list white list corresponding to mark, operator and time
Stamp is respectively modified as white list link, amendment operator and the 3rd timestamp got;When deletion action being detected, obtain
White list identifies, and generates the second timestamp, and the operator corresponding with white list mark self preserved and timestamp are repaiied respectively
Change deletion action symbol and the second timestamp into.
Further, above-mentioned service end 810, be additionally operable to after obtaining newly-increased white list link, by newly-increased operator,
White list mark is corresponding with the link of newly-increased white list is saved in the first memory block, and white list mark is corresponding with very first time stamp
It is saved in the second memory block;When deletion action being detected, the behaviour corresponding with white list mark that will preserve in the first memory block
It is revised as deletion action symbol, when the timestamp corresponding with white list mark preserved in the second memory block is revised as second as symbol
Between stab;When amendment operation being detected, the white list corresponding with white list mark preserved in the first memory block is linked and grasp
Make white list link and amendment operator that symbol is respectively modified as getting, identify what the second memory block preserved with white list
Corresponding timestamp is revised as the 3rd timestamp.
Further, above-mentioned service end 810, it is additionally operable to receive the white list updating from client 820 and asks, according in vain
Timestamp progress msg during list is more newly requested, from the second memory block, inquiry is more than the timestamp of timestamp progress msg,
And obtain the white list mark corresponding with the timestamp inquired;According to the white list mark got, look into from the first memory block
Ask the white list corresponding with this white list mark to link and operator, and by the white list link inquired and operator, and
The white list mark got is sent to client 820.
Client 820, for receiving white list mark, white list link and the operator from service end 810, works as operation
When symbol is for newly-increased operator, preserve corresponding with white list link for the white list mark received;When operator is deletion action
Fu Shi, white list that is that self preserved and that receive identifies corresponding white list and links deletion.
Further, above-mentioned client 820, be additionally operable to operator for amendment operator time, by self preserve with connect
The white list link of the white list mark correspondence received is revised as the white list link received.
Further, above-mentioned client 820, it is additionally operable to receiving the white list mark from service end 810, white list chain
Connect with operator before, to service end 810 send white list updating request, white list updating request in comprise timestamp progress letter
Breath;After sending white list updating request to service end 810, receive the maximum time stamp that service end 810 returns, self is protected
The timestamp progress msg deposited is updated to maximum time stamp.
The embodiment of the present invention eight arranges operator and the timestamp of correspondence for every white list link, and in service end
During 810 renewal white list, update and link corresponding operator and timestamp, the most newly-built Operation Log with white list, it is to avoid
Service end 810 accumulates substantial amounts of Operation Log, improves write and the query performance of service end 810;Correspondingly, client 820
Update white list according to the operator received, no longer pull intermediate data sync client 820, thus eliminate bulk redundancy
Data, improve the operational efficiency of client 820.
It should be noted that in this article, term " includes ", " comprising " or its any other variant are intended to non-row
Comprising of his property, so that include that the process of a series of key element, method, article or device not only include those key elements, and
And also include other key elements being not expressly set out, or also include intrinsic for this process, method, article or device
Key element.In the case of there is no more restriction, statement " including ... " key element limited, it is not excluded that including this
The process of key element, method, article or device there is also other identical element.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive above-described embodiment side
Method can add the mode of required general hardware platform by software and realize, naturally it is also possible to by hardware, but a lot of in the case of
The former is more preferably embodiment.Based on such understanding, prior art is done by technical scheme the most in other words
The part going out contribution can embody with the form of software product, and this computer software product is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), including some instructions with so that a station terminal equipment (can be mobile phone, computer, take
Business device, air-conditioner, or the network equipment etc.) perform the method described in each embodiment of the present invention.
These are only the preferred embodiments of the present invention, not thereby limit the scope of the claims of the present invention, every utilize this
Equivalent structure or equivalence flow process that bright description and accompanying drawing content are made convert, or are directly or indirectly used in other relevant skills
Art field, is the most in like manner included in the scope of patent protection of the present invention.