WO2018153236A1 - 一种基于api请求的动态资源访问加速方法、装置、介质及设备 - Google Patents

一种基于api请求的动态资源访问加速方法、装置、介质及设备 Download PDF

Info

Publication number
WO2018153236A1
WO2018153236A1 PCT/CN2018/075252 CN2018075252W WO2018153236A1 WO 2018153236 A1 WO2018153236 A1 WO 2018153236A1 CN 2018075252 W CN2018075252 W CN 2018075252W WO 2018153236 A1 WO2018153236 A1 WO 2018153236A1
Authority
WO
WIPO (PCT)
Prior art keywords
request
api
target
result
stored
Prior art date
Application number
PCT/CN2018/075252
Other languages
English (en)
French (fr)
Inventor
丛磊
Original Assignee
贵州白山云科技有限公司
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 贵州白山云科技有限公司 filed Critical 贵州白山云科技有限公司
Publication of WO2018153236A1 publication Critical patent/WO2018153236A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/083Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability for increasing network speed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Definitions

  • the embodiments of the present invention are not limited to the field of communications, and particularly relate to a dynamic resource access acceleration method, apparatus, medium, and device based on an API request.
  • a Content Delivery Network adds a layer of cache between the source server and the end user of the content provider, including one or more content nodes distributed in each area to provide content to the end user. Faster and less waiting time for access.
  • the content node includes static resources (such as pictures, JS files, CSS files) and dynamic resources that change corresponding to the user's selection.
  • static resources such as pictures, JS files, CSS files
  • dynamic resources that change corresponding to the user's selection.
  • an end user requests to acquire a resource of a content node (such as a content of a web page) through an application programming interface (API)
  • the content node in the prior art often only caches static resources (for example, pictures, JS) in the webpage.
  • static resources for example, pictures, JS
  • the result of the operation of the file, CSS file without caching the result of the operation on the dynamic resource.
  • the terminal user sends an API request and the target of the request is http://www.baidu.com/a.jpg, it is a picture in the jpg format with the name a, the picture is a static resource, and the content node is stored. This static resource.
  • the end user issues an API request
  • the target of the request is the price of a stock
  • the price of the stock is a dynamic resource
  • the content node does not store the price of the stock in real time, each time the user requests the price of the stock,
  • the server is required to request the price of this stock.
  • an embodiment of the present invention provides a dynamic resource access acceleration method, apparatus, medium, and device based on an API request.
  • Step 1 Receive an application programming interface API request
  • Step 2 Extract the request target of the target website from the API request, and determine that the request result corresponding to the request target is stored and the duration of the request result storage is less than or equal to the preset duration, and the stored request result is extracted.
  • the method further includes: when it is determined that the request result corresponding to the request target is not stored, or determining that the request result corresponding to the request target is stored and the time length of the request result storage is greater than a preset duration, acquiring the location from the target website
  • the request result of the request target is sent to the sender of the API request, and the result of the request is stored.
  • the method further includes: after receiving the API request, determining that the API satisfies the request result caching rule, performing step 2, and determining that the API does not satisfy the request result caching rule, extracting the target website from the API request
  • the request target is obtained by sending the request result of the request target to the target website, and then sending it to the sender of the API request.
  • the request result caching rule includes at least one of the following rules:
  • API is not an API for authentication and login
  • the preset duration is 1 millisecond.
  • the dynamic resource access acceleration device based on the API request in the embodiment of the present invention is applied to a server or a node, and includes:
  • a receiving module configured to receive an application programming interface API request
  • a parsing module configured to extract a request target of the target website from the API request
  • a storage judging module configured to determine whether a request result corresponding to the request target is stored, and whether the duration of the request result storage is less than or equal to a preset duration; wherein the preset duration is a value between 1 and 1000 milliseconds;
  • a processing module configured to: when the determining module determines that the request result corresponding to the request target is stored and the duration of the request result storage is less than or equal to a preset duration, extracting the stored request result;
  • a sending module configured to send a request result extracted by the processing module to a sender of the API request.
  • the processing module is further configured to: when the determining module determines that the request result corresponding to the request target is not stored, or determines that the request result corresponding to the request target is stored, and the time length of the request result storage is greater than a preset duration, Obtaining a request result of the request target from the target website;
  • the sending module is further configured to send a request result obtained by the processing module to a sender of the API request;
  • the storage module is configured to store the result of the request after the sending module sends the request result obtained by the processing module to the sender of the API request.
  • the front-end judging module is configured to: after the receiving module receives the API request, determine whether the API satisfies the request result caching rule; and when determining that the API satisfies the request result caching rule, triggering the storage judging module to perform the determining;
  • the processing module is further configured to: when the front-end judging module determines that the API does not satisfy the request result caching rule, extract a request target of the target website from the API request, and acquire the request target from the target website. Request result.
  • the request result caching rule includes at least one of the following rules: the API is not an API for authentication and login; and the operation type corresponding to the API is acquisition.
  • the preset duration is 1 millisecond.
  • the embodiment of the present invention further provides a computer readable storage medium, where the computer program is stored on the storage medium, and the steps of the foregoing method are implemented when the program is executed by the processor.
  • the embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the steps of the foregoing method when executing the program.
  • the embodiment of the invention can effectively accelerate the dynamic resource access based on the API request, and is particularly suitable for the popular recommendation application and the hot news breaking news event of the website, which can effectively improve the response speed of the user API request and improve the user experience.
  • users can avoid expiring data and respond to bursty traffic, and can improve the service capability of the backend without expanding the back-end resources.
  • Embodiment 1 is a flowchart of a dynamic resource access acceleration method based on an API request in Embodiment 1;
  • Embodiment 2 is a flowchart of a dynamic resource access acceleration method based on an API request in Embodiment 2;
  • Embodiment 3 is a structural diagram of a dynamic resource access acceleration apparatus based on an API request in Embodiment 3;
  • FIG. 4 is a structural diagram of a dynamic resource access acceleration apparatus based on an API request in Embodiment 4.
  • Embodiment 1 is a flowchart of a dynamic resource access acceleration method based on an API request in Embodiment 1; the method includes:
  • Step 101 Receive an API request.
  • Step 102 Extract a request target of the target website from the API request.
  • Step 103 When it is determined that the request result corresponding to the request target is stored and the duration of the request result storage is less than or equal to the preset duration, the stored request result is extracted and sent to the sender of the API request; wherein the preset duration is 1 A value between 1000 milliseconds.
  • the method further includes a step 104 performed in parallel with step 103: determining that the request result corresponding to the request target is not stored, or determining that the request result corresponding to the request target has been stored and the time length of the request result storage is greater than a preset duration, to the target
  • the website obtains the result of the request for this request target and sends it to the sender of the API request, and stores the result of the request.
  • the main body of execution of this method is a server or a node.
  • the server can be a web server, a CDN content node server, or a server in a cloud computing service platform.
  • Embodiment 2 is a flowchart of a dynamic resource access acceleration method based on an API request in Embodiment 2; Embodiment 2 adds a front end determination step compared to Embodiment 1.
  • step 101 After the server receives the API request in step 101, it further includes a determining step 101', the step 101' comprising: determining whether the API satisfies the request result caching rule.
  • the process proceeds to step 102, and when it is determined that the API does not satisfy the request result caching rule, step 105 is performed.
  • the step 105 includes: extracting the request target of the target website from the API request, to the target website. The result of the request of the above request target is obtained and sent to the sender of the API request.
  • the request result caching rule includes at least one of the following rules:
  • API is not an API for authentication and login
  • This method increases the cache speed to milliseconds, and the preset duration is typically 1 millisecond.
  • the cache hit ratio is greatly improved without affecting the business logic.
  • FIG. 3 is a structural diagram of a dynamic resource access acceleration apparatus based on an API request in Embodiment 3, where the apparatus is applied to a server or a node, and the server may be a website server, a CDN content node server, or a server in a cloud computing service platform.
  • the device includes:
  • a receiving module configured to receive an API request
  • a parsing module configured to extract a request target of the target website from the API request
  • a storage judging module configured to determine whether a request result corresponding to the request target is stored, and whether the duration of the request result storage is less than or equal to a preset duration; wherein the preset duration is a value between 1 and 1000 milliseconds;
  • a processing module configured to: when the determining module determines that the request result corresponding to the request target is stored and the duration of the request result storage is less than or equal to a preset duration, extracting the stored request result;
  • the sending module is configured to send the result of the request extracted by the processing module to the sender of the API request.
  • the device also includes a storage module.
  • the processing module is further configured to: when the determining module determines that the request result corresponding to the request target is not stored, or determines that the request result corresponding to the request target is stored and the time length of the request result storage is greater than a preset duration, acquiring the request target from the target website Request result
  • the sending module is further configured to send the request result obtained by the processing module to the sender of the API request;
  • the storage module is configured to store the result of the request after the sending module sends the result of the request obtained by the processing module to the sender of the API request.
  • the request result caching rule includes at least one of the following rules:
  • API is not an API for authentication and login
  • the preset duration is 1 millisecond.
  • Embodiment 4 is a structural diagram of a dynamic resource access acceleration apparatus based on an API request in Embodiment 4. This fourth embodiment further includes a front end determination module compared to the third embodiment.
  • the front-end judging module is configured to: after the receiving module receives the API request, determine whether the API satisfies the request result caching rule; and when determining that the API satisfies the request result caching rule, triggering the storage judging module to perform the determining;
  • the processing module is further configured to: when the front-end judging module determines that the API does not satisfy the request result caching rule, extract the request target of the target website from the API request, and obtain the request result of the request target from the target website.
  • the invention can effectively accelerate the dynamic resource access based on the API request, and is particularly suitable for the popular recommendation application of the website and the hot news breaking event, which can effectively improve the response speed of the user API request and improve the user experience.
  • users can avoid expiring data and respond to bursty traffic, and can improve the service capability of the backend without expanding the back-end resources.
  • the server provides popular product recommendations for registered users of a website.
  • the hot content is queried to the backend server, and the queried hot product content is returned to the user.
  • the hot content of the website is cached in real time, and the preset duration is set to 1 millisecond, and the hot commodity content is updated after 1 millisecond.
  • the hot item After receiving an API request for querying a hot item sent by a user, the hot item requests the target, determines whether the hot item content has been stored, directly queries the hot item content in the cache, and returns the queried hot item content to the above user.
  • the specific embodiment can enable different users to share the same cached content, can effectively improve the response speed to the API request, and save the query flow to the backend server.
  • computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer.
  • communication media typically includes computer readable instructions, data structures, program modules or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
  • This article can effectively accelerate the dynamic resource access based on API requests, especially for popular recommendation applications and hot news events of websites, which can effectively improve the response speed of user API requests and improve user experience.
  • users can avoid expiring data and respond to bursty traffic, and can improve the service capability of the backend without expanding the back-end resources.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本文公开一种基于API请求的动态资源访问加速方法、装置、介质及设备,此方法包括:接收应用程序编程接口API请求;从API请求中提取出对目标网站的请求目标,判断此请求目标对应的请求结果已存储并且此请求结果存储的时长小于或等于预设时长时,提取此已存储的请求结果,发送至API请求的发送方;预设时长为1至1000毫秒之间的值。本发明可以对基于API请求的动态资源访问进行有效的加速处理,尤其适用于网站的热门推荐应用和热点突发新闻事件,可以有效提高对用户API请求的响应速度,提高用户体验。同时,通过精准缓存控制,避免用户看到过期数据,应对突发流量,可以在不扩展后端资源情况下,提高后端的服务能力。

