[go: up one dir, main page]

CN108111551A - Connection processing method and device - Google Patents

Connection processing method and device Download PDF

Info

Publication number
CN108111551A
CN108111551A CN201611042678.1A CN201611042678A CN108111551A CN 108111551 A CN108111551 A CN 108111551A CN 201611042678 A CN201611042678 A CN 201611042678A CN 108111551 A CN108111551 A CN 108111551A
Authority
CN
China
Prior art keywords
code
calling
interface
web page
pushed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611042678.1A
Other languages
Chinese (zh)
Other versions
CN108111551B (en
Inventor
高阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201611042678.1A priority Critical patent/CN108111551B/en
Publication of CN108111551A publication Critical patent/CN108111551A/en
Application granted granted Critical
Publication of CN108111551B publication Critical patent/CN108111551B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • 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/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请公开了一种连接处理方法及装置。该方法包括:获取代码维护工具推送的更新的代码;调用内容分发网络提供的接口;以及通过接口将更新的代码对应的连接在内容分发网络上进行刷新。通过本申请,解决了相关技术中由于新上线的代码文件刷新速度慢,影响代码部署效率的问题。

The application discloses a connection processing method and device. The method includes: obtaining the updated code pushed by the code maintenance tool; calling the interface provided by the content distribution network; and refreshing the connection corresponding to the updated code on the content distribution network through the interface. This application solves the problem in the related art that the efficiency of code deployment is affected due to the slow refresh speed of newly launched code files.

Description

连接处理方法及装置Connection processing method and device

技术领域technical field

本申请涉及内容分发网络技术领域,具体而言,涉及一种连接处理方法及装置。The present application relates to the technical field of content distribution network, and in particular, to a connection processing method and device.

背景技术Background technique

随着技术的不断发展,内容分发网络(Content Delivery Network,简称:CDN)应用越来越广泛。相关技术中将用户访问过的统一资源定位符(Uniform Resource Locator,缩写为URL)缓存在厂商的设备上,然后提供加速服务。然而当一条URL进行了更新时,研发人员会先用持续集成工具组合teamcity+git将该URL的代码文件推送至网页服务器,然后登录CDN后台地址手动操作进行URL刷新动作。虽然相关技术中可以很方便的对代码文件进行推送上线(即推送至网页服务器),但是系统不能根据新上线的代码文件自动化的进行缓存刷新,所以无法使新上线的代码文件中URL自动更新到外网,影响代码部署效率。With the continuous development of technology, a content delivery network (Content Delivery Network, CDN for short) is more and more widely used. In the related art, the Uniform Resource Locator (Uniform Resource Locator, URL for short) visited by the user is cached on the device of the manufacturer, and then the acceleration service is provided. However, when a URL is updated, the developer will first use the continuous integration tool combination teamcity+git to push the code file of the URL to the web server, and then log in to the CDN background address to manually perform the URL refresh action. Although the code files can be easily pushed online (that is, pushed to the web server) in related technologies, the system cannot automatically refresh the cache according to the newly launched code files, so the URL in the newly launched code files cannot be automatically updated to The external network affects the efficiency of code deployment.

针对相关技术中由于内容分发网络中对新上线的代码文件刷新速度慢,影响代码部署效率的问题,目前尚未提出有效的解决方案。Aiming at the problem in related technologies that the refresh rate of newly launched code files in the content distribution network is slow, which affects the efficiency of code deployment, no effective solution has been proposed yet.

发明内容Contents of the invention

本申请的主要目的在于提供一种连接处理方法及装置,以解决相关技术中由于新上线的代码文件刷新速度慢,影响代码部署效率的问题。The main purpose of the present application is to provide a connection processing method and device to solve the problem in the related art that the efficiency of code deployment is affected due to the slow refresh speed of newly launched code files.

为了实现上述目的,根据本申请的一个方面,提供了一种连接处理方法。该方法包括:获取代码维护工具推送的更新的代码;调用内容分发网络提供的接口;以及通过接口将更新的代码对应的连接在内容分发网络上进行刷新。In order to achieve the above purpose, according to one aspect of the present application, a connection processing method is provided. The method includes: obtaining the updated code pushed by the code maintenance tool; calling the interface provided by the content distribution network; and refreshing the connection corresponding to the updated code on the content distribution network through the interface.

进一步地,获取代码维护工具推送的更新的代码包括:获取代码维护工具中推送更新的代码的函数;获取函数中的调用方法,其中,调用方法提供更新的代码,调用方法是预先配置在函数中的;以及通过调用方法获取到更新的代码。Further, obtaining the updated code pushed by the code maintenance tool includes: obtaining the function of pushing the updated code in the code maintenance tool; obtaining the calling method in the function, wherein the calling method provides the updated code, and the calling method is pre-configured in the function and get the updated code by calling the method.

进一步地,调用内容分发网络提供的接口包括:通过调用方法启动配置在网页服务器上的钩子程序;以及通过钩子程序调用内容分发网络提供的接口。Further, calling the interface provided by the CDN includes: starting a hook program configured on the web server by calling a method; and calling the interface provided by the CDN through the hook program.

进一步地,通过调用方法启动配置在网页服务器上的钩子程序包括:向网页服务器推送预设文件;以及在推送预设文件之后,向网页服务器发送启动指令,其中,启动指令用于启动配置在网页服务器上的钩子程序。Further, starting the hook program configured on the webpage server by calling the method includes: pushing a preset file to the webpage server; and after pushing the preset file, sending a startup instruction to the webpage server, wherein the startup instruction is used to start the Hook program on the server.

进一步地,启动指令是通过代码维护工具依据预设规则生成的指令。Further, the startup instruction is an instruction generated by a code maintenance tool according to a preset rule.

为了实现上述目的,根据本申请的另一方面,提供了一种连接处理装置。该装置包括:获取单元,用于获取代码维护工具推送的更新的代码;调用单元,用于调用内容分发网络提供的接口;以及刷新单元,用于通过接口将更新的代码对应的连接在内容分发网络上进行刷新。In order to achieve the above object, according to another aspect of the present application, a connection processing device is provided. The device includes: an acquisition unit, configured to acquire updated code pushed by a code maintenance tool; a calling unit, configured to invoke an interface provided by a content distribution network; and a refresh unit, configured to connect the updated code correspondingly to the content distribution network through the interface. Refresh on the network.

进一步地,获取单元包括:第一获取模块,用于获取代码维护工具中推送更新的代码的函数;第二获取模块,用于获取函数中的调用装置,其中,调用装置提供更新的代码,调用装置是预先配置在函数中的;以及第三获取模块,用于通过调用装置获取到更新的代码。Further, the acquisition unit includes: a first acquisition module, used to acquire the function of pushing the updated code in the code maintenance tool; a second acquisition module, used to acquire the calling device in the function, wherein the calling device provides the updated code, calls The device is pre-configured in the function; and the third obtaining module is used to obtain the updated code by calling the device.

进一步地,调用单元包括:启动模块,用于通过调用装置启动配置在网页服务器上的钩子程序;以及调用模块,用于通过钩子程序调用内容分发网络提供的接口。Further, the invoking unit includes: a starting module, used to start a hook program configured on the web server through the calling device; and a calling module, used to call an interface provided by the CDN through the hook program.

进一步地,启动模块包括:推送子模块,用于向网页服务器推送预设文件;以及发送子模块,用于在推送预设文件之后,向网页服务器发送启动指令,其中,启动指令用于启动配置在网页服务器上的钩子程序。Further, the startup module includes: a push submodule, configured to push a preset file to the webpage server; and a sending submodule, used to send a startup instruction to the webpage server after pushing the preset file, wherein the startup instruction is used to start the configuration A hook program on a web server.

进一步地,启动指令是通过代码维护工具依据预设规则生成的指令。Further, the startup instruction is an instruction generated by a code maintenance tool according to a preset rule.

通过本申请,采用以下步骤:获取代码维护工具推送的更新的代码;调用内容分发网络提供的接口;以及通过接口将更新的代码对应的连接在内容分发网络上进行刷新,解决了相关技术中由于新上线的代码文件刷新速度慢,影响代码部署效率的问题。通过调用内容分发网络提供的接口将更新的代码对应的连接在内容分发网络上进行刷新,提高了更新的代码的刷新的效率,达到了提升代码部署的效率的效果。Through this application, the following steps are adopted: obtain the updated code pushed by the code maintenance tool; call the interface provided by the content distribution network; and refresh the connection corresponding to the updated code on the content distribution network through the interface, solving the problem of The refresh speed of newly launched code files is slow, which affects the efficiency of code deployment. By calling the interface provided by the content distribution network, the connection corresponding to the updated code is refreshed on the content distribution network, which improves the efficiency of refreshing the updated code and achieves the effect of improving the efficiency of code deployment.

附图说明Description of drawings

构成本申请的一部分的附图用来提供对本申请的进一步理解,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings constituting a part of the application are used to provide further understanding of the application, and the schematic embodiments and descriptions of the application are used to explain the application, and do not constitute an improper limitation to the application. In the attached picture:

图1是根据本申请实施例提供的连接处理方法的流程图;以及FIG. 1 is a flowchart of a connection processing method provided according to an embodiment of the present application; and

图2是根据本申请实施例提供的连接处理装置的示意图。Fig. 2 is a schematic diagram of a connection processing device provided according to an embodiment of the present application.

具体实施方式Detailed ways

需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments.

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is an embodiment of a part of the application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.

需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present application and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It should be understood that the data so used may be interchanged under appropriate circumstances for the embodiments of the application described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

为了便于描述,以下对本申请实施例涉及的部分名词或术语进行说明:For ease of description, some nouns or terms involved in the embodiments of the present application are described below:

内容分发网络,英文全称Content Delivery Network,简称CDN。内容分发网络基本思路是尽可能避开互联网上有可能影响数据传输速度和稳定性的瓶颈和环节,使内容传输的更快、更稳定。通过在网络各处放置节点服务器所构成的在现有的互联网基础之上的一层智能虚拟网络,CDN系统能够实时地根据网络流量和各节点的连接、负载状况以及到用户的距离和响应时间等综合信息将用户的请求重新导向离用户最近的服务节点上。其目的是使用户可就近取得所需内容,解决Internet网络拥挤的状况,提高用户访问网站的响应速度。Content Delivery Network, the English full name is Content Delivery Network, referred to as CDN. The basic idea of content delivery network is to avoid as far as possible the bottlenecks and links on the Internet that may affect the speed and stability of data transmission, so as to make content transmission faster and more stable. By placing a layer of intelligent virtual network based on the existing Internet based on node servers placed everywhere in the network, the CDN system can real-time according to the network traffic and the connection of each node, the load status, the distance to the user and the response time and other comprehensive information to redirect the user's request to the service node closest to the user. Its purpose is to enable users to obtain the required content nearby, solve the congestion situation of the Internet network, and improve the response speed of users' access to websites.

统一资源定位符(Uniform Resource Locator,缩写为URL),又叫做网页地址,是互联网上标准的资源的地址(Address)。互联网上的每个文件都有一个唯一的URL,它包含的信息指出文件的位置以及浏览器应该怎么处理它。它最初是作为万维网的地址的。现在它已经被万维网联盟编制为因特网标准RFC1738了。统一资源定位符的开始,一般会标志着一个计算机网络所使用的网络协议。Uniform Resource Locator (Uniform Resource Locator, abbreviated as URL), also known as a web page address, is a standard resource address (Address) on the Internet. Every file on the Internet has a unique URL, which contains information indicating where the file is located and what the browser should do with it. It was originally used as an address for the World Wide Web. Now it has been compiled by the World Wide Web Consortium as the Internet standard RFC1738. The beginning of a Uniform Resource Locator generally marks the network protocol used by a computer network.

TeamCity是一款功能强大的持续集成(Continue Integration)工具,包括服务器端和客户端,目前支持Java,.Net项目开发。TeamCity提供一系列特性可以快速实现持续继承:IDE工具集成、各种消息通知、各种报表、项目的管理、分布式的编译等等,能够带来效率提升和高质量的软件保障。TeamCity is a powerful Continuous Integration (Continue Integration) tool, including server-side and client-side, currently supports Java, .Net project development. TeamCity provides a series of features to quickly realize continuous inheritance: IDE tool integration, various message notifications, various reports, project management, distributed compilation, etc., which can bring about efficiency improvement and high-quality software assurance.

根据本申请的实施例,提供了一种连接处理方法。According to an embodiment of the present application, a connection processing method is provided.

图1是根据本申请实施例的连接处理方法的流程图。如图1所示,该方法包括以下步骤:Fig. 1 is a flowchart of a connection processing method according to an embodiment of the present application. As shown in Figure 1, the method includes the following steps:

步骤S101,获取代码维护工具推送的更新的代码。Step S101, acquiring updated code pushed by the code maintenance tool.

更新的代码为用于更新URL的代码,也即,当存在URL进行了更新时,获取代码维护工具推送的用于更新URL的更新的代码。The updated code is the code for updating the URL, that is, when there is an updated URL, the updated code for updating the URL pushed by the code maintenance tool is obtained.

可选地,在本申请实施例提供的连接处理方法中,获取代码维护工具推送的更新的代码包括:获取代码维护工具中推送更新的代码的函数;获取函数中的调用方法,其中,调用方法提供更新的代码,调用方法是预先配置在函数中的;以及通过调用方法获取到更新的代码。Optionally, in the connection processing method provided in the embodiment of the present application, obtaining the updated code pushed by the code maintenance tool includes: obtaining a function for pushing the updated code in the code maintenance tool; obtaining a calling method in the function, wherein calling the method The updated code is provided, and the calling method is pre-configured in the function; and the updated code is obtained by calling the method.

本申请涉及的代码维护工具可以为teamcity工具,为了获取代码维护工具推送的更新的代码,在teamcity工具中找到推送更新的代码部分的函数,获取函数中预先配置的提供更新的代码的调用方法,通过调用方法获取到更新的代码。The code maintenance tool involved in this application can be a teamcity tool. In order to obtain the updated code pushed by the code maintenance tool, find the function that pushes the updated code part in the teamcity tool, and obtain the calling method that provides the updated code pre-configured in the function. Get the updated code by calling the method.

步骤S102,调用内容分发网络提供的接口。Step S102, calling the interface provided by the content distribution network.

为了在内容分发网络上对URL自动进行刷新,调用内容分发网络提供的接口。In order to automatically refresh the URL on the CDN, an interface provided by the CDN is called.

可选地,在本申请实施例提供的连接处理方法中,调用内容分发网络提供的接口包括:通过调用方法启动配置在网页服务器上的钩子程序;以及通过钩子程序调用内容分发网络提供的接口。Optionally, in the connection processing method provided in the embodiment of the present application, invoking the interface provided by the CDN includes: starting a hook program configured on the web server by calling the method; and calling the interface provided by the CDN through the hook program.

具体地,钩子程序被部署在网页服务器上,通过上述的调用方法启动钩子程序,通过钩子程序调用内容分发网络提供的接口。需要说明的是,钩子程序被启动时可以接收一个更新的代码组成的列表,例如,url列表,钩子程序使用内容分发网络提供的接口,将url列表推送到该接口中。Specifically, the hook program is deployed on the webpage server, the hook program is started through the above calling method, and the interface provided by the CDN is called through the hook program. It should be noted that when the hook program is started, it may receive an updated code list, for example, a url list, and the hook program uses the interface provided by the CDN to push the url list to the interface.

可选地,在本申请实施例提供的连接处理方法中,通过调用方法启动配置在网页服务器上的钩子程序包括:向网页服务器推送预设文件;以及在推送预设文件之后,向网页服务器发送启动指令,其中,启动指令用于启动配置在网页服务器上的钩子程序。Optionally, in the connection processing method provided by the embodiment of the present application, starting the hook program configured on the webpage server by calling the method includes: pushing a preset file to the webpage server; and after pushing the preset file, sending A startup instruction, wherein the startup instruction is used to start the hook program configured on the web server.

例如,预设文件为css/js后缀的文件,向网页服务器推送了css/js后缀的文件,则在推送结束后立即向网页服务器发送shell命令(启动指令),该shell指令启动网页服务器上的钩子程序。For example, if the default file is a file with a css/js suffix, and the file with a css/js suffix is pushed to the web server, a shell command (startup command) is sent to the web server immediately after the push ends, and the shell command starts the web server on the web server. hook procedure.

可选地,在本申请实施例提供的连接处理方法中,启动指令是通过代码维护工具依据预设规则生成的指令。Optionally, in the connection processing method provided in the embodiment of the present application, the startup instruction is an instruction generated by a code maintenance tool according to a preset rule.

例如,shell命令(启动指令)是在teamcity端按照命名规则生成好的:钩子程序地址+refresh url列表,其中,钩子程序地址是程序内置部署好的固定地址,如,生成的shell命令如下:For example, the shell command (startup command) is generated on the teamcity side according to the naming rules: hook program address + refresh url list, where the hook program address is a fixed address deployed in the program. For example, the generated shell command is as follows:

/tmp/refresh_url.sh–list‘www.gridsum.com/1.css,www.gridsum.com/2.css...’/tmp/refresh_url.sh --list 'www.gridsum.com/1.css,www.gridsum.com/2.css...'

步骤S103,通过接口将更新的代码对应的连接在内容分发网络上进行刷新。Step S103, refresh the connection corresponding to the updated code on the content distribution network through the interface.

通过接口将更新的代码对应的连接(URL)在内容分发网络上进行刷新,具体地,当钩子程序使用内容分发网络提供的接口,将url列表推送到该接口后,内容分发网络提供的接口立刻执行url刷新操作。通过以上操作,将更新代码在内容分发网络上自动进行刷新,一旦网页服务器上存在URL进行了更新,在内容分发网络上相应的自动进行了刷新,从而提升了代码的部署效率。Refresh the link (URL) corresponding to the updated code on the content distribution network through the interface. Specifically, when the hook program uses the interface provided by the content distribution network to push the url list to the interface, the interface provided by the content distribution network immediately Perform a url refresh operation. Through the above operations, the updated code is automatically refreshed on the content distribution network. Once the URL exists on the web server and is updated, it is automatically refreshed on the content distribution network, thereby improving the efficiency of code deployment.

本申请实施例提供的连接处理方法,通过获取代码维护工具推送的更新的代码;调用内容分发网络提供的接口;以及通过接口将更新的代码对应的连接在内容分发网络上进行刷新,解决了相关技术中由于新上线的代码文件刷新速度慢,影响代码部署效率的问题。通过调用内容分发网络提供的接口将更新的代码对应的连接在内容分发网络上进行刷新,提高了更新的代码的刷新的效率,达到了提升代码部署的效率的效果。The connection processing method provided by the embodiment of the present application solves related problems by obtaining the updated code pushed by the code maintenance tool; calling the interface provided by the content distribution network; and refreshing the connection corresponding to the updated code on the content distribution network through the interface. In technology, due to the slow refresh speed of newly launched code files, it affects the efficiency of code deployment. By calling the interface provided by the content distribution network, the connection corresponding to the updated code is refreshed on the content distribution network, which improves the efficiency of refreshing the updated code and achieves the effect of improving the efficiency of code deployment.

需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。It should be noted that the steps shown in the flowcharts of the accompanying drawings may be performed in a computer system, such as a set of computer-executable instructions, and that although a logical order is shown in the flowcharts, in some cases, The steps shown or described may be performed in an order different than here.

本申请实施例还提供了一种连接处理装置,需要说明的是,本申请实施例的连接处理装置可以用于执行本申请实施例所提供的用于连接处理方法。以下对本申请实施例提供的连接处理装置进行介绍。The embodiment of the present application also provides a connection processing device. It should be noted that the connection processing device in the embodiment of the present application can be used to implement the connection processing method provided in the embodiment of the present application. The connection processing apparatus provided by the embodiment of the present application is introduced below.

图2是根据本申请实施例的连接处理装置的示意图。如图2所示,该装置包括:获取单元10、调用单元20和刷新单元30。Fig. 2 is a schematic diagram of a connection processing device according to an embodiment of the present application. As shown in FIG. 2 , the device includes: an acquiring unit 10 , a calling unit 20 and a refreshing unit 30 .

具体地,获取单元10,用于获取代码维护工具推送的更新的代码。Specifically, the acquiring unit 10 is configured to acquire the updated code pushed by the code maintenance tool.

更新的代码为用于更新URL的代码,也即,当存在URL进行了更新时,获取单元10获取代码维护工具推送的用于更新URL的更新的代码。The updated code is the code for updating the URL, that is, when there is an updated URL, the obtaining unit 10 obtains the updated code for updating the URL pushed by the code maintenance tool.

调用单元20,用于调用内容分发网络提供的接口。The calling unit 20 is configured to call the interface provided by the content distribution network.

为了在内容分发网络上对URL自动进行刷新,调用内容分发网络提供的接口。In order to automatically refresh the URL on the CDN, an interface provided by the CDN is called.

刷新单元30,用于通过接口将更新的代码对应的连接在内容分发网络上进行刷新。The refresh unit 30 is configured to refresh the connection corresponding to the updated code on the content distribution network through an interface.

刷新单元30通过接口将更新的代码对应的连接(URL)在内容分发网络上进行刷新,具体地,当钩子程序使用内容分发网络提供的接口,将url列表推送到该接口后,内容分发网络提供的接口立刻执行url刷新操作。通过以上操作,将更新代码在内容分发网络上自动进行刷新,一旦网页服务器上存在URL进行了更新,在内容分发网络上相应的自动进行了刷新,从而提升了代码的部署效率。Refresh unit 30 refreshes the connection (URL) corresponding to the updated code on the content distribution network through the interface. Specifically, when the hook program uses the interface provided by the content distribution network to push the url list to the interface, the content distribution network provides The interface immediately executes the url refresh operation. Through the above operations, the updated code is automatically refreshed on the content distribution network. Once the URL exists on the web server and is updated, it is automatically refreshed on the content distribution network, thereby improving the efficiency of code deployment.

本申请实施例提供的连接处理装置,通过获取单元10获取代码维护工具推送的更新的代码;调用单元20调用内容分发网络提供的接口;以及刷新单元30通过接口将更新的代码对应的连接在内容分发网络上进行刷新,解决了相关技术中由于新上线的代码文件刷新速度慢,影响代码部署效率的问题,通过调用内容分发网络提供的接口将更新的代码对应的连接在内容分发网络上进行刷新,提高了更新的代码的刷新的效率,达到了提升代码部署的效率的效果。The connection processing device provided in the embodiment of the present application obtains the updated code pushed by the code maintenance tool through the acquiring unit 10; the calling unit 20 calls the interface provided by the content distribution network; and the refreshing unit 30 connects the updated code correspondingly to the content through the interface Refresh on the distribution network, which solves the problem in related technologies that the refresh speed of newly launched code files is slow and affects the efficiency of code deployment. By calling the interface provided by the content distribution network, the corresponding connection of the updated code is refreshed on the content distribution network , improving the refresh efficiency of the updated code, achieving the effect of improving the efficiency of code deployment.

可选地,在本申请实施例提供的连接处理装置中,获取单元10包括:第一获取模块,用于获取代码维护工具中推送更新的代码的函数;第二获取模块,用于获取函数中的调用装置,其中,调用装置提供更新的代码,调用装置是预先配置在函数中的;以及第三获取模块,用于通过调用装置获取到更新的代码。Optionally, in the connection processing device provided in the embodiment of the present application, the acquiring unit 10 includes: a first acquiring module, used to acquire the function of pushing updated code in the code maintenance tool; a second acquiring module, used to acquire the function in the function The calling means, wherein the calling means provides the updated code, and the calling means is pre-configured in the function; and the third acquiring module is used to acquire the updated code through the calling means.

本申请涉及的代码维护工具可以为teamcity工具,为了获取代码维护工具推送的更新的代码,在teamcity工具中找到推送更新的代码部分的函数,获取函数中预先配置的提供更新的代码的调用方法,通过调用方法获取到更新的代码。The code maintenance tool involved in this application can be a teamcity tool. In order to obtain the updated code pushed by the code maintenance tool, find the function that pushes the updated code part in the teamcity tool, and obtain the calling method that provides the updated code pre-configured in the function. Get the updated code by calling the method.

可选地,在本申请实施例提供的连接处理装置中,调用单元20包括:启动模块,用于通过调用装置启动配置在网页服务器上的钩子程序;以及调用模块,用于通过钩子程序调用内容分发网络提供的接口。Optionally, in the connection processing device provided in the embodiment of the present application, the invoking unit 20 includes: an activation module, configured to activate a hook program configured on the web server through the invocation device; and an invocation module, configured to invoke content through the hook program Interface provided by the distribution network.

具体地,钩子程序被部署在网页服务器上,通过上述的调用方法启动钩子程序,通过钩子程序调用内容分发网络提供的接口。需要说明的是,钩子程序被启动时可以接收一个更新的代码组成的列表,例如,url列表,钩子程序使用内容分发网络提供的接口,将url列表推送到该接口中。Specifically, the hook program is deployed on the webpage server, the hook program is started through the above calling method, and the interface provided by the CDN is called through the hook program. It should be noted that when the hook program is started, it may receive an updated code list, for example, a url list, and the hook program uses the interface provided by the CDN to push the url list to the interface.

可选地,在本申请实施例提供的连接处理装置中,启动模块包括:推送子模块,用于向网页服务器推送预设文件;以及发送子模块,用于在推送预设文件之后,向网页服务器发送启动指令,其中,启动指令用于启动配置在网页服务器上的钩子程序。Optionally, in the connection processing device provided in the embodiment of the present application, the starting module includes: a pushing submodule, configured to push a preset file to the webpage server; and a sending submodule, configured to push the preset file to the webpage The server sends a starting instruction, wherein the starting instruction is used to start a hook program configured on the web server.

例如,预设文件为css/js后缀的文件,推送子模块向网页服务器推送了css/js后缀的文件,则在推送结束后立即向网页服务器发送shell命令(启动指令),该shell指令启动网页服务器上的钩子程序。For example, the default file is a file with a css/js suffix, and the push submodule pushes a file with a css/js suffix to the web server, then immediately after the push ends, a shell command (startup command) is sent to the web server, and the shell command starts the web page Hook program on the server.

可选地,在本申请实施例提供的连接处理装置中,启动指令是通过代码维护工具依据预设规则生成的指令。Optionally, in the connection processing apparatus provided in the embodiment of the present application, the startup instruction is an instruction generated by a code maintenance tool according to a preset rule.

例如,shell命令(启动指令)是在teamcity端按照命名规则生成好的:钩子程序地址+refresh url列表,其中,钩子程序地址是程序内置部署好的固定地址,如,生成的shell命令如下:For example, the shell command (startup command) is generated on the teamcity side according to the naming rules: hook program address + refresh url list, where the hook program address is a fixed address deployed in the program. For example, the generated shell command is as follows:

/tmp/refresh_url.sh–list‘www.gridsum.com/1.css,www.gridsum.com/2.css.../tmp/refresh_url.sh --list 'www.gridsum.com/1.css,www.gridsum.com/2.css...

所述连接处理装置包括处理器和存储器,上述获取单元10、调用单元20和刷新单元30等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元实现相应功能。上述预设规则、预设文件都可以存储在存储器中。The connection processing device includes a processor and a memory. The acquiring unit 10, calling unit 20, and refreshing unit 30 are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions. Both the preset rules and preset files mentioned above can be stored in the memory.

处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数处理连接。The processor includes a kernel, and the kernel fetches corresponding program units from the memory. The kernel can set one or more, and handle connections by adjusting kernel parameters.

存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。Memory may include non-permanent memory in computer-readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory includes at least one memory chip.

本申请还提供了一种计算机程序产品的实施例,当在数据处理设备上执行时,适于执行初始化有如下方法步骤的程序代码:获取代码维护工具推送的更新的代码;调用内容分发网络提供的接口;以及通过接口将更新的代码对应的连接在内容分发网络上进行刷新。The present application also provides an embodiment of a computer program product, which, when executed on a data processing device, is suitable for executing a program code initialized with the following method steps: acquiring updated code pushed by a code maintenance tool; calling the content distribution network provided interface; and refresh the connection corresponding to the updated code on the CDN through the interface.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Depending on the application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by this application.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or can be Integrate into another system, or some features may be ignored, or not implemented.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that each module or each step of the above-mentioned application can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network composed of multiple computing devices Optionally, they can be implemented with program codes executable by a computing device, so that they can be stored in a storage device and executed by a computing device, or they can be made into individual integrated circuit modules, or they can be integrated into Multiple modules or steps are fabricated into a single integrated circuit module to realize. As such, the present application is not limited to any specific combination of hardware and software.

以上所述仅为本申请的优选实施例,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the present application. For those skilled in the art, there may be various modifications and changes in the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application shall be included within the protection scope of this application.

Claims (10)

1. a kind of connection processing method, which is characterized in that including:
Obtain the newer code of code maintenance instrument push;
The interface that content distributing network is called to provide;And
Corresponding be connected on the content distributing network of the newer code is refreshed by the interface.
2. according to the method described in claim 1, it is characterized in that, obtain the newer code bag of code maintenance instrument push It includes:
Obtain the function that the newer code is pushed in the code maintenance instrument;
The call method in the function is obtained, wherein, the call method provides the newer code, the call method It is pre-configured in the function;And
The newer code is got by the call method.
3. according to the method described in claim 2, it is characterized in that, the interface that content distributing network provides is called to include:
Hook program of the configuration on web page server is started by the call method;And
The interface of the content distributing network offer is provided by the hook program.
4. according to the method described in claim 3, it is characterized in that, configuration is started in web page server by the call method On hook program include:
Default file is pushed to web page server;And
After the default file is pushed, enabled instruction is sent to web page server, wherein, the enabled instruction is used to start Configure the hook program on web page server.
5. according to the method described in claim 4, it is characterized in that, the enabled instruction be by the code maintenance instrument according to The instruction generated according to preset rules.
6. a kind of connection processing device, which is characterized in that including:
Acquiring unit, for obtaining the newer code of code maintenance instrument push;
Call unit, for calling the interface that content distributing network provides;And
Refresh unit, for passing through the interface, by the newer code, corresponding to be connected to the content distributing network enterprising Row refreshes.
7. device according to claim 6, which is characterized in that the acquiring unit includes:
First acquisition module, for obtaining the function that the newer code is pushed in the code maintenance instrument;
Second acquisition module, for obtaining the calling device in the function, wherein, the calling device provides described newer Code, the calling device are pre-configured in the function;And
3rd acquisition module gets the newer code for passing through the calling device.
8. device according to claim 7, which is characterized in that the call unit includes:
Starting module, for starting hook program of the configuration on web page server by the calling device;And
Calling module, for calling the interface of the content distributing network offer by the hook program.
9. device according to claim 8, which is characterized in that the starting module includes:
Submodule is pushed, for pushing default file to web page server;And
Sending submodule, for after the default file is pushed, enabled instruction to be sent to web page server, wherein, it is described Hook program of the enabled instruction for startup configuration on web page server.
10. device according to claim 9, which is characterized in that the enabled instruction is by the code maintenance instrument Instruction according to preset rules generation.
CN201611042678.1A 2016-11-23 2016-11-23 Connection processing method and device Expired - Fee Related CN108111551B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611042678.1A CN108111551B (en) 2016-11-23 2016-11-23 Connection processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611042678.1A CN108111551B (en) 2016-11-23 2016-11-23 Connection processing method and device

Publications (2)

Publication Number Publication Date
CN108111551A true CN108111551A (en) 2018-06-01
CN108111551B CN108111551B (en) 2021-05-14

Family

ID=62203642

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611042678.1A Expired - Fee Related CN108111551B (en) 2016-11-23 2016-11-23 Connection processing method and device

Country Status (1)

Country Link
CN (1) CN108111551B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1489333A (en) * 2002-10-10 2004-04-14 华为技术有限公司 Method for Content Refresh in Content Delivery Network
US6871324B2 (en) * 2001-05-25 2005-03-22 International Business Machines Corporation Method and apparatus for efficiently and dynamically updating monitored metrics in a heterogeneous system
CN102622241A (en) * 2011-01-26 2012-08-01 腾讯科技(深圳)有限公司 Software upgrading method and software upgrading device
CN103338272A (en) * 2013-07-23 2013-10-02 星云融创(北京)信息技术有限公司 Content distribution network and cache implementation method thereof
CN103685551A (en) * 2013-12-25 2014-03-26 乐视网信息技术(北京)股份有限公司 Method and device for updating CDN (content delivery network) cache files
CN104662516A (en) * 2012-07-27 2015-05-27 谷歌公司 Messaging between web applications
CN105808304A (en) * 2016-03-29 2016-07-27 北京小米移动软件有限公司 Code deployment method, device and system
CN105868234A (en) * 2015-12-07 2016-08-17 乐视云计算有限公司 Update method and device of caching data
CN105893073A (en) * 2015-12-11 2016-08-24 乐视网信息技术(北京)股份有限公司 Update method and system used for application program, and business server and pushing server used for updating application program

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6871324B2 (en) * 2001-05-25 2005-03-22 International Business Machines Corporation Method and apparatus for efficiently and dynamically updating monitored metrics in a heterogeneous system
CN1489333A (en) * 2002-10-10 2004-04-14 华为技术有限公司 Method for Content Refresh in Content Delivery Network
CN102622241A (en) * 2011-01-26 2012-08-01 腾讯科技(深圳)有限公司 Software upgrading method and software upgrading device
CN104662516A (en) * 2012-07-27 2015-05-27 谷歌公司 Messaging between web applications
CN103338272A (en) * 2013-07-23 2013-10-02 星云融创(北京)信息技术有限公司 Content distribution network and cache implementation method thereof
CN103685551A (en) * 2013-12-25 2014-03-26 乐视网信息技术(北京)股份有限公司 Method and device for updating CDN (content delivery network) cache files
CN105868234A (en) * 2015-12-07 2016-08-17 乐视云计算有限公司 Update method and device of caching data
CN105893073A (en) * 2015-12-11 2016-08-24 乐视网信息技术(北京)股份有限公司 Update method and system used for application program, and business server and pushing server used for updating application program
CN105808304A (en) * 2016-03-29 2016-07-27 北京小米移动软件有限公司 Code deployment method, device and system

Also Published As

Publication number Publication date
CN108111551B (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN106489145B (en) Access method, device and the Web site system of web site
TWI682653B (en) Short link analysis method, device and equipment
CN105389191B (en) A kind of method for upgrading software based on LAN, device and system
US8527862B2 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
CN113886743B (en) Method, device and system for refreshing cache resources
CN103678508A (en) Method and device for opening a webpage
US10574724B2 (en) Automatic discovery of management nodes and generation of CLI using HA module
CN106933890A (en) A kind of processing method and processing device of static page
CN112565406A (en) Gray scale publishing method, gray scale publishing system and electronic equipment
US10506400B2 (en) Data download method and apparatus
WO2013123833A1 (en) File sharing method and system
CN107315972A (en) A kind of dynamic desensitization method of big data unstructured document and system
CN111079048A (en) Page loading method and device
AU2015369925A1 (en) Computer readable storage media for dynamic service deployment and methods and systems for utilizing same
CN114385124A (en) Jumping method, device and device for independent page based on Vue framework
O'Sullivan et al. The cloud personal assistant for providing services to mobile clients
CN112926002A (en) Service request processing method and device
CN108509243A (en) The method, apparatus and electronic equipment of a kind of page load in application
US12028434B2 (en) Generating early hints informational responses at an intermediary server
EP2850809B1 (en) Providing data to a network terminal
CN103793459B (en) A method and device for opening a web page
CN108111551A (en) Connection processing method and device
CN104468832B (en) A kind of light distributed structure/architecture based on http agreements
CN105224573B (en) A method, device and system for configuring rule data
CN115454418A (en) Method and device for sharing front-end code, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210514

CF01 Termination of patent right due to non-payment of annual fee