WO2018177286A1 - Static resource request processing method and device - Google Patents

Static resource request processing method and device Download PDF

Info

Publication number
WO2018177286A1
WO2018177286A1 PCT/CN2018/080671 CN2018080671W WO2018177286A1 WO 2018177286 A1 WO2018177286 A1 WO 2018177286A1 CN 2018080671 W CN2018080671 W CN 2018080671W WO 2018177286 A1 WO2018177286 A1 WO 2018177286A1
Authority
WO
WIPO (PCT)
Prior art keywords
static resource
requests
resource request
total
type
Prior art date
Application number
PCT/CN2018/080671
Other languages
French (fr)
Chinese (zh)
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 WO2018177286A1 publication Critical patent/WO2018177286A1/en

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/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a static resource request processing method and apparatus.
  • each web page operator needs to change the status of the web page frequently according to the holiday, news or user feedback requirements, etc., which needs to be implemented through a static resource request, and the static resource request of the web page is mainly used to change the display of the web page and The function of the web page.
  • the transmission of each static resource request requires a HyperText Transfer Protocol (HTTP) request from the server and the client.
  • HTTP HyperText Transfer Protocol
  • the present invention provides a static resource request processing method and apparatus, which are used to solve the technical problem of slow processing speed caused by too many HTTP request connections in the prior art.
  • the present invention provides a method for processing a static resource request, including:
  • N static resource requests where N is an integer greater than one
  • the N static resource requests are classified into M type static resource requests, and M is a positive integer smaller than N;
  • Each type of static resource request in the type M static resource request is separately combined and merged into M total static resource requests;
  • the classifying the N static resource requests includes: determining a function of the N static resource requests, classifying the N static resource requests based on the function; or determining the The N static resource request generation time, the N static resource requests are classified according to the generation time; or the acquisition source of the N static resource requests is determined, and the N statics are determined based on the acquisition source Resource requests are categorized.
  • the merging each type of static resource request in the type M static resource request separately includes: combining all static resource requests in each type of static resource request into one total static resource request. Separating each static resource request in each type of static resource request by a preset symbol.
  • the merging each type of the static resource request in the M type static resource request separately includes: using the NGINX server and the LUA language, each type of static resource in the M type static resource request Request to merge separately.
  • a method for processing a static resource request including:
  • the total static resource request after deleting the domain name information is divided, and multiple sub-requests are obtained;
  • the plurality of sub-requests are respectively executed.
  • the step of dividing the total static resource request after deleting the domain name information by using the preset division rule includes: dividing the total static resource request after deleting the domain name information by using a preset symbol as a separator.
  • the method further includes: combining execution results of executing the multiple sub-requests into the cache.
  • the method further includes: performing MD5 verification on the merged execution result to obtain a K value; when receiving the K value and obtaining When the new static resource request with the same K value is requested, the execution result is written into the cache as the execution result of the new static resource request.
  • a processing device for requesting a static resource includes:
  • a first acquiring module configured to acquire N static resource requests, where N is an integer greater than one
  • a classification module configured to classify the N static resource requests into M type static resource requests, where M is a positive integer smaller than N;
  • a merging module configured to merge each type of static resource request in the type M static resource request into a total of two static resource requests
  • a sending module configured to send the M total static resource requests to the client.
  • a processing device for requesting a static resource including
  • a second obtaining module configured to obtain a total static resource request
  • a deleting module configured to delete domain name information in the total static resource request
  • the dividing module is configured to divide the total static resource request after deleting the domain name information by using a preset dividing rule, and obtain multiple sub-requests;
  • An execution module is configured to separately execute the plurality of sub-requests.
  • the method and device provided by the embodiments of the present application combine the same type of static resource requests in multiple static resource requests, and then send the combined total static resource requests to the client to reduce the number of static resource requests, thereby reducing the need.
  • FIG. 1 is a flowchart of a method for processing a static resource request according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a method for processing a static resource request according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic structural diagram of a device for processing a static resource request according to Embodiment 3 of the present invention.
  • FIG. 4 is a schematic structural diagram of a device for processing a static resource request according to Embodiment 4 of the present invention.
  • the embodiment of the present application provides a static resource request processing method and device, which is used to solve the technical problem that the processing speed is slow due to the excessive number of HTTP request connections in the prior art.
  • the technical effect of improving the processing speed of static resource request is realized.
  • N static resource requests where N is an integer greater than 1; classifying the N static resource requests into M type static resource requests, where M is a positive integer less than N; Each type of static resource request is separately merged and merged into M total static resource requests; the M total static resource requests are sent to the client.
  • the foregoing method combines the same type of static resource requests in multiple static resource requests, and then sends the combined total static resource requests to the client to reduce the number of static resource requests, thereby reducing the number of HTTP request connections that need to be established. This speeds up the processing of static resource requests.
  • This embodiment provides a method for processing a static resource request. As shown in FIG. 1 , the method includes:
  • Step S101 Acquire N static resource requests, where N is an integer greater than 1.
  • Step S102 classifying the N static resource requests into M type static resource requests, where M is a positive integer smaller than N;
  • Step S103 Combine each type of static resource request in the M type static resource request, and merge them into M total static resource requests.
  • Step S104 Send the M total static resource requests to the client.
  • the method may be applied to a server.
  • step S101 is executed to acquire N static resource requests, where N is an integer greater than 1.
  • N static resource requests may be requests for writing by the webpage maintenance personnel, or may be requests received by other electronic devices, and are not limited herein.
  • step S102 is performed to classify the N static resource requests into M class static resource requests, where M is a positive integer smaller than N.
  • the classifying the N static resource requests includes:
  • the request may divide the N static resource requests into three categories according to functions.
  • the static resource requests corresponding to the same webpage domain name may be classified into one class according to the N static resource request.
  • step S103 each type of static resource request in the M type static resource request is separately combined and merged into M total static resource requests.
  • the first type is divided by a preset separator.
  • the merging each type of static resource request in the M type static resource request separately includes:
  • All static resource requests in each type of static resource request are combined into one total static resource request, and each static resource request in each type of static resource request is separated by a preset symbol.
  • the preset symbol may be a semicolon, a comma, a dash, a slash, or a space, and is not listed here, nor is it limited.
  • the requests that need to be merged are a1, a2, a3, and a4, and the semicolon is used as a separator to merge them into a1; a2; a3; a4.
  • the requests to be merged are a1, a2, a3, and a4, they are merged into a1AND a2AND a3AND a4 using the preset statement "AND".
  • the merging of the static resource request is mainly implemented by the NGINX server and the LUA scripting language.
  • step S104 is executed to send the M total static resource requests to the client.
  • the M total static resource requests are sent to the client, and only M HTTP request connections need to be established, thereby reducing the number of HTTP request connections. , improve the processing speed of static resource requests.
  • the present application further provides a method corresponding to the processing method of the static resource request in the first embodiment.
  • a method corresponding to the processing method of the static resource request in the first embodiment For details, refer to the second embodiment.
  • This embodiment provides a method for processing a static resource request. As shown in FIG. 2, the method includes:
  • Step S201 Acquire a total static resource request.
  • Step S202 deleting domain name information in the total static resource request
  • Step S203 according to the preset division rule, dividing the total static resource request after deleting the domain name information, and obtaining a plurality of sub-requests;
  • Step S204 respectively executing the plurality of sub-requests.
  • the method provided in this embodiment corresponds to the method provided in the first embodiment.
  • the method of the first embodiment is mainly for the merging of the static resource request, and the method provided by the embodiment is to solve the problem of how to divide and execute the original static resource request from the merged static resource request.
  • the method of this embodiment can be applied to a client.
  • step S201 is performed to obtain a total static resource request.
  • the server may send the combined total static resource request in Embodiment 1 to the client by using an HTTP request connection established with the client.
  • step S202 is performed to delete the domain name information in the total static resource request.
  • the static resource request has domain name information of the webpage that needs to be changed to determine which webpage needs to be changed, and the domain name information may be deleted before each sub-request is divided. .
  • step S203 is executed to divide the total static resource request after deleting the domain name information according to the preset division rule, and obtain a plurality of sub-requests.
  • the method for dividing the total static resource request in this embodiment should be corresponding to the merging method of the total static resource request in the first embodiment, so as to achieve accurate division.
  • the method for dividing the total static resource request after deleting the domain name information is: dividing the total static resource request after deleting the domain name information by using the preset symbol as a separator.
  • the preset symbol may be a semicolon, a comma, a dash, a slash, or a space, and is not listed here, nor is it limited.
  • step S204 is performed to execute the plurality of sub-requests respectively.
  • the method further includes:
  • the execution result of executing the plurality of sub-requests is merged into the cache.
  • the method further includes:
  • the execution result of each execution is merged into the cache, and when the same total static resource request is received subsequently, the execution result stored in the cache can be directly extracted and used, which can be extremely Reduce the amount of calculation and increase the calculation speed.
  • the MD5 check may be performed on each execution result to obtain the K corresponding to the total static resource request. value.
  • the K value can be written to help the client determine whether the received total static resource request has been received. If the subsequent request for the same K value is received, the execution result is directly written into the cache to reduce the amount of system calculation.
  • the client returns the K value to the server to make the server maintenance personnel know, and then write the same total static resource request B next time.
  • the client obtains the total static resource request B
  • the client obtains the total static resource request B, by extracting the K value, it can be determined that the total static resource request B and the total static resource request A are the same request, that is, the total static
  • the execution result of the resource request A is extracted and used directly.
  • the present application further provides an apparatus corresponding to the processing method of the static resource request in the first embodiment.
  • an apparatus corresponding to the processing method of the static resource request in the first embodiment.
  • the embodiment provides a processing device for a static resource request. As shown in FIG. 3, the device includes:
  • the first obtaining module 301 is configured to acquire N static resource requests, where N is an integer greater than 1.
  • the classification module 302 is configured to classify the N static resource requests into M type static resource requests, where M is a positive integer smaller than N;
  • the merging module 303 is configured to separately merge each type of static resource request in the M-type static resource request, and merge them into M total static resource requests.
  • the sending module 304 is configured to send the M total static resource requests to the client.
  • the device may be a stand-alone server or a server group composed of multiple servers, which is not limited herein.
  • the device introduced in the third embodiment of the present invention is a device used in the method for processing a static resource request according to the first embodiment of the present invention. Therefore, those skilled in the art can understand the device according to the method introduced in the first embodiment of the present invention. The specific structure and deformation, and therefore will not be described here.
  • the apparatus used in the method of the first embodiment of the present invention is within the scope of the present invention.
  • the present application further provides an apparatus corresponding to the processing method of the static resource request in the second embodiment.
  • an apparatus corresponding to the processing method of the static resource request in the second embodiment.
  • the embodiment provides a processing device for a static resource request. As shown in FIG. 4, the device includes:
  • the second obtaining module 401 is configured to obtain a total static resource request.
  • the deleting module 402 is configured to delete the domain name information in the total static resource request.
  • the dividing module 403 is configured to divide the total static resource request after deleting the domain name information according to a preset dividing rule, and obtain a plurality of sub-requests;
  • the executing module 404 is configured to separately execute the plurality of sub-requests.
  • the device may be an Android system, an IOS system, or a Windows system, and is not limited herein.
  • the device may be a smart phone, a tablet computer or a desktop computer, and is not limited herein.
  • the device introduced in the fourth embodiment of the present invention is a device used in the method for processing the static resource request according to the second embodiment of the present invention. Therefore, those skilled in the art can understand the device according to the method described in the second embodiment of the present invention. The specific structure and deformation, and therefore will not be described here.
  • the apparatus used in the method of the second embodiment of the present invention is within the scope of the present invention.
  • the method and device provided by the embodiments of the present application combine the same type of static resource requests in multiple static resource requests, and then send the combined total static resource requests to the client to reduce the number of static resource requests, thereby reducing the need.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

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

