CN110233882B - Page resource access control method, device, system, storage medium and equipment - Google Patents

Page resource access control method, device, system, storage medium and equipment Download PDF

Info

Publication number
CN110233882B
CN110233882B CN201910433743.0A CN201910433743A CN110233882B CN 110233882 B CN110233882 B CN 110233882B CN 201910433743 A CN201910433743 A CN 201910433743A CN 110233882 B CN110233882 B CN 110233882B
Authority
CN
China
Prior art keywords
url link
page resource
request
private page
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910433743.0A
Other languages
Chinese (zh)
Other versions
CN110233882A (en
Inventor
张强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201910433743.0A priority Critical patent/CN110233882B/en
Publication of CN110233882A publication Critical patent/CN110233882A/en
Application granted granted Critical
Publication of CN110233882B publication Critical patent/CN110233882B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The disclosure provides a method, a device, a system, a storage medium and a device for controlling access to page resources, wherein the method comprises the following steps: receiving a URL link request of private page resources, and acquiring request time of the URL link request; acquiring a preset time interval corresponding to the request time; each private page resource corresponds to at least two continuous preset time intervals; generating a timestamp of the URL link request according to a preset time interval; the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to the non-same preset time intervals are different; a URL link is generated that includes a timestamp. According to the method and the device, the obtained URL links are the same when the same private page resource is repeatedly requested to be accessed within the preset time interval, and then the private page resource can be quickly loaded from the local cache of the client according to the same URL link when the private page resource is repeatedly accessed within the preset time interval, so that the loading flow of the private page resource is effectively reduced.

Description

Page resource access control method, device, system, storage medium and equipment
Technical Field
The present disclosure relates to the field of access to page resources, and in particular, to a method, an apparatus, a system, a storage medium, and a device for controlling access to page resources.
Background
A cdn (content Delivery network), that is, a content Delivery network, depends on edge servers deployed in various places, and through functional modules of load balancing, content Delivery, scheduling, and the like of a central platform, a user obtains a required content nearby, network congestion is reduced, and a user access response speed and a hit rate are improved.
For resources deployed through the CDN, in order to achieve confidentiality of the resources, a Resource owner generally sets uploaded resources as private page resources, and when a private page Resource visitor requests access to the private page resources at different times of a client, a server issues different URL (Uniform Resource Locator) links, and then the client downloads and accesses the private page resources according to the different URL links. That is, the time for requesting access to the private page resource is different, the URL link issued each time is also different, and the private page resource needs to be acquired according to the different URL links.
In the process of implementing the invention, the inventor finds that: when repeatedly requesting access to the same private page resource in a short time, the problems of slow loading of the private page resource and increased page resource loading flow are easy to occur.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a method, an apparatus, a system, a storage medium, and a device for controlling access to a page resource.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for controlling access to a page resource, including the following steps:
the method comprises the steps that a server receives a URL link request of a private page resource sent by a client side, and the request time of the URL link request is obtained; the URL link request of the private page resource comprises a download address of the private page resource and request time of the URL link request;
the server acquires a preset time interval corresponding to the request time; each private page resource corresponds to at least two continuous preset time intervals;
the server generates a timestamp of the URL link request according to the preset time interval; the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to the non-same preset time intervals are different;
the server generates a URL link containing the timestamp so that the client receives the URL link sent by the server; and when the URL link is stored in the cache system of the client, the client is enabled to acquire the private page resource corresponding to the URL link from the cache system.
According to a second aspect of the embodiments of the present disclosure, there is provided an access control apparatus for a page resource, including:
the request receiving module is used for receiving a URL link request of a private page resource sent by a client by a server and acquiring the request time of the URL link request; the URL link request of the private page resource comprises a download address of the private page resource and request time of the URL link request;
the time interval acquisition module is used for acquiring a preset time interval corresponding to the request time by the server; each private page resource corresponds to at least two continuous preset time intervals;
the timestamp acquisition module is used for generating timestamps of the URL link requests by the server according to the preset time intervals, wherein the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to non-same preset time intervals are different;
the link acquisition module is used for generating a URL link containing the timestamp by the server so as to enable the client to receive the URL link sent by the server; and when the URL link is stored in the cache system of the client, the client is enabled to acquire the private page resource corresponding to the URL link from the cache system.
According to a third aspect of the embodiments of the present disclosure, there is provided an access control system for page resources, including a client and a server;
the server is configured to receive a URL link request of a private page resource sent by a client and acquire the request time of the URL link request; acquiring a preset time interval corresponding to the request time, wherein each private page resource corresponds to at least two continuous preset time intervals; generating timestamps of the URL link requests according to the preset time intervals, wherein the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to non-same preset time intervals are different; generating a URL link containing the timestamp; the URL link request of the private page resource comprises a download address of the private page resource and request time of the URL link request;
the client is configured to issue a URL link request of the private page resource to a server; receiving a URL link sent by the server; and if the URL link is stored in the cache system, acquiring the private page resource corresponding to the URL link from the cache system.
According to a third aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps of the aforementioned access control method for page resources.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an access control device for a page resource, including a memory, a processor and a computer program stored in the memory and executable by the processor, wherein the processor implements the steps of the access control method for a page resource as described above when executing the computer program.
Therefore, the technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the method and the device, the preset time interval corresponding to the request time is obtained, and the timestamp of the URL link request is generated according to the preset time interval, so that when the same private page resource is repeatedly requested to be accessed in the preset time interval, the obtained URL links are the same, the private page resource needs to be requested to be obtained from the server except for the first time when the private page resource is requested to be accessed in the preset time interval, the private page resource can be quickly loaded from the local cache of the client according to the same URL link when the private page resource is requested to be accessed in other time, and the loading flow of the private page resource is effectively reduced. Furthermore, the URL link is calculated according to the preset time interval corresponding to the request time, and the URL link is cached without using middleware, so that the cost is reduced, and the cache loss is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
For a better understanding and practice, the invention is described in detail below with reference to the accompanying drawings.
Drawings
FIG. 1 is a schematic block diagram of an application environment illustrating a method for access control of page resources according to an exemplary embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a method for controlling access to a page resource according to an exemplary embodiment of the disclosure;
FIG. 3 is a schematic diagram illustrating a method for controlling access to a page resource according to an exemplary embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating URL link expiration time according to an exemplary embodiment of the present disclosure;
fig. 5 is a block diagram illustrating a structure of an access control device for a page resource according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if/if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Turning to FIG. 1, a schematic block diagram of an application environment for a method for access control of page resources is shown in an exemplary embodiment.
As shown in fig. 1, the application environment of the access control method of page resources of this embodiment includes a client 1 and a server (not shown).
The client 1 includes, but is not limited to, various terminals such as a personal computer, a notebook computer, a smart phone, and a tablet computer. The client side is internally provided with application programs such as a browser, a user can open a webpage through the browser and trigger access to private page resources in the webpage, and therefore the URL link request of the private page resources is sent to the server.
In this implementation, the client 1 includes a processor, a memory, a display interface, a display screen, and an input device connected by a system bus. The processor of the client is used for providing computing and control capabilities, including triggering access to a private resource in a webpage, and controlling sending of a URL link request of the private page resource to a server, wherein the URL link request of the private page resource may include a download address of the private page resource and a request time of the URL link request. The download address of the private page resource usually carries an identifier (objectkey) of the private page resource to uniquely identify the private page resource. The memory of the client comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, and computer programs and information for a processor to perform its operations. The internal memory provides an environment for the operation of an operating system and a client program in the nonvolatile storage medium. And the display interface of the client is used for the communication between the processor and the display screen. The display screen of the client can be a liquid crystal display screen or an electronic ink display screen, and the input device of the client can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the client, an external keyboard, a touch pad or a mouse and the like.
In this embodiment, the servers include a URL issuing server 21 and a CDN server 22.
The URL issuing server 21 includes a processor, a memory, an input interface, and an output interface. The processor of the URL issuing server is used for providing calculation and control capacity, receiving a URL link request of a private page resource sent by a client through an input interface, and acquiring the request time of the URL link request; acquiring a preset time interval corresponding to the request time; each private page resource corresponds to at least two continuous preset time intervals; generating a timestamp of the URL link request according to the preset time interval; the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to the non-same preset time intervals are different; generating a URL link containing the timestamp. The memory of the URL issuing server comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, and computer programs and information for a processor to perform its operations. The internal memory provides an environment for the operation of an operating system and a client program in the nonvolatile storage medium. The input interface of the URL issuing server is used to receive information sent by the client, for example, receive a URL link request of a private page resource sent by the client. The output interface of the URL issuing server is used to send information to the client, for example, a URL link generated by the processor and containing the timestamp is sent to the client.
The CDN server 22 includes a processor, a memory, an input interface, and an output interface. The processor of the CDN server is used for providing computing and control capacity, receiving an access request of private page resources sent by the URL link through the input interface, and acquiring access request time; comparing the access request time with the time stamp of the URL link request, and if the access request time exceeds the time stamp of the URL link request, sending overtime reminding information; and if the access request time does not exceed the time stamp of the URL link request, sending out the private page resource corresponding to the URL link. The memory of the CDN server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, and computer programs and information for a processor to perform its operations. The internal memory provides an environment for the operation of an operating system and a client program in the nonvolatile storage medium. The input interface of the CDN server is configured to receive information sent by a client, for example, receive an access request of a private page resource sent by the URL link. The output interface of the CDN server is configured to send information to the client, for example, send timeout reminding information to the client, or send a page resource corresponding to the URL link to the client.
The above-described embodiments of the client, the URL issuing server and the CDN server are merely exemplary, components included therein are not limited to the above-described exemplary embodiments, and the units described as separate components may or may not be physically separate, and components displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed on multiple network units, and some or all of the components may be selected according to actual needs to implement the purpose of the present disclosure.
Example 1
Please refer to fig. 2, which is a flowchart illustrating a method for controlling access to a page resource according to an exemplary embodiment of the present disclosure, including the following steps:
step S1: receiving a URL link request of private page resources, and acquiring the request time of the URL link request.
The private page resource is a page resource set by a resource owner and used in a limited right and/or a limited time, wherein the page resource may include but is not limited to: pictures, text, files, applications, etc. Specifically, the URL link obtained each time the private page resource is requested to be obtained generally has timeliness, and if the time for requesting to obtain the private page resource exceeds the timeliness of the URL link, the private page resource cannot be obtained through the URL link, and a new URL link needs to be obtained again; and if the time for requesting to acquire the private page resource does not exceed the time limit of the URL link, acquiring the private page resource through the URL link.
The URL link request of the private page resource may include a download address of the private page resource and a request time of the URL link request. The download address of the private page resource usually carries an identifier (objectkey) of the private page resource to uniquely identify the private page resource.
In the embodiment of the disclosure, when a user opens a webpage through a browser of a client, access to a private page resource in the webpage is triggered, at this time, the client sends a URL link request of the private page resource to a URL issue server, so as to obtain a corresponding private page resource locally at a CDN server or the client, and display the private page resource in the client. And after receiving a URL link request of the private page resource sent by the client, the URL issuing server acquires a download address of the private page resource and the request time of the URL link request from the URL link request of the private page resource, and then calculates and acquires the URL link.
Step S2: acquiring a preset time interval corresponding to the request time; wherein, each private page resource corresponds to at least two continuous preset time intervals.
The preset time interval is a plurality of time intervals with equal length, which are formed by dividing the time of one day, and the length of the time interval can be set according to needs, for example, the time interval is set to be 1 hour or 2 hours. In order to conveniently obtain the private page resources, each private page resource corresponds to at least two continuous preset time intervals. In the embodiment of the present disclosure, a day is divided into 24 preset time intervals with a time length of 1 hour, where the 24 preset time intervals are, in order, Period1 ═ 0, 1], (Period 2 ═ 1, 2], (Period 3 ═ 2, 3], (… Period24 ═ 23, 24 ]. if the request time is 2 hours and 15 minutes, the corresponding preset time interval Period3 ═ 2, 3.
Step S3: generating a timestamp of the URL link request according to the preset time interval; the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to the non-same preset time intervals are different.
The step of generating the timestamp of the URL link request according to the preset time interval includes:
and acquiring the expiration time length of the private page resource, and adding the maximum time value of the preset time interval and the expiration time length of the private page resource to generate a time stamp of the URL link request. In the embodiment of the disclosure, according to the fact that the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to the non-same preset time intervals are different, not only can a user repeatedly access the same private page resource in a short time, but also the private page resource can be quickly obtained from a local cache, and can have certain security and confidentiality. For example, please refer to fig. 3 and 4, the request times of the URL link requests of the private page resources are T1, T2, T3, T4, T5, T6, and T7, respectively, the preset time intervals corresponding to T1, T2, T3, T4, and T5 are Period1, the preset time intervals corresponding to T5, T6, and T7 are Period2, and if the expiration time length of the private page resource is ExpiredIn, when the request is initiated at T1 time, the URL issuing server calculates the obtained timestamp to be the maximum time value + ExpiredIn of Period1 ═ Period 1; when a request is initiated at time T2, the URL issuing server calculates that the obtained timestamp is maximum time value + ExpriedIn of Period1 of timestamp 2; when a request is initiated at time T3, the URL issuing server calculates that the obtained timestamp is maximum time value + ExpriedIn of Period1 of timestamp 3; when a request is initiated at time T4, the URL issuing server calculates that the obtained timestamp is maximum time value + ExpriedIn of Period1 of timestamp 4; when a request is initiated at time T5, the URL issuing server calculates that the obtained timestamp is maximum time value + ExpriedIn of Period2 of timestamp 5; when a request is initiated at time T6, the URL issuing server calculates that the obtained timestamp is maximum time value + ExpriedIn of Period2 of timestamp 6; when a request is initiated at time T7, the URL issuing server calculates the obtained timestamp as maximum time value + ExpriedIn of Period2 of timestamp 7. The time stamps from T1 to T4 have equal values, so that the URLs used by the clients are the same, the clients use the same URL to initiate calls in different time, cached files can be used locally without initiating HTTP requests, and therefore the private page resources can be obtained quickly. In the following description, a specific example is given, where the preset time interval is (2, 3), and the expiration time length of the private page resource is 2 hours, the time stamp of the URL link request is 3+ 2-5, that is, the time stamp of the URL link request is 5 times of the URL link request time, and where the preset time interval is (23, 24), and the expiration time length of the private page resource is 2 hours, the time stamp of the URL link request is 24+ 2-26, that is, the time stamp of the URL link request is 2 times of the next day of the URL link request time.
In the embodiment of the present disclosure, a preset time interval corresponding to the request time is obtained by the URL issuing server, and a timestamp of the URL link request is generated according to the preset time interval.
Step S4: generating a URL link containing the timestamp.
Wherein the URL link may include a download address that may include a private page resource and the timestamp. The download address of the private page resource usually carries an identifier (objectkey) of the private page resource to uniquely identify the private page resource. Specifically, the URL link is a link formed by splicing a download address of a private page resource and the timestamp, for example, the URL link is URL ═ https:// objectKeyt ═ timestamp, where "objectKey" is an identifier of the page resource, and "https:// objectKey? "is a download address carrying the identification of the private page resource, t is a key, and timestamp is a key value, i.e. the timestamp.
In the embodiment of the present disclosure, the URL link including the timestamp is generated by the URL issuing server according to the timestamp.
According to the method and the device, the preset time interval corresponding to the request time is obtained, and the timestamp of the URL link request is generated according to the preset time interval, so that when the same private page resource is repeatedly requested to be accessed in the preset time interval, the obtained URL links are the same, the private page resource needs to be requested to be obtained from the server except for the first time when the private page resource is requested to be accessed in the preset time interval, the private page resource can be quickly loaded from the local cache of the client according to the same URL link when the private page resource is requested to be accessed in other time, and the loading flow of the private page resource is effectively reduced. Furthermore, the URL link is calculated according to the preset time interval corresponding to the request time, and middleware such as Mysql or Redis does not need to be used for caching the URL link, so that the cost is reduced, and the cache loss is reduced.
In a preferred embodiment, after the generating the URL link containing the timestamp, the method further includes the following steps:
step S5: receiving an access request of the private page resource sent by the URL link, and acquiring the access request time of the private page resource; and comparing the access request time with the time stamp in the URL link, and if the access request time exceeds the time stamp in the URL link, sending overtime reminding information.
Further, if the access request time does not exceed the timestamp in the URL link, the private page resource is sent.
Referring to fig. 4, in the embodiment of the present disclosure, the generated URL link has timeliness, and the effective time of the generated URL link is a time period, specifically, a time stamp from the maximum time value of the last preset time interval closest to the preset time interval corresponding to the URL link.
By setting the timeliness of the URL link, the private page resource is prevented from being infinitely used for a long time, and the safety and the effectiveness of the private page resource are further realized.
In the embodiment of the disclosure, a user inputs a URL link at a client to send an access request of a private page resource to a CDN server; the CDN server receives an access request of the private page resource sent by the URL link and acquires access request time of the private page resource; comparing the access request time with the timestamp in the URL link, and if the access request time exceeds the timestamp in the URL link, sending overtime reminding information to a client; and if the access request time does not exceed the time stamp in the URL link, sending the private page resource to the client, so that the private page resource is displayed at the client.
Example 2
Referring to fig. 5, corresponding to the method for controlling access to a page resource in embodiment 1, the present disclosure further provides an apparatus for controlling access to a page resource, including:
the request receiving module 21 is configured to receive a URL link request of a private page resource, and obtain a request time of the URL link request.
A time interval obtaining module 22, configured to obtain a preset time interval corresponding to the request time; wherein, each private page resource corresponds to at least two continuous preset time intervals.
The timestamp obtaining module 23 is configured to generate a timestamp of the URL link request according to the preset time interval; the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to the non-same preset time intervals are different.
And a link obtaining module 24, configured to generate a URL link including the timestamp.
The private page resource is a page resource set by a resource owner and used in a limited right and/or a limited time, wherein the page resource may include but is not limited to: pictures, text, files, applications, etc. Specifically, the URL link obtained each time the private page resource is requested to be obtained generally has timeliness, and if the time for requesting to obtain the private page resource exceeds the timeliness of the URL link, the private page resource cannot be obtained through the URL link, and a new URL link needs to be obtained again; and if the time for requesting to acquire the private page resource does not exceed the time limit of the URL link, acquiring the private page resource through the URL link.
The URL link request of the private page resource may include a download address of the private page resource and a request time of the URL link request. The download address of the private page resource usually carries an identifier (objectkey) of the private page resource to uniquely identify the private page resource.
The preset time interval is a plurality of time intervals with equal length, which are formed by dividing the time of one day, and the length of the time interval can be set according to needs, for example, the time interval is set to be 1 hour or 2 hours. In order to conveniently obtain the private page resources, each private page resource corresponds to at least two continuous preset time intervals. In the embodiment of the present disclosure, a day is divided into 24 preset time intervals with a time length of 1 hour, where the 24 preset time intervals are, in order, Period1 ═ 0, 1], (Period 2 ═ 1, 2], (Period 3 ═ 2, 3], (… Period24 ═ 23, 24 ]. if the request time is 2 hours and 15 minutes, the corresponding preset time interval Period3 ═ 2, 3.
Wherein the URL link may include a download address of a private page resource and the timestamp. The download address of the private page resource usually carries an identifier (objectkey) of the private page resource to uniquely identify the private page resource. Specifically, the URL link is a link formed by splicing a download address of a private page resource and the timestamp, for example, the URL link is URL ═ https:// objectKeyt ═ timestamp, where "objectKey" is an identifier of the page resource, and "https:// objectKey? "is a download address carrying the identification of the private page resource, t is a key, and timestamp is a key value, i.e. the timestamp.
The timestamp obtaining module 23 is configured to, when generating a timestamp of the URL link request, specifically, obtain an expiration time length of the private page resource, add the maximum time value of the preset time interval and the expiration time length of the private page resource, and generate the timestamp of the URL link request.
The preset time interval is a plurality of time intervals with equal length, which are formed by dividing the time of one day.
According to the method and the device, the preset time interval corresponding to the request time is obtained, and the timestamp of the URL link request is generated according to the preset time interval, so that when the same private page resource is repeatedly requested to be accessed in the preset time interval, the obtained URL links are the same, the private page resource needs to be requested to be obtained from the server except for the first time when the private page resource is requested to be accessed in the preset time interval, the private page resource can be quickly loaded from the local cache of the client according to the same URL link when the private page resource is requested to be accessed in other time, and the loading flow of the private page resource is effectively reduced. Furthermore, the URL link is calculated according to the preset time interval corresponding to the request time, and middleware such as Mysql or Redis does not need to be used for caching the URL link, so that the cost is reduced, and the cache loss is reduced.
In a more preferred embodiment, the access control device for the page resource further includes a timeout determining module (not shown in the figure), configured to receive an access request of the private page resource sent through the URL link, and obtain an access request time of the private page resource; and comparing the access request time with the time stamp in the URL link, and if the access request time exceeds the time stamp in the URL link, sending overtime reminding information. And if the access request time does not exceed the time stamp in the URL link, sending the private page resource. By setting the timeliness of the URL link, the private page resource is prevented from being infinitely used for a long time, and the safety and the effectiveness of the private page resource are further realized.
Example 3
Referring to fig. 1, corresponding to the method for controlling access to a page resource in embodiment 1, the present disclosure further provides a system for controlling access to a page resource, including a client and a server;
the server is configured to receive a URL link request of a private page resource and acquire the request time of the URL link request; acquiring a preset time interval corresponding to the request time, wherein each private page resource corresponds to at least two continuous preset time intervals; generating timestamps of the URL link requests according to the preset time intervals, wherein the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to non-same preset time intervals are different; generating a URL link containing the timestamp;
the client is configured to issue a URL link request of the private page resource to a server; receiving a URL link sent by the server; and if the URL link is stored in the cache system, acquiring the private page resource corresponding to the URL link from the cache system.
The private page resource is a page resource set by a resource owner and used in a limited right and/or a limited time, wherein the page resource may include but is not limited to: pictures, text, files, applications, etc. Specifically, the URL link obtained each time the private page resource is requested to be obtained generally has timeliness, and if the time for requesting to obtain the private page resource exceeds the timeliness of the URL link, the private page resource cannot be obtained through the URL link, and a new URL link needs to be obtained again; and if the time for requesting to acquire the private page resource does not exceed the time limit of the URL link, acquiring the private page resource through the URL link.
The URL link request of the private page resource may include a download address of the private page resource and a request time of the URL link request. The download address of the private page resource usually carries an identifier (objectkey) of the private page resource to uniquely identify the private page resource.
The preset time interval is a plurality of time intervals with equal length, which are formed by dividing the time of one day, and the length of the time interval can be set according to needs, for example, the time interval is set to be 1 hour or 2 hours. In order to conveniently obtain the private page resources, each private page resource corresponds to at least two continuous preset time intervals. In the embodiment of the present disclosure, a day is divided into 24 preset time intervals with a time length of 1 hour, where the 24 preset time intervals are, in order, Period1 ═ 0, 1], (Period 2 ═ 1, 2], (Period 3 ═ 2, 3], (… Period24 ═ 23, 24 ]. if the request time is 2 hours and 15 minutes, the corresponding preset time interval Period3 ═ 2, 3.
Wherein the URL link may include a download address of a private page resource and the timestamp. The download address of the private page resource usually carries an identifier (objectkey) of the private page resource to uniquely identify the private page resource. Specifically, the URL link is a link formed by splicing a download address of a private page resource and the timestamp, for example, the URL link is URL ═ https:// objectKeyt ═ timestamp, where "objectKey" is an identifier of the page resource, and "https:// objectKey? "is a download address carrying the identification of the private page resource, t is a key, and timestamp is a key value, i.e. the timestamp.
The client is further configured to: and if the URL link is not stored in the cache system, acquiring the private page resource corresponding to the URL link from the server according to the URL link.
The server is further configured to: and acquiring the expiration time length of the private page resource, and adding the maximum time value of the preset time interval and the expiration time length of the private page resource to generate a time stamp of the URL link request.
The preset time interval is a plurality of time intervals with equal length, which are formed by dividing the time of one day.
According to the method and the device, the preset time interval corresponding to the request time is obtained, and the timestamp of the URL link request is generated according to the preset time interval, so that when the same private page resource is repeatedly requested to be accessed in the preset time interval, the obtained URL links are the same, the private page resource needs to be requested to be obtained from the server except for the first time when the private page resource is requested to be accessed in the preset time interval, the private page resource can be quickly loaded from the local cache of the client according to the same URL link when the private page resource is requested to be accessed in other time, and the loading flow of the private page resource is effectively reduced. Furthermore, the URL link is calculated according to the preset time interval corresponding to the request time, and middleware such as Mysql or Redis does not need to be used for caching the URL link, so that the cost is reduced, and the cache loss is reduced.
The server is further configured to: receiving an access request of the private page resource sent by the URL link, and acquiring the access request time of the private page resource; and comparing the access request time with the time stamp in the URL link, and if the access request time exceeds the time stamp in the URL link, sending overtime reminding information. And if the access request time does not exceed the time stamp in the URL link, sending the private page resource. By setting the timeliness of the URL link, the private page resource is prevented from being infinitely used for a long time, and the safety and the effectiveness of the private page resource are further realized.
The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing the steps of the access control method for page resources as in embodiment 1, including:
receiving a URL link request of private page resources, and acquiring the request time of the URL link request;
acquiring a preset time interval corresponding to the request time; each private page resource corresponds to at least two continuous preset time intervals;
generating a timestamp of the URL link request according to the preset time interval; the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to the non-same preset time intervals are different;
generating a URL link containing the timestamp.
According to the method and the device, the preset time interval corresponding to the request time is obtained, and the timestamp of the URL link request is generated according to the preset time interval, so that when the same private page resource is repeatedly requested to be accessed in the preset time interval, the obtained URL links are the same, the private page resource needs to be requested to be obtained from the server except for the first time when the private page resource is requested to be accessed in the preset time interval, the private page resource can be quickly loaded from the local cache of the client according to the same URL link when the private page resource is requested to be accessed in other time, and the loading flow of the private page resource is effectively reduced. Furthermore, the URL link is calculated according to the preset time interval corresponding to the request time, and middleware such as Mysql or Redis does not need to be used for caching the URL link, so that the cost is reduced, and the cache loss is reduced.
The present disclosure may take the form of a computer program product embodied on one or more storage media including, but not limited to, disk storage, CD-ROM, optical storage, and the like, having program code embodied therein. Computer readable storage media, which include both non-transitory and non-transitory, removable and non-removable media, may implement any method or technology for storage of information. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of the storage medium of the computer include, but are not limited to: phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technologies, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium, may be used to store information that may be accessed by a computing device.
The present disclosure also provides an access control device for a page resource, including a storage, a processor, and a computer program stored in the storage and executable by the processor, where the processor executes the computer program to implement the steps of the access control method for a page resource in embodiment 1, including:
receiving a URL link request of private page resources, and acquiring the request time of the URL link request;
acquiring a preset time interval corresponding to the request time; each private page resource corresponds to at least two continuous preset time intervals;
generating a timestamp of the URL link request according to the preset time interval; the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to the non-same preset time intervals are different;
generating a URL link containing the timestamp.
According to the method and the device, the preset time interval corresponding to the request time is obtained, and the timestamp of the URL link request is generated according to the preset time interval, so that when the same private page resource is repeatedly requested to be accessed in the preset time interval, the obtained URL links are the same, the private page resource needs to be requested to be obtained from the server except for the first time when the private page resource is requested to be accessed in the preset time interval, the private page resource can be quickly loaded from the local cache of the client according to the same URL link when the private page resource is requested to be accessed in other time, and the loading flow of the private page resource is effectively reduced. Furthermore, the URL link is calculated according to the preset time interval corresponding to the request time, and middleware such as Mysql or Redis does not need to be used for caching the URL link, so that the cost is reduced, and the cache loss is reduced.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for those skilled in the art, variations and modifications can be made without departing from the spirit of the invention, and these are within the scope of the invention.