Description

一种基于API请求的动态资源访问加速方法、装置、介质及设备
本申请要求在2017年2月21日提交中国专利局、申请号为201710093379.9,发明名称为“一种基于API请求的动态资源加速方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例但不限于涉及通信领域,尤其涉及一种基于API请求的动态资源访问加速方法、装置、介质及设备。
背景技术
内容分发网络(Content Delivery Network,简称CDN)在内容提供商的源服务器和终端用户之间添加一层缓存,包含了分布在各个区域上的一个或多个内容节点,以便为终端用户提供对内容的更快和更少等待时间的访问。
内容节点上包括静态资源(例如图片、JS文件、CSS文件)和随用户的选择而相应变化的动态资源。当终端用户通过应用程序编程接口(Application Programming Interface,简称API)请求获取内容节点的资源(诸如网页的内容)时,现有技术中内容节点往往只缓存针对网页内的静态资源(例如图片、JS文件、CSS文件)的操作结果,而不缓存对动态资源的操作结果。例如:终端用户发出API请求,请求的目标是http://www.baidu.com/a.jpg时,即为请求名称为a的jpg格式的图片,此图片是一个静态资源,内容节点会存储此静态资源。再例如:终端用户发出API请求,请求的目标是某一股票的价格,而此股票的价格是动态资源,内容节点不会实时存储股票的价格,每次收到用户请求此股票的价格时,需向服务器请求获取此股票的价格。
现在技术中的上述方式,对于网站的一些突发信息,瞬间海量用户同时访问,发送接口请求,也会使页面打开速度变慢,甚至导致网站服务器宕机,使整个网站瘫痪,致使业务受到损失,用户容易流失。因此,亟需一种针对API请求的动态资源访问进行有效加速的方法。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
为了解决上述技术问题,本发明实施例提供了一种基于API请求的动态资源访问加速方法、装置、介质及设备。
本发明实施例提供的基于API请求的动态资源访问加速方法,包括:
步骤1,接收应用程序编程接口API请求;
步骤2,从所述API请求中提取出对目标网站的请求目标,判断此请求目标对应的请求结果已存储并且此请求结果存储的时长小于或等于预设时长时,提取此已存储的请求结果,发送至所述API请求的发送方;其中所述预设时长为1至1000毫秒之间的值。
上述加速方法还具有以下特点:
所述方法还包括:判断所述请求目标对应的请求结果未存储时,或者,判断此请求目标对应的请求结果已存储并且请求结果存储的时长大于预设时长时,向所述目标网站获取所述请求目标的请求结果后发送至所述API请求的发送方,并存储此请求结果。
上述加速方法还具有以下特点:
所述方法还包括:接收所述API请求后,判断此API满足请求结果缓存规则时,执行所述步骤2,判断此API不满足请求结果缓存规则时,从所述API请求中提取出目标网站的请求目标,向所述目标网站获取所述请求目标的请求结果后发送至所述API请求的发送方。
上述加速方法还具有以下特点:
所述请求结果缓存规则包括以下规则中的至少一种:
API不是用于认证和登录的API;
API对应的操作类型是获取。
上述加速方法还具有以下特点:
所述预设时长为1毫秒。
本发明实施例的基于API请求的动态资源访问加速装置,应用于服务器或 节点,包括:
接收模块,用于接收应用程序编程接口API请求;
解析模块,用于从所述API请求中提取出目标网站的请求目标;
存储判断模块,用于判断此请求目标对应的请求结果是否已存储并且此请求结果存储的时长是否小于或等于预设时长;其中所述预设时长为1至1000毫秒之间的值;
处理模块,用于在判断模块判断此请求目标对应的请求结果已存储并且此请求结果存储的时长小于或等于预设时长时,提取此已存储的请求结果;
发送模块,用于将所述处理模块提取的请求结果发送至所述API请求的发送方。
上述加速装置还具有以下特点:
还包括存储模块;
所述处理模块,还用于在所述判断模块判断所述请求目标对应的请求结果未存储时,或者,判断此请求目标对应的请求结果已存储并且请求结果存储的时长大于预设时长时,向所述目标网站获取所述请求目标的请求结果;
所述发送模块,还用于将所述处理模块获取的请求结果发送至所述API请求的发送方;
所述存储模块,用于在所述发送模块将所述处理模块获取的请求结果发送至所述API请求的发送方后,存储此请求结果。
上述加速装置还具有以下特点:
还包括前端判断模块,
所述前端判断模块,用于在所述接收模块接收API请求后,判断此API是否满足请求结果缓存规则;并且在判断此API满足请求结果缓存规则时,触发所述存储判断模块执行判断;
所述处理模块,还用于在所述前端判断模块判断此API不满足请求结果缓存规则时,从所述API请求中提取出目标网站的请求目标,向所述目标网站获取所述请求目标的请求结果。
上述加速装置还具有以下特点:
所述请求结果缓存规则包括以下规则中的至少一种:API不是用于认证和登 录的API;API对应的操作类型是获取。
上述加速装置还具有以下特点:
所述预设时长为1毫秒。
本发明实施例还提供了计算机可读存储介质,存储介质上存储有计算机程序,程序被处理器执行时实现上述方法的步骤。
本发明实施例还提供了计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行上述程序时实现上述方法的步骤。
本发明实施例可以对基于API请求的动态资源访问进行有效的加速处理,尤其适用于网站的热门推荐应用和热点突发新闻事件,可以有效提高对用户API请求的响应速度,提高用户体验。同时,通过精准缓存控制,避免用户看到过期数据,应对突发流量,可以在不扩展后端资源情况下,提高后端的服务能力。
附图说明
此处所说明的附图用来提供对本发明实施例的进一步理解,构成本申请的一部分,本发明实施例的示意性实施例及其说明用于解释本发明实施例,并不构成对本发明实施例的不当限定。在附图中:
图1是实施例一中基于API请求的动态资源访问加速方法的流程图;
图2是实施例二中基于API请求的动态资源访问加速方法的流程图;
图3是实施例三中基于API请求的动态资源访问加速装置的结构图;
图4是实施例四中基于API请求的动态资源访问加速装置的结构图。
具体实施方式
现结合附图和具体实施方式对本发明实施例进一步说明。
实施例一
图1是实施例一中基于API请求的动态资源访问加速方法的流程图;此方法包括:
步骤101,接收API请求;
步骤102,从API请求中提取出目标网站的请求目标;
步骤103,判断此请求目标对应的请求结果已存储并且此请求结果存储的时长小于或等于预设时长时,提取此已存储的请求结果,发送至API请求的发送方;其中预设时长为1至1000毫秒之间的值。
此方法还包括与步骤103并列执行的步骤104:判断请求目标对应的请求结果未存储时,或者,判断此请求目标对应的请求结果已存储并且请求结果存储的时长大于预设时长时,向目标网站获取此请求目标的请求结果后发送至API请求的发送方,并存储此请求结果。
本方法的执行主体是服务器或节点。服务器可以是网站服务器,CDN内容节点服务器,或是云计算服务平台中的服务器。
实施例二
图2是实施例二中基于API请求的动态资源访问加速方法的流程图;实施例二相比实施例一,增加了前端判断步骤。
在步骤101中服务器接收API请求后,还包括判断步骤101’,此步骤101’包括:判断此API是否满足请求结果缓存规则。在此API满足请求结果缓存规则时,转到步骤102,判断此API不满足请求结果缓存规则时,执行步骤105,此步骤105包括:从API请求中提取出目标网站的请求目标,向目标网站获取上述请求目标的请求结果后发送至API请求的发送方。
请求结果缓存规则包括以下规则中的至少一种:
API不是用于认证和登录的API;
API对应的操作类型是获取。
本方法使缓存速度提高为毫秒级,预设时长典型的为1毫秒。另外,通过请求结果缓存规则,能够准确判断是否可以为某个API添加缓存,在不影响业务逻辑的前提下,大大提高缓存命中率。
实施例三
图3是实施例三中基于API请求的动态资源访问加速装置的结构图,此装置应用于服务器或节点,服务器可以是网站服务器,CDN内容节点服务器,或是云计算服务平台中的服务器,此装置包括:
接收模块,用于接收API请求;
解析模块,用于从API请求中提取出目标网站的请求目标;
存储判断模块,用于判断此请求目标对应的请求结果是否已存储并且此请求结果存储的时长是否小于或等于预设时长;其中预设时长为1至1000毫秒之间的值;
处理模块,用于在判断模块判断此请求目标对应的请求结果已存储并且此请求结果存储的时长小于或等于预设时长时,提取此已存储的请求结果;
发送模块,用于将处理模块提取的请求结果发送至API请求的发送方。
其中,
此装置还包括存储模块。
处理模块还用于在判断模块判断上述请求目标对应的请求结果未存储时,或者,判断上述请求目标对应的请求结果已存储并且请求结果存储的时长大于预设时长时,向目标网站获取请求目标的请求结果;
发送模块还用于将处理模块获取的请求结果发送至API请求的发送方;
存储模块用于在发送模块将处理模块获取的请求结果发送至API请求的发送方后,存储此请求结果。
请求结果缓存规则包括以下规则中的至少一种:
API不是用于认证和登录的API;
API对应的操作类型是获取。
预设时长为1毫秒。
实施例四
图4是实施例四中基于API请求的动态资源访问加速装置的结构图,此实施例四相比实施例三还包括前端判断模块。
前端判断模块用于在接收模块接收API请求后,判断此API是否满足请求结果缓存规则;并且在判断此API满足请求结果缓存规则时,触发存储判断模块执行判断;
处理模块还用于在前端判断模块判断此API不满足请求结果缓存规则时,从API请求中提取出目标网站的请求目标,向目标网站获取上述请求目标的请求结果。
本发明可以对基于API请求的动态资源访问进行有效的加速处理,尤其适 用于网站的热门推荐应用、热点突发新闻事件,可以有效提高对用户API请求的响应速度,提高用户体验。同时,通过精准缓存控制,避免用户看到过期数据,应对突发流量,可以在不扩展后端资源情况下,提高后端的服务能力。
具体实施例
服务器为某网站的注册用户提供热门商品推荐。现有技术中在进行处理时收到某用户发送的查询热门商品的API请求后,向后端服务器查询此热门商品内容,将查询到的热门商品内容返回给上述用户。
本具体实施例中,实时缓存此网站的热门商品内容,设置预设时长为1毫秒,在1毫秒后更新热门商品内容。收到某用户发送的查询热门商品的API请求后,热门商品即请求目标,判断热门商品内容是否已存储,在缓存中直接查询热门商品内容,将查询到的热门商品内容返回至上述用户。相比现有技术的方式,本具体实施例可以使不同的用户共用相同的缓存内容,可以有效提高对API请求的响应速度,并且节省向后端服务器的查询流程。
本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明技术方案的精神和范围,均应涵盖在权利要求范围当中。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、 程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
工业实用性
本文可以对基于API请求的动态资源访问进行有效的加速处理,尤其适用于网站的热门推荐应用和热点突发新闻事件,可以有效提高对用户API请求的响应速度,提高用户体验。同时,通过精准缓存控制,避免用户看到过期数据,应对突发流量,可以在不扩展后端资源情况下,提高后端的服务能力。

