Resource response method and device, equipment and storage medium
By intercepting target resource request messages, generating and managing redirect addresses, the leakage problem caused by static storage of resource files is solved, and the security of resource files is improved.
Patent Information
- Application Number
- CN202510429458.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-04-08
AI Technical Summary
In the current business application system development, the static storage method of resource files is likely to lead to the leakage of resource files, especially in the network environment. If hackers or illegal personnel obtain the static resource path of resource files, they can directly access the resource files, resulting in content leakage.
By intercepting the response result of the target resource request message, the target resource storage address is determined, and a redirect address is generated, and the valid duration of the redirect address is set. Within the valid duration of the redirect address, the target resource response result of the target resource request message is generated based on the redirect address to avoid directly accessing the static storage address of the resource file.
It effectively avoids resource file leakage, improves the security of resource files, and prevents hackers or illegal personnel from directly accessing resource files through static resource paths.
Smart Images

Figure CN119939638A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a resource response method, device, equipment and storage medium. Background Art
[0002] In the current business application system development, the client will request a large number of resource files from the server, such as pictures, files, audio and video, etc. Most of the resource files on the server are stored statically. The client will directly access the local resource files on the server remotely through the static resource path to improve the resource loading speed.
[0003] However, in the current network environment, if a hacker or illegal person obtains the static resource path of a resource file through the above method, he or she can directly access the resource file, resulting in leakage of the resource file content. Summary of the invention
[0004] The present invention provides a resource response method, device, equipment and storage medium to prevent resource file leakage and improve the security of resource files during resource access.
[0005] According to one aspect of the present invention, a resource response method is provided, the method comprising:
[0006] Respond to the target resource request message, intercept the resource response result of the target resource request message, and determine the target resource storage address;
[0007] Based on the target resource storage address and the target resource file stored in the target resource storage address, generating a redirection address of the target resource file, and determining a valid time length of the redirection address;
[0008] In a case where the redirection address is a valid address, a target resource response result of the target resource request message is generated according to the redirection address.
[0009] According to another aspect of the present invention, a resource response device is provided, the device comprising:
[0010] An interception module is used to respond to a target resource request message, intercept a resource response result of the target resource request message, and determine a target resource storage address;
[0011] A redirection module, used to generate a redirection address of the target resource file based on the target resource storage address and the target resource file stored in the target resource storage address, and determine the effective time of the redirection address;
[0012] The response module is used to generate a target resource response result of the target resource request message according to the redirection address when the redirection address is a valid address.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the resource response method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the resource response method described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program is provided. The computer program includes a computer program product. When the computer program product is executed by a processor, the resource response method according to any embodiment of the present invention is implemented.
[0019] The technical solution of the embodiment of the present invention intercepts the response result of the target resource request message, redirects the resource storage address of the target resource file requested by the target resource request message, sets the effective time of the redirected resource storage address, and generates the target resource corresponding result of the target resource request message according to the resource storage address of the redirected target resource file, thereby avoiding the leakage of resource files caused by directly accessing the resource files according to the static storage address of the resource files on the server side, and improving the security of the resource files.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a resource response method provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flow chart of a resource response method provided according to Embodiment 2 of the present invention;
[0024] Figure 3 is a schematic diagram of the structure of a resource response device provided according to Embodiment 3 of the present invention;
[0025] Figure 4 It is a structural diagram of an electronic device for implementing the resource response method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 A flowchart of a resource response method is provided for the first embodiment of the present invention. This embodiment is applicable to the case where a server responds to a resource request message. The method can be executed by a resource response device. The resource response device can be implemented in the form of hardware and / or software. The resource response device can be configured in various general computing devices, such as server devices. Figure 1 As shown, the method includes:
[0030] S110: Respond to the target resource request message, intercept the resource response result of the target resource request message, and determine the target resource storage address.
[0031] Among them, the target resource request message can be a request message sent by the client to request the target resource file; the target resource storage address can refer to the storage address of the target resource file requested by the client to access on the server side; it should be noted that a target resource request message can request access to multiple target resource files, that is, the target resource storage address can include the storage address of at least one target resource file.
[0032] Specifically, after receiving the target resource request message sent by the client, the server can respond to it. After the server responds to the target resource request message and obtains a response result, it will not return the response result directly to the client, but will first intercept the response result to determine whether the target resource storage address exists in the response result.
[0033] Optionally, in an embodiment of the present invention, the resource response result of the target resource request message is intercepted to determine the target resource storage address, including: generating a regular expression for detecting the uniform resource locator according to the composition structure of the uniform resource locator; intercepting the resource response result of the target resource request message according to the regular expression to determine the target resource storage address.
[0034] Specifically, the server can construct a URL (Uniform Resource Locator) interceptor, and before returning the resource response result of the target resource request message to the client, it can first match the character string in the resource response result, intercept the resource response result carrying the URL, and use the URL as the target resource storage address to reconstruct the URL in the resource response result, and then return it to the client. Optionally, the URL interceptor can be a regular expression for detecting the uniform resource locator, which can be determined based on the URL's protocol (such as http, https), domain name, port number, path, query parameters, and fragment identifier information.
[0035] Optionally, in an embodiment of the present invention, the server side may perform resource detection on the intercepted resource response result, that is, based on the URL information in the resource response result, perform resource access to the URL to determine whether the resource directory and resource file corresponding to the URL can be obtained; if it can be obtained, then enable file resource access blocking, that is, encrypt the URL and the resource file corresponding to the URL to ensure the security of the resource file. In an optional implementation, the resource file object can be enhanced by bytecode enhancement. When the new resource file object is created, the resource file object can be automatically encrypted according to the custom encryption method configured in the enhanced file class. It should be noted that the encryption method of the URL and resource file can be adaptively set according to those skilled in the art.
[0036] In an optional implementation of the present invention, a static resource file scanner may be provided to scan and access the static resource files stored on the server at a preset period to determine whether the static resource files can be directly accessed. If they can be directly accessed, the static resource files are encrypted.
[0037] By encrypting the static resource file path (URL) and static resource files, they are prevented from being accessed by the outside world at will, thus improving the security of static resource files.
[0038] S120: Based on the target resource storage address and the target resource file stored in the target resource storage address, generate a redirection address of the target resource file, and determine the validity period of the redirection address.
[0039] S130. When the redirection address is a valid address, generate a target resource response result of the target resource request message according to the redirection address.
[0040] The valid address may refer to a redirection address within a valid time range.
[0041] In an embodiment of the present invention, the redirection address of the target resource file can be determined based on the encrypted target resource storage address, and the address validity period of the redirection address can be determined through the target resource file. During the validity period, the redirection address can be used as the target resource response result of the target resource request message to provide access function to the client. If the redirection address is invalid, the access function can no longer be provided to the outside, and the resource files stored in the redirection address will be cleaned up.
[0042] The technical solution of the embodiment of the present invention intercepts the response result of the target resource request message, redirects the resource storage address of the target resource file requested by the target resource request message, sets the effective time of the redirected resource storage address, and generates the target resource corresponding result of the target resource request message according to the resource storage address of the redirected target resource file, thereby avoiding the leakage of resource files caused by directly accessing the resource files according to the static storage address of the resource files on the server side, and improving the security of the resource files.
[0043] Embodiment 2
[0044] Figure 2 This is a flowchart of a resource response method provided in the second embodiment of the present invention. This embodiment further refines the above embodiment and provides specific steps for generating a redirection address of a target resource file based on the target resource storage address and the target resource file stored in the target resource storage address, and determining the effective duration of the redirection address. It should be noted that for the undetailed parts of the embodiment of the present invention, please refer to the relevant descriptions of other embodiments, which will not be repeated here. Figure 2 As shown, the method includes:
[0045] S210: Respond to the target resource request message, intercept the resource response result of the target resource request message, and determine the target resource storage address.
[0046] S220, encrypting the target resource storage address, and using the encrypted address as the redirection address corresponding to the target resource storage address; and backing up the target resource file stored in the target resource storage address, and storing it in the redirection address.
[0047] S230: Determine the effective duration of the redirection address according to the file size of the target resource file stored in the target resource storage address and a preset file transfer rate.
[0048] In an embodiment of the present invention, after the redirection address is determined, the target resource file stored in the target resource storage address can be backed up and the backed-up target resource file can be stored in the redirection address. If the target resource file is found to be an encrypted file during the target resource file backup process, the backed-up target resource file is decrypted and stored in the redirection address.
[0049] Further, the download time required for the target resource file can be determined according to the file size of the target resource file stored in the redirection address and the preset file transfer rate, and the effective duration of the redirection address can be determined according to the download time and the preset effective redundant time. Optionally, the file transfer rate can be adaptively set according to those skilled in the art.
[0050] Optionally, in an embodiment of the present invention, the address validity period of the redirected address is determined according to the file size of the target resource file stored in the target resource storage address, including: in the case where there are at least two resource addresses of resource files in the target resource storage address, the resource addresses are sorted according to the order of the resource addresses in the target resource storage address to generate an address response sequence; according to the arrangement order of the resource addresses in the address response sequence, the address validity periods of the redirected addresses corresponding to the resource addresses are sequentially generated. It should be noted that the address validity period of the redirected address corresponding to the resource address arranged later in the address response sequence is determined based on the address validity period of the redirected address corresponding to the resource address arranged before the resource address.
[0051] Specifically, if the target resource request message sent by the client requests access to at least two resource files, that is, if there are at least two resource addresses of resource files in the target resource storage address, considering the impact of downloading multiple resource files on bandwidth, the stability of the redirect address corresponding to the resource address is ensured by setting a secondary redundancy time for the resource address that is arranged later in the address response sequence. For example, the address response sequence includes path A and path B, path A is arranged before path B, and the address validity period of the redirect address corresponding to path A is 30 seconds, then the final address validity period of the redirect address corresponding to path B needs to be accumulated with the address validity period of the redirect address corresponding to path A, that is, the initial address validity period of the redirect address corresponding to path B is 30 seconds instead of 0 seconds.
[0052] In an optional implementation of an embodiment of the present invention, when there are resource addresses of at least two resource files in the target resource storage address, access monitoring is performed on the redirection address corresponding to the resource address in the address response sequence; if the redirection address corresponding to any resource address in the address response sequence is not accessed within a preset access cycle, the queue of invalid addresses is cleared.
[0053] It should be noted that, when there are at least two resource addresses of resource files in the target resource storage address, if the redirect address corresponding to the resource address becomes invalid, the redirect address is stored in the queue of addresses to be invalidated; wherein the redirect address in the queue of addresses to be invalidated will be re-enabled within a preset recovery period. Optionally, the preset access period and the preset recovery period can be adaptively set according to those skilled in the art.
[0054] The redirected addresses in the to-be-invalidated address queue will be re-enabled within a preset recovery period, and one address response sequence corresponds to one to-be-invalidated address queue.
[0055] In an embodiment of the present invention, the client does not necessarily use all resource files requested to be accessed at the same time. For example, the user accesses the resource files requested to be accessed in an irregular and random manner by sliding pages or flipping pages on the client. In order to ensure that the client can access the redirection address corresponding to the resource address in the address response sequence at any time, the redirection address in the invalid address queue is re-enabled at regular intervals to avoid the client being unable to access the redirection address due to the expiration of the address validity period.
[0056] Optionally, in an embodiment of the present invention, it also includes: if the access monitoring result of the redirection address corresponding to the resource address in the address response sequence is an orderly access with a time regularity, such as periodic access with a preset fixed access period, then the invalid address queue is cleared to avoid illegal access by illegal users.
[0057] S240: When the redirection address is a valid address, generate a target resource response result of the target resource request message according to the redirection address.
[0058] The technical solution of the embodiment of the present invention determines the redirection address corresponding to the target resource storage address according to the encrypted target resource storage address, thereby ensuring the address security of the redirection address, and sets the address validity period of the redirection address according to the size of the target resource file, thereby further improving the security of the resource file. On the one hand, it prevents illegal users from directly accessing the real storage location of the resource file, and at the same time, by setting the address validity period, it improves the interactive security level in the resource response process.
[0059] Embodiment 3
[0060] Figure 3 This is a schematic diagram of the structure of a resource response device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:
[0061] The interception module 310 is used to respond to the target resource request message, intercept the resource response result of the target resource request message, and determine the target resource storage address;
[0062] The redirection module 320 is used to generate a redirection address of the target resource file based on the target resource storage address and the target resource file stored in the target resource storage address, and determine the effective time of the redirection address;
[0063] The response module 330 is used to generate a target resource response result of the target resource request message according to the redirection address when the redirection address is a valid address.
[0064] The technical solution of the embodiment of the present invention intercepts the response result of the target resource request message, redirects the resource storage address of the target resource file requested by the target resource request message, sets the effective time of the redirected resource storage address, and generates the target resource corresponding result of the target resource request message according to the resource storage address of the redirected target resource file, thereby avoiding the leakage of resource files caused by directly accessing the resource files according to the static storage address of the resource files on the server side, and improving the security of the resource files.
[0065] Optionally, the redirection module 320 includes:
[0066] An address determination unit, configured to encrypt the target resource storage address and use the encrypted address as a redirection address corresponding to the target resource storage address; and back up the target resource file stored in the target resource storage address and store it in the redirection address;
[0067] The duration determination unit is used to determine the effective duration of the redirected address according to the file size of the target resource file stored in the target resource storage address and a preset file transfer rate.
[0068] Optionally, the duration determination unit may be specifically used for:
[0069] In the case that there are at least two resource addresses of resource files in the target resource storage address, the resource addresses are sorted according to the order of the resource addresses in the target resource storage address to generate an address response sequence;
[0070] According to the arrangement order of the resource addresses in the address response sequence, the address validity period of the redirection address corresponding to the resource address is generated in sequence; wherein, the address validity period of the redirection address corresponding to the resource address arranged later in the address response sequence is determined based on the address validity period of the redirection address corresponding to the resource address arranged before the resource address.
[0071] Optionally, the device further comprises:
[0072] An address cleaning module is used to clean up the queue of addresses to be invalidated if the redirected address corresponding to any resource address in the address response sequence has not been accessed within a preset access cycle; wherein the redirected addresses in the queue of addresses to be invalidated will be re-enabled within a preset recovery cycle, and one address response sequence corresponds to one queue of addresses to be invalidated.
[0073] Optionally, the address cleaning module also includes:
[0074] The to-be-invalidated queue generating unit is used for storing the redirected address into the to-be-invalidated address queue if the redirected address corresponding to the resource address becomes invalid when there are at least two resource addresses of the resource files in the target resource storage address; wherein the redirected address in the to-be-invalidated address queue will be re-enabled within a preset recovery period.
[0075] Optionally, the interception module 310 may be specifically used for:
[0076] Generate a regular expression for detecting the uniform resource locator according to the composition structure of the uniform resource locator;
[0077] The resource response result of the target resource request message is intercepted according to the regular expression to determine the target resource storage address.
[0078] The resource response device provided in the embodiment of the present invention can execute the resource response method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0079] Embodiment 4
[0080] Figure 4 A schematic diagram of the structure of an electronic device 410 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0081] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0082] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0083] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 executes the various methods and processes described above, such as the resource response method.
[0084] In some embodiments, the resource response method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 410 via ROM 412 and / or communication unit 419. When the computer program is loaded into RAM 413 and executed by processor 411, one or more steps of the resource response method described above may be performed. Alternatively, in other embodiments, processor 411 may be configured to perform the resource response method in any other appropriate manner (e.g., by means of firmware).
[0085] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0086] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0087] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0088] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0089] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0090] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0091] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0092] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A resource response method, characterized in that: include: Respond to the target resource request message, intercept the resource response result of the target resource request message, and determine the target resource storage address; Based on the target resource storage address and the target resource file stored in the target resource storage address, generating a redirection address of the target resource file, and determining a valid time length of the redirection address; In a case where the redirection address is a valid address, a target resource response result of the target resource request message is generated according to the redirection address.
2. The method according to claim 1, characterized in that: Based on the target resource storage address and the target resource file stored in the target resource storage address, generating a redirection address of the target resource file, and determining the effective duration of the redirection address, including: Encrypting the target resource storage address and using the encrypted address as the redirection address corresponding to the target resource storage address; and backing up the target resource file stored in the target resource storage address and storing it in the redirection address; The address validity period of the redirection address is determined according to the file size of the target resource file stored in the target resource storage address and a preset file transmission rate.
3. The method according to claim 2, characterized in that Determining the effective duration of the redirection address according to the file size of the target resource file stored in the target resource storage address includes: In the case that there are at least two resource addresses of resource files in the target resource storage address, the resource addresses are sorted according to the order of the resource addresses in the target resource storage address to generate an address response sequence; According to the arrangement order of the resource addresses in the address response sequence, the address validity period of the redirection address corresponding to the resource address is generated in sequence; wherein, the address validity period of the redirection address corresponding to the resource address arranged later in the address response sequence is determined based on the address validity period of the redirection address corresponding to the resource address arranged before the resource address.
4. The method according to claim 3, characterized in that Also includes: In the case that there are at least two resource addresses of resource files in the target resource storage address, access monitoring is performed on the redirection address corresponding to the resource address in the address response sequence; If the redirection address corresponding to any resource address in the address response sequence is not accessed within a preset access cycle, the queue of addresses to be invalidated is cleared; wherein the redirection addresses in the queue of addresses to be invalidated will be re-enabled within a preset recovery cycle, and one address response sequence corresponds to one queue of addresses to be invalidated.
5. The method according to claim 4, characterized in that Also includes: When there are at least two resource addresses of resource files in the target resource storage address, if the redirect address corresponding to the resource address becomes invalid, the redirect address will be stored in the queue of addresses to be invalidated; wherein the redirect address in the queue of addresses to be invalidated will be re-enabled within a preset recovery period.
6. The method according to claim 1, characterized in that Intercept the resource response result of the target resource request message and determine the target resource storage address, including: Generate a regular expression for detecting the uniform resource locator according to the composition structure of the uniform resource locator; The resource response result of the target resource request message is intercepted according to the regular expression to determine the target resource storage address.
7. A resource response device, characterized in that: include: An interception module is used to respond to a target resource request message, intercept a resource response result of the target resource request message, and determine a target resource storage address; A redirection module, used to generate a redirection address of the target resource file based on the target resource storage address and the target resource file stored in the target resource storage address, and determine the effective time of the redirection address; The response module is used to generate a target resource response result of the target resource request message according to the redirection address when the redirection address is a valid address.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the resource response method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the resource response method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The method comprises a computer program, which implements the resource response method according to any one of claims 1 to 6 when executed by a processor.
Citation Information
Patent Citations
Content distribution network system and method applicable to multi-service fusion
CN101242422A
Anti-hotlinking management and control method for cloud platform, downloading platform and equipment
CN112866272A
Data encryption storage method and decryption method
CN119272295A
Webpage loading method and device, electronic equipment and storage medium
CN119441650A
System and method for file transfer management
US20080163191A1