Abstract

Disclosed are a static resource request processing method and device, wherein the method comprises: acquiring N static resource requests, N being an integer greater than 1; classifying the N static resource requests, and dividing same into M types of static resource requests, M being a positive integer less than N; respectively merging each type of static resource request in the M types of static resource requests, obtaining M merged total static resource requests; and sending the M total static resource requests to a client. The method further comprises: acquiring the total static resource requests; deleting domain name information in the total static resource requests; according to a pre-set division rule, dividing the total static resource requests with the domain name information deleted, and acquiring multiple sub-requests; respectively executing the multiple sub-requests. The method and device provided in the present application can solve the technical problem of slow processing speed caused by too many HTTP request connections in the prior art, and have the technical effect of improving the processing speed of static resource requests.

Description

一种静态资源请求处理方法及装置Static resource request processing method and device 技术领域Technical field
本发明涉及计算机技术领域,尤其涉及一种静态资源请求处理方法及装置。The present invention relates to the field of computer technologies, and in particular, to a static resource request processing method and apparatus.
背景技术Background technique
目前,随着网络通信技术的进步和宽带网络的提速,越来越多的用户使用网络页面来交流或获取信息。At present, with the advancement of network communication technology and the speed of broadband networks, more and more users use network pages to exchange or obtain information.
为了提升用户体验,各网页运营商需要根据节日、新闻或用户反馈需求等来频繁的更改网页的状态,这就需要通过静态资源请求来实现,网页的静态资源请求主要用来更改网页的显示及网页的功能。而每条静态资源请求的传输均需要服务器与客户端建立对应的超文本传输协议(HyperText Transfer Protocol,HTTP)请求来实现,当网页更改较多时,对应的静态资源请求数量就多,需要建立的HTTP请求连接数就越多。In order to improve the user experience, each web page operator needs to change the status of the web page frequently according to the holiday, news or user feedback requirements, etc., which needs to be implemented through a static resource request, and the static resource request of the web page is mainly used to change the display of the web page and The function of the web page. The transmission of each static resource request requires a HyperText Transfer Protocol (HTTP) request from the server and the client. When there are many web page changes, the number of corresponding static resource requests is large, and needs to be established. The more HTTP request connections are.
然而,HTTP请求连接数过多会极大的影响客户端和服务器端对静态资源请求的处理速度,导致处理速度慢的技术问题。However, too many HTTP request connections will greatly affect the processing speed of the static resource request by the client and the server, resulting in a technical problem of slow processing speed.
发明内容Summary of the invention
本发明提供一种静态资源请求处理方法及装置,用以解决现有技术中HTTP请求连接数过多导致的处理速度慢的技术问题。The present invention provides a static resource request processing method and apparatus, which are used to solve the technical problem of slow processing speed caused by too many HTTP request connections in the prior art.
一方面,本发明提供了一种静态资源请求的处理方法,包括:In one aspect, the present invention provides a method for processing a static resource request, including:
获取N个静态资源请求,N为大于1的整数;Obtain N static resource requests, where N is an integer greater than one;
对所述N个静态资源请求进行分类,分为M类静态资源请求,M为小于N的正整数;The N static resource requests are classified into M type static resource requests, and M is a positive integer smaller than N;
将所述M类静态资源请求中的每一类静态资源请求分别进行合并,共合并为M个总静态资源请求;Each type of static resource request in the type M static resource request is separately combined and merged into M total static resource requests;
发送所述M个总静态资源请求至客户端。Sending the M total static resource requests to the client.
可选的,所述对所述N个静态资源请求进行分类,包括:确定所述N个静态资源请求的功能,基于所述功能对所述N个静态资源请求进行分类;或者,确定所述N个静态资源请求的生成时间,基于所述生成时间对所述N个静态资源请求进行分类;或者,确定所述N个静态资源请求的获取来源,基于所述获取来源对所述N个静态资源请求进行分类。Optionally, the classifying the N static resource requests includes: determining a function of the N static resource requests, classifying the N static resource requests based on the function; or determining the The N static resource request generation time, the N static resource requests are classified according to the generation time; or the acquisition source of the N static resource requests is determined, and the N statics are determined based on the acquisition source Resource requests are categorized.
可选的,所述将所述M类静态资源请求中的每一类静态资源请求分别进行合并,包括:将所述每一类静态资源请求中的所有静态资源请求合并在一条总 静态资源请求中,以预设符号分隔所述每一类静态资源请求中的每条静态资源请求。Optionally, the merging each type of static resource request in the type M static resource request separately includes: combining all static resource requests in each type of static resource request into one total static resource request. Separating each static resource request in each type of static resource request by a preset symbol.
可选的,所述将所述M类静态资源请求中的每一类静态资源请求分别进行合并,包括:通过NGINX服务器和LUA语言,将所述M类静态资源请求中的每一类静态资源请求分别进行合并。Optionally, the merging each type of the static resource request in the M type static resource request separately includes: using the NGINX server and the LUA language, each type of static resource in the M type static resource request Request to merge separately.
另一方面,提供一种静态资源请求的处理方法,包括:In another aspect, a method for processing a static resource request is provided, including:
获取总静态资源请求;Obtain a total static resource request;
删除所述总静态资源请求中的域名信息;Deleting the domain name information in the total static resource request;
按预设划分规则,对删除域名信息后的总静态资源请求进行划分,获得多个分请求;According to the preset division rule, the total static resource request after deleting the domain name information is divided, and multiple sub-requests are obtained;
分别执行所述多个分请求。The plurality of sub-requests are respectively executed.
可选的,所述按预设划分规则,对删除域名信息后的总静态资源请求进行划分,包括:以预设符号为分隔符,对删除域名信息后的总静态资源请求进行划分。Optionally, the step of dividing the total static resource request after deleting the domain name information by using the preset division rule includes: dividing the total static resource request after deleting the domain name information by using a preset symbol as a separator.
可选的,在所述分别执行所述多个分请求之后,还包括:将执行所述多个分请求的执行结果合并写入缓存。Optionally, after the performing the multiple sub-requests separately, the method further includes: combining execution results of executing the multiple sub-requests into the cache.
可选的,在所述将执行所述多个分请求的执行结果写入缓存之后,还包括:对合并后的所述执行结果进行MD5校验以获得K值;当收到K值与获得的所述K值相同的新静态资源请求时,把所述执行结果作为所述新静态资源请求的执行结果写入缓存。Optionally, after the execution result of the performing the multiple sub-requests is written into the cache, the method further includes: performing MD5 verification on the merged execution result to obtain a K value; when receiving the K value and obtaining When the new static resource request with the same K value is requested, the execution result is written into the cache as the execution result of the new static resource request.
再一方面,提供一种静态资源请求的处理装置,包括:In a further aspect, a processing device for requesting a static resource includes:
第一获取模块,用于获取N个静态资源请求,N为大于1的整数;a first acquiring module, configured to acquire N static resource requests, where N is an integer greater than one;
分类模块,用于对所述N个静态资源请求进行分类,分为M类静态资源请求,M为小于N的正整数;a classification module, configured to classify the N static resource requests into M type static resource requests, where M is a positive integer smaller than N;
合并模块,用于将所述M类静态资源请求中的每一类静态资源请求分别进行合并,共合并为M个总静态资源请求;a merging module, configured to merge each type of static resource request in the type M static resource request into a total of two static resource requests;
发送模块,用于发送所述M个总静态资源请求至客户端。And a sending module, configured to send the M total static resource requests to the client.
再一方面,提供一种静态资源请求的处理装置,包括In still another aspect, a processing device for requesting a static resource is provided, including
第二获取模块,用于获取总静态资源请求;a second obtaining module, configured to obtain a total static resource request;
删除模块,用于删除所述总静态资源请求中的域名信息;a deleting module, configured to delete domain name information in the total static resource request;
划分模块,用于按预设划分规则,对删除域名信息后的总静态资源请求进行划分,获得多个分请求;The dividing module is configured to divide the total static resource request after deleting the domain name information by using a preset dividing rule, and obtain multiple sub-requests;
执行模块,用于分别执行所述多个分请求。An execution module is configured to separately execute the plurality of sub-requests.
本发明实施例中提供的一个或多个技术方案,至少具有如下技术效果或优 点:One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
本申请实施例提供的方法及装置,对多个静态资源请求中的同一类静态资源请求进行合并,再将合并后的总静态资源请求发送至客户端,以减少静态资源请求数量,从而减少需要建立的HTTP请求连接数,进而加快对静态资源请求的处理速度。The method and device provided by the embodiments of the present application combine the same type of static resource requests in multiple static resource requests, and then send the combined total static resource requests to the client to reduce the number of static resource requests, thereby reducing the need. The number of HTTP request connections established, which speeds up the processing of static resource requests.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, and the above-described and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1为本发明实施例一中静态资源请求的处理方法的流程图;1 is a flowchart of a method for processing a static resource request according to Embodiment 1 of the present invention;
图2为本发明实施例二中静态资源请求的处理方法的流程图;2 is a flowchart of a method for processing a static resource request according to Embodiment 2 of the present invention;
图3为本发明实施例三中静态资源请求的处理装置的结构示意图;3 is a schematic structural diagram of a device for processing a static resource request according to Embodiment 3 of the present invention;
图4为本发明实施例四中静态资源请求的处理装置的结构示意图。FIG. 4 is a schematic structural diagram of a device for processing a static resource request according to Embodiment 4 of the present invention.
具体实施方式detailed description
本申请实施例通过提供一种静态资源请求处理方法及装置,用以解决现有技术中HTTP请求连接数过多导致的处理速度慢的技术问题。实现了提高静态资源请求处理速度的技术效果。The embodiment of the present application provides a static resource request processing method and device, which is used to solve the technical problem that the processing speed is slow due to the excessive number of HTTP request connections in the prior art. The technical effect of improving the processing speed of static resource request is realized.
本申请实施例中的技术方案,总体思路如下:The general technical idea of the technical solution in the embodiment of the present application is as follows:
获取N个静态资源请求,N为大于1的整数;对所述N个静态资源请求进行分类,分为M类静态资源请求,M为小于N的正整数;将所述M类静态资源请求中的每一类静态资源请求分别进行合并,共合并为M个总静态资源请求;发送所述M个总静态资源请求至客户端。Obtaining N static resource requests, where N is an integer greater than 1; classifying the N static resource requests into M type static resource requests, where M is a positive integer less than N; Each type of static resource request is separately merged and merged into M total static resource requests; the M total static resource requests are sent to the client.
上述方法通过对多个静态资源请求中的同一类静态资源请求进行合并,再将合并后的总静态资源请求发送至客户端,以减少静态资源请求数量,从而减少需要建立的HTTP请求连接数,进而加快对静态资源请求的处理速度。The foregoing method combines the same type of static resource requests in multiple static resource requests, and then sends the combined total static resource requests to the client to reduce the number of static resource requests, thereby reducing the number of HTTP request connections that need to be established. This speeds up the processing of static resource requests.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中 的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
实施例一Embodiment 1
本实施例提供一种静态资源请求的处理方法,如图1所示,所述方法包括:This embodiment provides a method for processing a static resource request. As shown in FIG. 1 , the method includes:
步骤S101,获取N个静态资源请求,N为大于1的整数;Step S101: Acquire N static resource requests, where N is an integer greater than 1.
步骤S102,对所述N个静态资源请求进行分类,分为M类静态资源请求,M为小于N的正整数;Step S102, classifying the N static resource requests into M type static resource requests, where M is a positive integer smaller than N;
步骤S103,将所述M类静态资源请求中的每一类静态资源请求分别进行合并,共合并为M个总静态资源请求;Step S103: Combine each type of static resource request in the M type static resource request, and merge them into M total static resource requests.
步骤S104,发送所述M个总静态资源请求至客户端。Step S104: Send the M total static resource requests to the client.
在本申请实施例中,所述方法可以应用于服务器端。In the embodiment of the present application, the method may be applied to a server.
下面,结合图1详细介绍所述静态资源请求的处理方法的实施步骤。The implementation steps of the processing method of the static resource request are described in detail below with reference to FIG.
首先,执行步骤S101,获取N个静态资源请求,N为大于1的整数。First, step S101 is executed to acquire N static resource requests, where N is an integer greater than 1.
需要说明的是,所述N个静态资源请求可以是网页维护人员撰写输入的请求,也可以是接收到的其他电子设备发送的请求,在此不作限制。It should be noted that the N static resource requests may be requests for writing by the webpage maintenance personnel, or may be requests received by other electronic devices, and are not limited herein.
然后,执行步骤S102,对所述N个静态资源请求进行分类,分为M类静态资源请求,M为小于N的正整数。Then, step S102 is performed to classify the N static resource requests into M class static resource requests, where M is a positive integer smaller than N.
在本申请实施例中,所述对所述N个静态资源请求进行分类,包括:In the embodiment of the present application, the classifying the N static resource requests includes:
确定所述N个静态资源请求的功能,基于所述功能对所述N个静态资源请求进行分类;或者,Determining the function of the N static resource requests, and classifying the N static resource requests based on the function; or
确定所述N个静态资源请求的生成时间,基于所述生成时间对所述N个静态资源请求进行分类;Determining a generation time of the N static resource requests, and classifying the N static resource requests based on the generation time;
确定所述N个静态资源请求的获取来源,基于所述获取来源对所述N个静态资源请求进行分类。Determining the source of the N static resource requests, and classifying the N static resource requests based on the obtaining source.
举例来说,当所述N个静态资源请求中有一部分是用于改变网页显示状态的请求,还有一部分是用于改变网页播放音乐的请求,另外还有一部分是用于改变网页交互模式的请求,则可以将所述N个静态资源请求按照功能分为三类。For example, when some of the N static resource requests are for changing the display status of the webpage, and part of the request is for changing the webpage playing music, and another part is for changing the webpage interaction mode. The request may divide the N static resource requests into three categories according to functions.
当然,在具体实施过程中,还可以根据N个静态资源请求所针对更改的网页的网页域名来进行分类,即,将同一网页域名对应的静态资源请求划分为一类。Of course, in the specific implementation process, the static resource requests corresponding to the same webpage domain name may be classified into one class according to the N static resource request.
再下来,执行步骤S103,将所述M类静态资源请求中的每一类静态资源请求分别进行合并,共合并为M个总静态资源请求。Then, in step S103, each type of static resource request in the M type static resource request is separately combined and merged into M total static resource requests.
例如,假设12个静态资源请求按照功能分为8个用于网页显示更改和4个用于网页功能更改两大类,则对应可以将所述8个用于网页显示更改的静态资源 请求合并为一条请求,将4个用于网页功能更改的静态资源请求合并为另一条请求,合并后共有2条总静态资源请求,只需要建立2条HTTP请求连接,能大大减少需要建立的HTTP请求连接数量。For example, if 12 static resource requests are divided into 8 categories for web page display changes and 4 for web page function changes according to functions, the corresponding 8 static resource requests for web page display changes can be merged into A request to merge four static resource requests for web page function changes into another request. After the merge, there are two total static resource requests, and only two HTTP request connections need to be established, which can greatly reduce the number of HTTP request connections that need to be established. .
在本申请实施例中,合并所述静态资源请求的方法较多,下面列举两种为例:In the embodiment of the present application, there are many methods for merging the static resource request, and two examples are as follows:
第一种、采用预设分隔符号来划分。The first type is divided by a preset separator.
即,所述将所述M类静态资源请求中的每一类静态资源请求分别进行合并,包括:That is, the merging each type of static resource request in the M type static resource request separately includes:
将所述每一类静态资源请求中的所有静态资源请求合并在一条总静态资源请求中,以预设符号分隔所述每一类静态资源请求中的每条静态资源请求。All static resource requests in each type of static resource request are combined into one total static resource request, and each static resource request in each type of static resource request is separated by a preset symbol.
具体来讲,所述预设符号可以是分号、逗号、破折号、斜杠或空格等,在此不再一一列举,也不作限制。Specifically, the preset symbol may be a semicolon, a comma, a dash, a slash, or a space, and is not listed here, nor is it limited.
例如:需要合并的请求为a1,a2,a3和a4,则以分号为分隔符,将其合并为a1;a2;a3;a4。For example, the requests that need to be merged are a1, a2, a3, and a4, and the semicolon is used as a separator to merge them into a1; a2; a3; a4.
第二种,采用预设语句来划分。Second, the default statement is used to divide.
例如,需要合并的请求为a1,a2,a3和a4,则采用预设语句“AND”将其合并为a1AND a2AND a3AND a4。For example, if the requests to be merged are a1, a2, a3, and a4, they are merged into a1AND a2AND a3AND a4 using the preset statement "AND".
在本申请实施例中,对静态资源请求的合并主要是通过NGINX服务器和LUA脚本语言来实现的。In the embodiment of the present application, the merging of the static resource request is mainly implemented by the NGINX server and the LUA scripting language.
再下来,执行步骤S104,发送所述M个总静态资源请求至客户端。Then, step S104 is executed to send the M total static resource requests to the client.
具体来讲,由于通过合并同类的静态资源请求减少了静态资源请求的数量,故发送所述M个总静态资源请求至客户端,只需要建立M条HTTP请求连接,减少了HTTP请求连接的数量,提高了静态资源请求的处理速度。Specifically, since the number of static resource requests is reduced by merging the same static resource request, the M total static resource requests are sent to the client, and only M HTTP request connections need to be established, thereby reducing the number of HTTP request connections. , improve the processing speed of static resource requests.
基于同一发明构思,本申请还提供了与实施例一中静态资源请求的处理方法对应的方法,详见实施例二。Based on the same inventive concept, the present application further provides a method corresponding to the processing method of the static resource request in the first embodiment. For details, refer to the second embodiment.
实施例二Embodiment 2
本实施例提供了一种静态资源请求的处理方法,如图2所示,所述方法包括:This embodiment provides a method for processing a static resource request. As shown in FIG. 2, the method includes:
步骤S201,获取总静态资源请求;Step S201: Acquire a total static resource request.
步骤S202,删除所述总静态资源请求中的域名信息;Step S202, deleting domain name information in the total static resource request;
步骤S203,按预设划分规则,对删除域名信息后的总静态资源请求进行划分,获得多个分请求;Step S203, according to the preset division rule, dividing the total static resource request after deleting the domain name information, and obtaining a plurality of sub-requests;
步骤S204,分别执行所述多个分请求。Step S204, respectively executing the plurality of sub-requests.
需要说明的是,本实施例中提供的方法是与实施例一中提供的方法对应 的。实施例一的方法主要是对静态资源请求的合并,而本实施例提供的方法是解决如何从合并后的静态资源请求中划分出原来的各条静态资源请求,并执行。It should be noted that the method provided in this embodiment corresponds to the method provided in the first embodiment. The method of the first embodiment is mainly for the merging of the static resource request, and the method provided by the embodiment is to solve the problem of how to divide and execute the original static resource request from the merged static resource request.
在具体实施过程中,本实施例的方法可以应用于客户端。In a specific implementation process, the method of this embodiment can be applied to a client.
下面,结合图2,详细介绍本实施例提供的静态资源请求的处理方法的实施步骤:The following takes the steps of implementing the static resource request processing method provided by this embodiment in detail with reference to FIG. 2:
首先,执行步骤S201,获取总静态资源请求。First, step S201 is performed to obtain a total static resource request.
具体来讲,可以是服务器通过与客户端建立的HTTP请求连接,将实施例一中合并后的所述总静态资源请求发送至所述客户端。Specifically, the server may send the combined total static resource request in Embodiment 1 to the client by using an HTTP request connection established with the client.
然后,执行步骤S202,删除所述总静态资源请求中的域名信息。Then, step S202 is performed to delete the domain name information in the total static resource request.
具体来讲,由于静态资源请求中除了各条分请求外,还有需要更改的网页的域名信息,以确定需要更改的是哪个网页,在划分出各分请求前,可以先删除所述域名信息。Specifically, in addition to each sub-request, the static resource request has domain name information of the webpage that needs to be changed to determine which webpage needs to be changed, and the domain name information may be deleted before each sub-request is divided. .
再下来,执行步骤S203,按预设划分规则,对删除域名信息后的总静态资源请求进行划分,获得多个分请求。Then, step S203 is executed to divide the total static resource request after deleting the domain name information according to the preset division rule, and obtain a plurality of sub-requests.
需要说明的是,本实施例中对总静态资源请求进行划分的方法,应该与实施例一中该总静态资源请求的合并方法对应,才能实现准确划分。It should be noted that the method for dividing the total static resource request in this embodiment should be corresponding to the merging method of the total static resource request in the first embodiment, so as to achieve accurate division.
举例来说,如果所述总静态资源请求的合并方法为:将所述每一类静态资源请求中的所有静态资源请求合并在一条总静态资源请求中,以预设符号分隔所述每一类静态资源请求中的每条静态资源请求。则对应的,对删除域名信息后的总静态资源请求进行划分的方法为:以所述预设符号为分隔符,对删除域名信息后的总静态资源请求进行划分。For example, if the total static resource request is merged by merging all the static resource requests in each type of static resource request into one total static resource request, each of the classes is separated by a preset symbol. Each static resource request in a static resource request. Then, the method for dividing the total static resource request after deleting the domain name information is: dividing the total static resource request after deleting the domain name information by using the preset symbol as a separator.
具体来讲,所述预设符号可以是分号、逗号、破折号、斜杠或空格等,在此不再一一列举,也不作限制。Specifically, the preset symbol may be a semicolon, a comma, a dash, a slash, or a space, and is not listed here, nor is it limited.
采用预设语句来合并生成总静态资源请求时的划分方法与之类似,在此不再累述。The division method when the default statement is used to merge and generate the total static resource request is similar, and will not be described here.
然后,执行步骤S204,分别执行所述多个分请求。Then, step S204 is performed to execute the plurality of sub-requests respectively.
在本申请实施例中,在所述分别执行所述多个分请求之后,还包括:In the embodiment of the present application, after the performing the multiple sub-requests separately, the method further includes:
将执行所述多个分请求的执行结果合并写入缓存。The execution result of executing the plurality of sub-requests is merged into the cache.
进一步,在所述将执行所述多个分请求的执行结果写入缓存之后,还包括:Further, after the execution result of the execution of the multiple sub-requests is written into the cache, the method further includes:
对合并后的所述执行结果进行MD5校验以获得K值;Performing MD5 check on the combined execution result to obtain a K value;
当收到K值与获得的所述K值相同的新静态资源请求时,把所述执行结果作为所述新静态资源请求的执行结果写入缓存。When a new static resource request having the same K value and the obtained K value is received, the execution result is written into the cache as an execution result of the new static resource request.
具体来讲,将每次的所述执行结果合并写入缓存,能并于后续再接收到同 样的总静态资源请求时,能直接提取缓存中存储的所述执行结果来使用,能极大的减少计算量,提高计算速度。Specifically, the execution result of each execution is merged into the cache, and when the same total static resource request is received subsequently, the execution result stored in the cache can be directly extracted and used, which can be extremely Reduce the amount of calculation and increase the calculation speed.
进一步,为了能便于判断后续接收到的总静态资源请求是否与之前执行过的总静态资源请求为相同的请求,可以对每次的执行结果进行MD5校验以获得该总静态资源请求对应的K值。在后续其他总静态资源请求中可以通过写入K值来帮助客户端判断接收到的总静态资源请求是否曾经接收过。如果后续收到同样K值的请求时直接把执行结果写入缓存,以减少系统计算量。Further, in order to facilitate determining whether the subsequently received total static resource request is the same as the previously executed total static resource request, the MD5 check may be performed on each execution result to obtain the K corresponding to the total static resource request. value. In subsequent subsequent total static resource requests, the K value can be written to help the client determine whether the received total static resource request has been received. If the subsequent request for the same K value is received, the execution result is directly written into the cache to reduce the amount of system calculation.
例如,对总静态资源请求A进行MD5校验,获得K值为x时,客户端返回该K值至服务器端,以使服务器端的维护人员获知,则下次再编写同样的总静态资源请求B时,可以写入同样的K值x,当客户端获得总静态资源请求B时,通过提取出K值,就可以判断出总静态资源请求B与总静态资源请求A是同一请求,即将总静态资源请求A的执行结果提取出来,直接使用。For example, if the total static resource request A is MD5 checked, and the K value is x, the client returns the K value to the server to make the server maintenance personnel know, and then write the same total static resource request B next time. When the client obtains the total static resource request B, when the client obtains the total static resource request B, by extracting the K value, it can be determined that the total static resource request B and the total static resource request A are the same request, that is, the total static The execution result of the resource request A is extracted and used directly.
基于同一发明构思,本申请还提供了与实施例一中静态资源请求的处理方法对应的装置,详见实施例三。Based on the same inventive concept, the present application further provides an apparatus corresponding to the processing method of the static resource request in the first embodiment. For details, refer to the third embodiment.
实施例三Embodiment 3
本实施例提供了一种静态资源请求的处理装置,如图3所示,该装置包括:The embodiment provides a processing device for a static resource request. As shown in FIG. 3, the device includes:
第一获取模块301,用于获取N个静态资源请求,N为大于1的整数;The first obtaining module 301 is configured to acquire N static resource requests, where N is an integer greater than 1.
分类模块302,用于对所述N个静态资源请求进行分类,分为M类静态资源请求,M为小于N的正整数;The classification module 302 is configured to classify the N static resource requests into M type static resource requests, where M is a positive integer smaller than N;
合并模块303,用于将所述M类静态资源请求中的每一类静态资源请求分别进行合并,共合并为M个总静态资源请求;The merging module 303 is configured to separately merge each type of static resource request in the M-type static resource request, and merge them into M total static resource requests.
发送模块304,用于发送所述M个总静态资源请求至客户端。The sending module 304 is configured to send the M total static resource requests to the client.
在本申请实施例中,所述装置可以是一台独立的服务器,也可以是多台服务器组成的服务器群,在此不作限制。In the embodiment of the present application, the device may be a stand-alone server or a server group composed of multiple servers, which is not limited herein.
由于本发明实施例三所介绍的装置,为实施本发明实施例一的静态资源请求的处理方法所采用的装置,故而基于本发明实施例一所介绍的方法,本领域所属人员能够了解该装置的具体结构及变形,故而在此不再赘述。凡是本发明实施例一的方法所采用的装置都属于本发明所欲保护的范围。The device introduced in the third embodiment of the present invention is a device used in the method for processing a static resource request according to the first embodiment of the present invention. Therefore, those skilled in the art can understand the device according to the method introduced in the first embodiment of the present invention. The specific structure and deformation, and therefore will not be described here. The apparatus used in the method of the first embodiment of the present invention is within the scope of the present invention.
基于同一发明构思,本申请还提供了与实施例二中静态资源请求的处理方法对应的装置,详见实施例四。Based on the same inventive concept, the present application further provides an apparatus corresponding to the processing method of the static resource request in the second embodiment. For details, see Embodiment 4.
实施例四Embodiment 4
本实施例提供了一种静态资源请求的处理装置,如图4所示,所述装置包括:The embodiment provides a processing device for a static resource request. As shown in FIG. 4, the device includes:
第二获取模块401,用于获取总静态资源请求;The second obtaining module 401 is configured to obtain a total static resource request.
删除模块402,用于删除所述总静态资源请求中的域名信息;The deleting module 402 is configured to delete the domain name information in the total static resource request.
划分模块403,用于按预设划分规则,对删除域名信息后的总静态资源请求进行划分,获得多个分请求;The dividing module 403 is configured to divide the total static resource request after deleting the domain name information according to a preset dividing rule, and obtain a plurality of sub-requests;
执行模块404,用于分别执行所述多个分请求。The executing module 404 is configured to separately execute the plurality of sub-requests.
在本申请实施例中,所述装置可以为Android系统,IOS系统或Windows系统,在此不作限制。所述装置可以为智能手机,平板电脑或台式机,在此也不作限制。In the embodiment of the present application, the device may be an Android system, an IOS system, or a Windows system, and is not limited herein. The device may be a smart phone, a tablet computer or a desktop computer, and is not limited herein.
由于本发明实施例四所介绍的装置,为实施本发明实施例二的静态资源请求的处理方法所采用的装置,故而基于本发明实施例二所介绍的方法,本领域所属人员能够了解该装置的具体结构及变形,故而在此不再赘述。凡是本发明实施例二的方法所采用的装置都属于本发明所欲保护的范围。The device introduced in the fourth embodiment of the present invention is a device used in the method for processing the static resource request according to the second embodiment of the present invention. Therefore, those skilled in the art can understand the device according to the method described in the second embodiment of the present invention. The specific structure and deformation, and therefore will not be described here. The apparatus used in the method of the second embodiment of the present invention is within the scope of the present invention.
本申请实施例中提供的技术方案,至少具有如下技术效果或优点:The technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
本申请实施例提供的方法及装置,对多个静态资源请求中的同一类静态资源请求进行合并,再将合并后的总静态资源请求发送至客户端,以减少静态资源请求数量,从而减少需要建立的HTTP请求连接数,进而加快对静态资源请求的处理速度。The method and device provided by the embodiments of the present application combine the same type of static resource requests in multiple static resource requests, and then send the combined total static resource requests to the client to reduce the number of static resource requests, thereby reducing the need. The number of HTTP request connections established, which speeds up the processing of static resource requests.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处 理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。While the preferred embodiment of the invention has been described, it will be understood that Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It is apparent that those skilled in the art can make various modifications and variations to the embodiments of the invention without departing from the spirit and scope of the embodiments of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the embodiments of the invention.