Claims (12)

  1. 一种基于API请求的动态资源访问加速方法,包括:
    步骤1,接收应用程序编程接口API请求;
    步骤2,从所述API请求中提取出对目标网站的请求目标,判断此请求目标对应的请求结果已存储并且此请求结果存储的时长小于或等于预设时长时,提取此已存储的请求结果,发送至所述API请求的发送方;其中所述预设时长为1至1000毫秒之间的值。
  2. 如权利要求1所述的加速方法,其中,
    所述方法还包括:判断所述请求目标对应的请求结果未存储时,或者,判断此请求目标对应的请求结果已存储并且请求结果存储的时长大于所述预设时长时,向所述目标网站获取所述请求目标的请求结果后发送至所述API请求的发送方,并存储此请求结果。
  3. 如权利要求1所述的加速方法,其中,
    所述方法还包括:接收所述API请求后,判断此API满足请求结果缓存规则时,执行所述步骤2,判断此API不满足请求结果缓存规则时,从所述API请求中提取出目标网站的请求目标,向所述目标网站获取所述请求目标的请求结果后发送至所述API请求的发送方。
  4. 如权利要求1所述的加速方法,其中,
    所述请求结果缓存规则包括以下规则中的至少一种:
    API不是用于认证和登录的API;
    API对应的操作类型是获取。
  5. 如权利要求1所述的加速方法,其中,所述预设时长为1毫秒。
  6. 一种基于API请求的动态资源访问加速装置,应用于服务器或节点,包括:
    接收模块,用于接收应用程序编程接口API请求;
    解析模块,用于从所述API请求中提取出目标网站的请求目标;
    存储判断模块,用于判断此请求目标对应的请求结果是否已存储并且此请 求结果存储的时长是否小于或等于预设时长;其中所述预设时长为1至1000毫秒之间的值;
    处理模块,用于在判断模块判断此请求目标对应的请求结果已存储并且此请求结果存储的时长小于或等于预设时长时,提取此已存储的请求结果;
    发送模块,用于将所述处理模块提取的请求结果发送至所述API请求的发送方。
  7. 如权利要求6所述的加速装置,其中,还包括存储模块;
    所述处理模块,还用于在所述判断模块判断所述请求目标对应的请求结果未存储时,或者,判断此请求目标对应的请求结果已存储并且请求结果存储的时长大于预设时长时,向所述目标网站获取所述请求目标的请求结果;
    所述发送模块,还用于将所述处理模块获取的请求结果发送至所述API请求的发送方;
    所述存储模块,用于在所述发送模块将所述处理模块获取的请求结果发送至所述API请求的发送方后,存储此请求结果。
  8. 如权利要求6所述的加速装置,其中,还包括前端判断模块,
    所述前端判断模块,用于在所述接收模块接收API请求后,判断此API是否满足请求结果缓存规则;并且在判断此API满足请求结果缓存规则时,触发所述存储判断模块执行判断;
    所述处理模块,还用于在所述前端判断模块判断此API不满足请求结果缓存规则时,从所述API请求中提取出目标网站的请求目标,向所述目标网站获取所述请求目标的请求结果。
  9. 如权利要求6所述的加速装置,其中,
    所述请求结果缓存规则包括以下规则中的至少一种:API不是用于认证和登录的API;API对应的操作类型是获取。
  10. 如权利要求6所述的加速装置,其中,
    所述预设时长为1毫秒。
  11. 一种计算机可读存储介质,所述存储介质上存储有计算机程序,所述程序被处理器执行时实现权利要求1至5中任意一项所述方法的步骤。
  12. 一种计算机设备,其特征在于,包括存储器、处理器及存储在所述存储 器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1至5中任意一项所述方法的步骤。
