A kind of system and method for the resource lock for controlling docking port resource to access
Technical field
The present invention relates to Internet technical field, more particularly to a kind of system for the resource lock for controlling docking port resource to access
And method.
Background technology
Existing Internet era, the service of website is packaged into series of computation machine data-interface easy to identify and is opened to
Go, there is provided used to third party developer, this behavior is just called OpenAPI, there is provided the platform of opening API is thus referred to as in itself
Open platform.By open platform, website can not only provide the easy access to Web page, can also carry out the data of complexity
Other operations such as interaction, their Web site are converted to the development platform of equal value with operating system.
General lock mechanism is used in database, if adding more database manipulation in operation flow, will certainly be dropped
Low interface access efficiency, if Lock Lee realizes that it is all time-consuming that file operation, which is similar to database manipulation, with the method for accessing file
Operation, so this patent will select caching mechanism to realize business lock mechanism.
Based on problem above, this patent adds a kind of business lock mechanism in original system, for using needing to limit
Resource conduct interviews limitation.The use environment of such a lock mechanism is operation layer, can carry out certain journey to the resource of operation layer
The locking of degree.In use, time, number and combined situation can be included by accessing limitation content.Implementation will be based on caching machine
System is realized, it is possible to reduce is locked the resource of consumption, is improved interface access efficiency.
The content of the invention
The purpose of the present invention is the control that mouthful resource accesses that achieves a butt joint, and reduces meaningless resource consumption, improves interface and visits
Ask efficiency.
A kind of system for the resource lock for controlling docking port resource to access,
The resource lock is suitable to docking port resource settings cached parameters information, and the system includes,
Cache library inquiry module, be adapted to respond in the outside application that accesses a certain interface resource and query caching storehouse on
The cached parameters information of the interface resource;
Access control module, if suitable for the cached parameters information of the interface resource, foundation in the caching storehouse be present
Cached parameters information receives or refused to apply for the outside of the interface resource, if the interface resource is not present in the caching storehouse
Cached parameters information, then receive to apply for the outside of the interface resource.
Wherein, the cached parameters information of the resource lock docking port resource settings includes time parameter and/or count parameter.
Wherein, when the time parameter cache information of interface resource be present in the caching storehouse, then the time parameter is triggered
Corresponding countdown is opened, and at the end of the countdown, receives the outside application of docking port resource access.
Wherein, when the count parameter cache information of interface resource be present in the caching storehouse, to outside docking port resource Shen
Counting how many times please, when outside request times exceed count parameter cache information, the outside application of refusal docking port resource.
Wherein, the interface resource includes OPENAPI or service.
A kind of method for the resource lock for controlling docking port resource to access,
The resource lock is suitable to docking port resource settings cached parameters information, and methods described includes,
The caching in the outside application for accessing a certain interface resource and query caching storehouse on the interface resource is responded to join
Number information;
If the cached parameters information of the interface resource in the caching storehouse be present, receive according to cached parameters information or
Refuse to apply for the outside of the interface resource, if the cached parameters information of the interface resource is not present in the caching storehouse,
Receive to apply for the outside of the interface resource.
Wherein, the cached parameters information of the resource lock docking port resource settings includes time parameter and/or count parameter.
Wherein, when the time parameter cache information of interface resource be present in the caching storehouse, then the time parameter is triggered
Corresponding countdown is opened, and at the end of the countdown, receives the outside application of docking port resource access.
Wherein, when the count parameter cache information of interface resource be present in the caching storehouse, to outside docking port resource Shen
Counting how many times please, when outside request times exceed count parameter cache information, the outside application of refusal docking port resource.
Wherein, the interface resource includes OPENAPI or service.
The present invention adds business lock mechanism in systems, for being conducted interviews limitation to needing to limit the resource that uses.This
The use environment of kind lock mechanism is operation layer, can carry out a certain degree of locking to the resource of operation layer.Can be big after use
Amount reduces the generation of harassing and wrecking information, while also reduces some resources by the possibility of Brute Force.Implementation will be based on slow
The mechanism of depositing is realized, it is possible to reduce lock the resource of consumption, after lock mechanism is added will not docking port access efficiency produce it is larger
Influence.
Brief description of the drawings
Fig. 1 is the structured flowchart of the application of the present invention;
Fig. 2 is the system construction drawing that embodiments of the invention provide;
Fig. 3 is the method flow diagram that embodiments of the invention provide.
Embodiment
With reference to the accompanying drawings and examples, the embodiment of the present invention is described in further detail.Implement below
Example is used to illustrate the present invention, but is not limited to the scope of the present invention.
Fig. 1 is the application structure figure of the embodiment of the present invention, and third party developer 100 is in application OPEN API or service
, it is necessary to be applied by resource lock 102 when 104.Resource lock 102 determines whether to accept applications.For resource lock 102, it is made
With being that OPEN API or service 104 are locked, with prevent third party developer 100 from arbitrarily apply OPEN API or
Person's service 104.
For example, resource lock 102 locks to OPEN API or service 104 first, third party developer 100 is proposing
During application, resource lock 102 first checks for OPEN API or services 104 lock-out state, if can then be received with application status
The application of third party developer, otherwise refuses.
A kind of embodiment provided by the invention as shown in Fig. 2 a kind of system for the resource lock for controlling docking port resource to access,
The resource lock is suitable to docking port resource settings cached parameters information, and the system includes,
Library inquiry module 200 is cached, is adapted to respond to apply for and in query caching storehouse the outside that a certain interface resource accesses
Cached parameters information on the interface resource;
Access control module 202, if suitable for the cached parameters information of the interface resource in the caching storehouse be present, according to
Receive or refuse to apply for the outside of the interface resource according to cached parameters information, provided if the interface is not present in the caching storehouse
The cached parameters information in source, then receive to apply for the outside of the interface resource.
The cached parameters information of the resource lock docking port resource settings includes time parameter and/or count parameter.It is described
When the time parameter cache information of interface resource be present in caching storehouse, then trigger countdown corresponding to the time parameter and open,
At the end of the countdown, receive the outside application of docking port resource access.Time of interface resource in the caching storehouse be present
During number parameter cache information, to the counting how many times of outside docking port resource bid, when outside request times are delayed more than count parameter
When depositing information, the outside application of refusal docking port resource.
For example, system sets a cached parameters for each OPEN API or service first, and cached parameters are deposited
Enter into caching storehouse, in an outside application, the parameter in system meeting query caching storehouse, parameter is not present in storehouse is cached
When, it can directly receive outside application;If cached parameters be present, need to judge that the type of cached parameters is either secondary for the time
Number;Time parameter directly performs countdown, treats that countdown technology is followed by being applied by outside, provides OPEN api interfaces or clothes
Business;Count parameter then performs+1 operation to access times, applies in the case where access times are no more than threshold condition outside receiving.
During a network payment, it is generally the case that one would generally be required to network payment person in line platform
Short message or mailbox checking, in order to prevent repeated authentication, and prevent disabled user from being cracked using the method for exhaustion.Resource lock can be to test
Card addition time lock and/or number lock.Make to be able to validate only within a period of time once and/or, within a period of time, can only test
Demonstrate,prove how many times.
Accordingly, an embodiment of the present invention provides a kind of method for the resource lock for controlling docking port resource to access, such as
Shown in Fig. 3,
The resource lock is suitable to docking port resource settings cached parameters information, and methods described includes,
S300, respond in the outside application accessed a certain interface resource and query caching storehouse on the slow of the interface resource
Deposit parameter information;
S302, if the cached parameters information of the interface resource in the caching storehouse be present, according to cached parameters information
Receive or refuse to apply for the outside of the interface resource, if the cached parameters that the interface resource is not present in the caching storehouse are believed
Breath, then receive to apply for the outside of the interface resource.
The cached parameters information of the resource lock docking port resource settings includes time parameter and/or count parameter.It is described
When the time parameter cache information of interface resource be present in caching storehouse, then trigger countdown corresponding to the time parameter and open,
At the end of the countdown, receive the outside application of docking port resource access.Time of interface resource in the caching storehouse be present
During number parameter cache information, to the counting how many times of outside docking port resource bid, when outside request times are delayed more than count parameter
When depositing information, the outside application of refusal docking port resource.
Embodiment of above is merely to illustrate the present invention, and not limitation of the present invention, about the common of technical field
Technical staff, without departing from the spirit and scope of the present invention, it can also make a variety of changes and modification, thus it is all
Equivalent technical scheme falls within scope of the invention, and scope of patent protection of the invention should be defined by the claims.