Claims (10)

  1. 一种静态资源请求的处理方法,其特征在于,包括:A method for processing a static resource request, comprising:
    获取N个静态资源请求,N为大于1的整数;Obtain N static resource requests, where N is an integer greater than one;
    对所述N个静态资源请求进行分类,分为M类静态资源请求,M为小于N的正整数;The N static resource requests are classified into M type static resource requests, and M is a positive integer smaller than N;
    将所述M类静态资源请求中的每一类静态资源请求分别进行合并,共合并为M个总静态资源请求;Each type of static resource request in the type M static resource request is separately combined and merged into M total static resource requests;
    发送所述M个总静态资源请求至客户端。Sending the M total static resource requests to the client.
  2. 如权利要求1所述的方法,其特征在于,所述对所述N个静态资源请求进行分类,包括:The method of claim 1, wherein the classifying the N static resource requests comprises:
    确定所述N个静态资源请求的功能,基于所述功能对所述N个静态资源请求进行分类;或者,Determining the function of the N static resource requests, and classifying the N static resource requests based on the function; or
    确定所述N个静态资源请求的生成时间,基于所述生成时间对所述N个静态资源请求进行分类;或者,Determining a generation time of the N static resource requests, and classifying the N static resource requests based on the generation time; or
    确定所述N个静态资源请求的获取来源,基于所述获取来源对所述N个静态资源请求进行分类。Determining the source of the N static resource requests, and classifying the N static resource requests based on the obtaining source.
  3. 如权利要求1所述的方法,其特征在于,所述将所述M类静态资源请求中的每一类静态资源请求分别进行合并,包括:The method of claim 1, wherein the merging each type of static resource request in the M-type static resource request separately comprises:
    将所述每一类静态资源请求中的所有静态资源请求合并在一条总静态资源请求中,以预设符号分隔所述每一类静态资源请求中的每条静态资源请求。All static resource requests in each type of static resource request are combined into one total static resource request, and each static resource request in each type of static resource request is separated by a preset symbol.
  4. 如权利要求1所述的方法,其特征在于,所述将所述M类静态资源请求中的每一类静态资源请求分别进行合并,包括:The method of claim 1, wherein the merging each type of static resource request in the M-type static resource request separately comprises:
    通过NGINX服务器和LUA语言,将所述M类静态资源请求中的每一类静态资源请求分别进行合并。Each type of static resource request in the M type static resource request is separately merged through the NGINX server and the LUA language.
  5. 一种静态资源请求的处理方法,其特征在于,包括:A method for processing a static resource request, comprising:
    获取总静态资源请求;Obtain a total static resource request;
    删除所述总静态资源请求中的域名信息;Deleting the domain name information in the total static resource request;
    按预设划分规则,对删除域名信息后的总静态资源请求进行划分,获得多个分请求;According to the preset division rule, the total static resource request after deleting the domain name information is divided, and multiple sub-requests are obtained;
    分别执行所述多个分请求。The plurality of sub-requests are respectively executed.
  6. 如权利要求5所述的方法,其特征在于,所述按预设划分规则,对删除域名信息后的总静态资源请求进行划分,包括:The method according to claim 5, wherein the dividing the total static resource request after deleting the domain name information according to the preset dividing rule comprises:
    以预设符号为分隔符,对删除域名信息后的总静态资源请求进行划分。The default static resource request after deleting the domain name information is divided by the preset symbol as a separator.
  7. 如权利要求5所述的方法,其特征在于,在所述分别执行所述多个分请 求之后,还包括:The method of claim 5, after the performing the plurality of sub-requests separately, further comprising:
    将执行所述多个分请求的执行结果合并写入缓存。The execution result of executing the plurality of sub-requests is merged into the cache.
  8. 如权利要求7所述的方法,其特征在于,在所述将执行所述多个分请求的执行结果写入缓存之后,还包括:The method according to claim 7, wherein after the execution result of the execution of the plurality of sub-requests is written to the cache, the method further comprises:
    对合并后的所述执行结果进行MD5校验以获得K值;Performing MD5 check on the combined execution result to obtain a K value;
    当收到K值与获得的所述K值相同的新静态资源请求时,把所述执行结果作为所述新静态资源请求的执行结果写入缓存。When a new static resource request having the same K value and the obtained K value is received, the execution result is written into the cache as an execution result of the new static resource request.
  9. 一种静态资源请求的处理装置,其特征在于,包括:A device for processing a static resource request, comprising:
    第一获取模块,用于获取N个静态资源请求,N为大于1的整数;a first acquiring module, configured to acquire N static resource requests, where N is an integer greater than one;
    分类模块,用于对所述N个静态资源请求进行分类,分为M类静态资源请求,M为小于N的正整数;a classification module, configured to classify the N static resource requests into M type static resource requests, where M is a positive integer smaller than N;
    合并模块,用于将所述M类静态资源请求中的每一类静态资源请求分别进行合并,共合并为M个总静态资源请求;a merging module, configured to merge each type of static resource request in the type M static resource request into a total of two static resource requests;
    发送模块,用于发送所述M个总静态资源请求至客户端。And a sending module, configured to send the M total static resource requests to the client.
  10. 一种静态资源请求的处理装置,其特征在于,包括A processing device for static resource request, characterized in that
    第二获取模块,用于获取总静态资源请求;a second obtaining module, configured to obtain a total static resource request;
    删除模块,用于删除所述总静态资源请求中的域名信息;a deleting module, configured to delete domain name information in the total static resource request;
    划分模块,用于按预设划分规则,对删除域名信息后的总静态资源请求进行划分,获得多个分请求;The dividing module is configured to divide the total static resource request after deleting the domain name information by using a preset dividing rule, and obtain multiple sub-requests;
    执行模块,用于分别执行所述多个分请求。An execution module is configured to separately execute the plurality of sub-requests.