Claims (15)

1. A method for controlling access to page resources is characterized by comprising the following steps:
the method comprises the steps that a server receives a URL link request of a private page resource sent by a client side, and the request time of the URL link request is obtained; the URL link request of the private page resource comprises a download address of the private page resource and request time of the URL link request;
the server acquires a preset time interval corresponding to the request time; each private page resource corresponds to at least two continuous preset time intervals;
the server generates a timestamp of the URL link request according to the preset time interval; the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to the non-same preset time intervals are different;
the server generates a URL link containing the timestamp so that the client receives the URL link sent by the server; and when the URL link is stored in the cache system of the client, the client is enabled to acquire the private page resource corresponding to the URL link from the cache system.
2. The method for controlling access to a page resource according to claim 1,
the step of generating the timestamp of the URL link request according to the preset time interval includes:
and acquiring the expiration time length of the private page resource, and adding the maximum time value of the preset time interval and the expiration time length of the private page resource to generate a time stamp of the URL link request.
3. The method according to claim 1, wherein the preset time interval is a plurality of time intervals of equal length divided by a day time.
4. The method for controlling access to a page resource according to claim 1,
after the generating the URL link containing the timestamp, the method further comprises the following steps:
receiving an access request of the private page resource sent by the URL link, and acquiring the access request time of the private page resource; and comparing the access request time with the time stamp in the URL link, and if the access request time exceeds the time stamp in the URL link, sending overtime reminding information.
5. An apparatus for controlling access to a page resource, comprising:
the request receiving module is used for receiving a URL link request of a private page resource sent by a client by a server and acquiring the request time of the URL link request; the URL link request of the private page resource comprises a download address of the private page resource and request time of the URL link request;
the time interval acquisition module is used for acquiring a preset time interval corresponding to the request time by the server; each private page resource corresponds to at least two continuous preset time intervals;
the timestamp acquisition module is used for generating timestamps of the URL link requests by the server according to the preset time intervals, wherein the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to non-same preset time intervals are different;
the link acquisition module is used for generating a URL link containing the timestamp by the server so as to enable the client to receive the URL link sent by the server; and when the URL link is stored in the cache system of the client, the client is enabled to acquire the private page resource corresponding to the URL link from the cache system.
6. The device for controlling access to a page resource according to claim 5, wherein the timestamp obtaining module is configured to obtain an expiration time length of the private page resource, and add the maximum time value of the preset time interval and the expiration time length of the private page resource to generate a timestamp of the URL link request.
7. The apparatus for controlling access to a page resource according to claim 5, wherein the predetermined time interval is a plurality of time intervals of equal length divided by a time of day.
8. The device for controlling access to a page resource according to claim 5, further comprising a timeout determining module, configured to receive an access request of the private page resource sent through the URL link, and obtain an access request time of the private page resource; and comparing the access request time with the time stamp in the URL link, and if the access request time exceeds the time stamp in the URL link, sending overtime reminding information.
9. The system for controlling the access of the page resources is characterized by comprising a client and a server;
the server is configured to receive a URL link request of a private page resource sent by a client and acquire the request time of the URL link request; acquiring a preset time interval corresponding to the request time, wherein each private page resource corresponds to at least two continuous preset time intervals; generating timestamps of the URL link requests according to the preset time intervals, wherein the timestamps corresponding to the same preset time interval are the same, and the timestamps corresponding to non-same preset time intervals are different; generating a URL link containing the timestamp; the URL link request of the private page resource comprises a download address of the private page resource and request time of the URL link request;
the client is configured to issue a URL link request of the private page resource to a server; receiving a URL link sent by the server; and if the URL link is stored in the cache system, acquiring the private page resource corresponding to the URL link from the cache system.
10. The system for access control of page resources of claim 9, wherein said client is further configured to: and if the URL link is not stored in the cache system, acquiring the private page resource corresponding to the URL link from the server according to the URL link.
11. The system for controlling access to page resources of claim 9,
the server is further configured to: and acquiring the expiration time length of the private page resource, and adding the maximum time value of the preset time interval and the expiration time length of the private page resource to generate a time stamp of the URL link request.
12. The system for controlling access to page resources of claim 9,
the preset time interval is a plurality of time intervals with equal length, which are formed by dividing the time of one day.
13. The system for controlling access to page resources of claim 9,
the server is further configured to: receiving an access request of the private page resource sent by the URL link, and acquiring the access request time of the private page resource; and comparing the access request time with the time stamp in the URL link, and if the access request time exceeds the time stamp in the URL link, sending overtime reminding information.
14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for controlling access to a page resource according to any one of claims 1 to 4.
15. An access control device for page resources, comprising a memory, a processor and a computer program stored in the storage and executable by the processor, wherein the processor implements the steps of the access control method for page resources according to any one of claims 1 to 4 when executing the computer program.
CN201910433743.0A 2019-05-23 2019-05-23 Page resource access control method, device, system, storage medium and equipment Active CN110233882B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910433743.0A CN110233882B (en) 2019-05-23 2019-05-23 Page resource access control method, device, system, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910433743.0A CN110233882B (en) 2019-05-23 2019-05-23 Page resource access control method, device, system, storage medium and equipment