PCT/CN2018/075252 2017-02-21 2018-02-05 一种基于api请求的动态资源访问加速方法、装置、介质及设备 WO2018153236A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710093379.9A CN107707373B (zh) 2017-02-21 2017-02-21 一种基于api请求的动态资源访问加速方法
CN201710093379.9 2017-02-21

Publications (1)

Publication Number Publication Date
WO2018153236A1 true WO2018153236A1 (zh) 2018-08-30

Family

ID=61169438

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/075252 WO2018153236A1 (zh) 2017-02-21 2018-02-05 一种基于api请求的动态资源访问加速方法、装置、介质及设备

Country Status (2)

Country Link
CN (1) CN107707373B (zh)
WO (1) WO2018153236A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367683A (zh) * 2018-12-25 2020-07-03 华为技术有限公司 一种结果获取方法、装置及设备
CN111580997A (zh) * 2020-05-20 2020-08-25 长沙米拓信息技术有限公司 一种应用与网站的内容同步方法、系统、设备及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108696579A (zh) * 2018-04-28 2018-10-23 北京奇艺世纪科技有限公司 一种请求响应方法、装置及电子设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571997A (zh) * 2010-12-29 2012-07-11 中国移动通信集团北京有限公司 一种数据访问的方法、系统及设备
CN103810189A (zh) * 2012-11-08 2014-05-21 腾讯科技(深圳)有限公司 一种热点消息处理方法及系统
CN105429794A (zh) * 2015-11-09 2016-03-23 成都广达新网科技股份有限公司 一种提高网管工作站访问网元设备效率的方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102904959B (zh) * 2012-10-19 2016-01-20 北京极科极客科技有限公司 网络加速方法和网关
CN103516785A (zh) * 2013-08-19 2014-01-15 上海艾泰网络信息有限公司 网页代理系统及其通信方法
CN104836821B (zh) * 2014-02-10 2019-03-19 腾讯科技(深圳)有限公司 一种基于路由器设备的网络加速方法、装置和设备
CN104935636A (zh) * 2015-04-29 2015-09-23 广州杰赛科技股份有限公司 网络通道加速方法和系统
CN104994079B (zh) * 2015-06-10 2018-09-07 网宿科技股份有限公司 访问请求的处理方法和装置、加速服务器

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571997A (zh) * 2010-12-29 2012-07-11 中国移动通信集团北京有限公司 一种数据访问的方法、系统及设备
CN103810189A (zh) * 2012-11-08 2014-05-21 腾讯科技(深圳)有限公司 一种热点消息处理方法及系统
CN105429794A (zh) * 2015-11-09 2016-03-23 成都广达新网科技股份有限公司 一种提高网管工作站访问网元设备效率的方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367683A (zh) * 2018-12-25 2020-07-03 华为技术有限公司 一种结果获取方法、装置及设备
CN111580997A (zh) * 2020-05-20 2020-08-25 长沙米拓信息技术有限公司 一种应用与网站的内容同步方法、系统、设备及存储介质