PCT/CN2018/080671 2017-03-27 2018-03-27 Static resource request processing method and device WO2018177286A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710190250.XA CN106941530B (en) 2017-03-27 2017-03-27 A kind of static resource request processing method and device
CN201710190250.X 2017-03-27

Publications (1)

Publication Number Publication Date
WO2018177286A1 true WO2018177286A1 (en) 2018-10-04

Family

ID=59463148

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/080671 WO2018177286A1 (en) 2017-03-27 2018-03-27 Static resource request processing method and device

Country Status (2)

Country Link
CN (1) CN106941530B (en)
WO (1) WO2018177286A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106941530B (en) * 2017-03-27 2019-04-05 武汉斗鱼网络科技有限公司 A kind of static resource request processing method and device
CN107545058B (en) * 2017-08-29 2019-12-03 北京北信源软件股份有限公司 A kind of page loading method, server and browser
CN107729495A (en) * 2017-10-18 2018-02-23 郑州云海信息技术有限公司 A kind of file metadata browsing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101888404A (en) * 2010-05-27 2010-11-17 北京开心人信息技术有限公司 Data updating method and device for mobile equipment
US20110196988A1 (en) * 2002-02-01 2011-08-11 Codekko Software, Inc. System and Method for Partial Data Compression and Data Transfer
CN103701714A (en) * 2013-12-25 2014-04-02 北京奇虎科技有限公司 Page extraction method, server and network system
CN104580495A (en) * 2015-01-21 2015-04-29 百度在线网络技术(北京)有限公司 Network request processing method and device
CN106294597A (en) * 2016-07-28 2017-01-04 百度在线网络技术(北京)有限公司 For the method and apparatus that the static resource of webpage is grouped
CN106941530A (en) * 2017-03-27 2017-07-11 武汉斗鱼网络科技有限公司 A kind of static resource request processing method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8577889B2 (en) * 2006-07-18 2013-11-05 Aol Inc. Searching for transient streaming multimedia resources
CN102184231A (en) * 2011-05-12 2011-09-14 广州市动景计算机科技有限公司 Method and device for acquiring page resources

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110196988A1 (en) * 2002-02-01 2011-08-11 Codekko Software, Inc. System and Method for Partial Data Compression and Data Transfer
CN101888404A (en) * 2010-05-27 2010-11-17 北京开心人信息技术有限公司 Data updating method and device for mobile equipment
CN103701714A (en) * 2013-12-25 2014-04-02 北京奇虎科技有限公司 Page extraction method, server and network system
CN104580495A (en) * 2015-01-21 2015-04-29 百度在线网络技术(北京)有限公司 Network request processing method and device
CN106294597A (en) * 2016-07-28 2017-01-04 百度在线网络技术(北京)有限公司 For the method and apparatus that the static resource of webpage is grouped
CN106941530A (en) * 2017-03-27 2017-07-11 武汉斗鱼网络科技有限公司 A kind of static resource request processing method and device

Also Published As

Publication number Publication date
CN106941530B (en) 2019-04-05
CN106941530A (en) 2017-07-11

Similar Documents

Publication Publication Date Title
US9953079B2 (en) Preference based system and method for multiple feed aggregation and presentation
US10025878B1 (en) Data lineage analysis
US9612946B2 (en) Using linked data to determine package quality
JP6080866B2 (en) Computerized method, system, and computer program for mapping one or more dynamic visual objects of a network document
WO2018177286A1 (en) Static resource request processing method and device
US10929412B2 (en) Sharing content based on extracted topics
WO2021047239A1 (en) Page acquisition method, device and system
WO2022156087A1 (en) Data blood relationship establishing method and apparatus, computer device, and storage medium
US20200151227A1 (en) Computing system with dynamic web page feature
WO2014182582A1 (en) Transforming visualized data through visual analytics based on interactivity
TWI579708B (en) Method and apparatus for interacting with user data
KR102031589B1 (en) Methods and systems for processing relationship chains, and storage media
US11429400B2 (en) User interface metadata from an application program interface
CN113434384A (en) Pressure testing method and device
GB2522433A (en) Efficient decision making
US11113340B2 (en) Data generation and certification
CN109302446B (en) Cross-platform access method and device, electronic equipment and storage medium
CN115605827A (en) Method and apparatus for implementing UI modernized application modules
EP3289544A1 (en) Insertion of unsaved content via content channel
US20150261733A1 (en) Asset collection service through capture of content
US20200192681A1 (en) Method and apparatus for automated feed processing
CN115328381B (en) Page pushing method, device and server
CN113242306B (en) Block chain consensus method and device
US20220253467A1 (en) Method, device and program product for generating configuration information of storage system
CN109587224B (en) Data processing method and device, electronic equipment and computer readable medium

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: 18774454

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: 18774454

Country of ref document: EP

Kind code of ref document: A1