Publications (2)

Publication Number Publication Date
CN110233882A CN110233882A (en) 2019-09-13
CN110233882B true CN110233882B (en) 2022-01-11

Family

ID=67861568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910433743.0A Active CN110233882B (en) 2019-05-23 2019-05-23 Page resource access control method, device, system, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN110233882B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979004B (en) * 2022-06-20 2024-02-27 中国工商银行股份有限公司 Information processing method, device, equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1006463A2 (en) * 1998-12-01 2000-06-07 Lucent Technologies Inc. A method and apparatus for persistent access to web resources
EP1006466A2 (en) * 1998-12-01 2000-06-07 Lucent Technologies Inc. A method and apparatus for persistent access to web resources using relative time-stamps
CN101075236A (en) * 2006-06-12 2007-11-21 腾讯科技(深圳)有限公司 Apparatus and method for accelerating browser webpage display
CN103561040A (en) * 2013-11-15 2014-02-05 中国科学院声学研究所 File downloading method and system
CN103763340A (en) * 2013-12-24 2014-04-30 杭州华三通信技术有限公司 Web access optimizing device and method
CN104202360A (en) * 2014-08-13 2014-12-10 小米科技有限责任公司 Webpage access method, device and router
EP3076313A1 (en) * 2015-03-31 2016-10-05 Comcast Cable Communications, LLC Digital content access control

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1006463A2 (en) * 1998-12-01 2000-06-07 Lucent Technologies Inc. A method and apparatus for persistent access to web resources
EP1006466A2 (en) * 1998-12-01 2000-06-07 Lucent Technologies Inc. A method and apparatus for persistent access to web resources using relative time-stamps
CN101075236A (en) * 2006-06-12 2007-11-21 腾讯科技(深圳)有限公司 Apparatus and method for accelerating browser webpage display
CN103561040A (en) * 2013-11-15 2014-02-05 中国科学院声学研究所 File downloading method and system
CN103763340A (en) * 2013-12-24 2014-04-30 杭州华三通信技术有限公司 Web access optimizing device and method
CN104202360A (en) * 2014-08-13 2014-12-10 小米科技有限责任公司 Webpage access method, device and router
EP3076313A1 (en) * 2015-03-31 2016-10-05 Comcast Cable Communications, LLC Digital content access control