Also Published As

Publication number Publication date
CN107707373A (zh) 2018-02-16
CN107707373B (zh) 2018-08-17

Similar Documents

Publication Publication Date Title
US9148332B2 (en) Content delivery network
US10515132B2 (en) Optimizing transmission of digital components
RU2632410C2 (ru) Управляемое приложением предварительное кэширование в cdn
CN106534243B (zh) 基于http协议的缓存、请求、响应方法及相应装置
WO2018153256A1 (zh) 一种动态资源访问加速方法、装置、介质及设备
JP7422823B2 (ja) 動的アプリケーションコンテンツ分析
US11463753B2 (en) Method and apparatus for downloading resources
US8972513B2 (en) Content caching
WO2018153236A1 (zh) 一种基于api请求的动态资源访问加速方法、装置、介质及设备
EP3905091B1 (en) Enhanced online privacy
WO2019006775A1 (zh) 一种数据传输方法及其系统
CN112513830A (zh) 内容分发网络中的回源方法及相关装置
CN110677684B (zh) 视频处理、视频访问方法及分布式存储、视频访问系统
EP3528474A1 (en) Webpage advertisement anti-shielding method, content distribution network and client
US20200151227A1 (en) Computing system with dynamic web page feature
US20160028641A1 (en) Advanced notification of workload
CN107918617B (zh) 数据查询方法和装置
CN110943876B (zh) Url状态检测方法、装置、设备和系统
WO2019196225A1 (zh) 一种反馈资源文件的方法和装置
CN110855786B (zh) 针对网络数据请求的处理方法、设备及计算机存储介质
US20170155711A1 (en) Processing Requests
CN109660589B (zh) 请求处理方法及装置、电子设备
US11290370B2 (en) Apparatus and method for transmitting content
CN113760965B (zh) 数据查询的方法和装置
CN114793234B (zh) 消息处理方法、装置、设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18758246

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18758246

Country of ref document: EP

Kind code of ref document: A1