Also Published As

Publication number Publication date
CN110233882A (en) 2019-09-13

Similar Documents

Publication Publication Date Title
CN106933871B (en) Short link processing method and device and short link server
US9332065B2 (en) Methods and apparatus for identifying browser use on a mobile device
JP6404816B2 (en) Method and apparatus for responding to web page access request
KR20130142961A (en) Automatic application updates
CN109992406B (en) Picture request method, picture request response method and client
US11615443B2 (en) System and method to selectively update supplemental content rendered in placement regions of a rendered page
CN106817388B (en) Method and device for acquiring data by virtual machine and host machine and system for accessing data
CN108604194A (en) Probability adjusting
CN110650209B (en) Method and device for realizing load balancing
CN110417910B (en) Notification message sending method, device, server and storage medium
US8972968B1 (en) Alternate service for applications
US10242102B2 (en) Network crawling prioritization
CN113411404A (en) File downloading method, device, server and storage medium
CN111597213A (en) Caching method, software server and storage medium
CN106657182B (en) Cloud file processing method and device
CN110233882B (en) Page resource access control method, device, system, storage medium and equipment
CN107295052B (en) Service processing method and device
CN111079048A (en) Page loading method and device
CN107634854B (en) Service data processing method and device
CN107332703B (en) Method and device for checking multi-application logs
CN107918617B (en) Data query method and device
CN112926002A (en) Service request processing method and device
CN111159596A (en) Application resource access control method and device
US9805177B1 (en) Processing large data sets from heterogeneous data sources using federated computing resources
CN112491939B (en) Multimedia resource scheduling method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant