[go: up one dir, main page]

CN106202187A - The method and apparatus that a kind of short chain of process in a browser connects - Google Patents

The method and apparatus that a kind of short chain of process in a browser connects Download PDF

Info

Publication number
CN106202187A
CN106202187A CN201610482137.4A CN201610482137A CN106202187A CN 106202187 A CN106202187 A CN 106202187A CN 201610482137 A CN201610482137 A CN 201610482137A CN 106202187 A CN106202187 A CN 106202187A
Authority
CN
China
Prior art keywords
link
short
long
links
long link
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.)
Pending
Application number
CN201610482137.4A
Other languages
Chinese (zh)
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 Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610482137.4A priority Critical patent/CN106202187A/en
Publication of CN106202187A publication Critical patent/CN106202187A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9558Details of hyperlinks; Management of linked annotations
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供一种在浏览器中处理短链接的方法和装置。本发明的在浏览器中处理短链接的方法,包括:接收短链接;根据预定的映射关系确定所述短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,其中,所述预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。

The invention provides a method and device for processing short links in a browser. The method for processing short links in a browser of the present invention includes: receiving a short link; determining a long link corresponding to the short link according to a predetermined mapping relationship, and loading a corresponding page according to the long link when there is a corresponding long link , wherein the predetermined mapping relationship defines the corresponding relationship between short links and long links, and the short links are associated with their corresponding long links through indexes.

Description

一种在浏览器中处理短链接的方法和装置Method and device for processing short links in browser

技术领域technical field

本发明涉及计算机和计算机软件技术领域,特别地涉及一种在浏览器中处理短链接的方法和装置。The invention relates to the technical field of computers and computer software, in particular to a method and device for processing short links in a browser.

背景技术Background technique

在时下的互联网开发中,在基于用户原创内容UGC(User Generated Content)或基于位置服务LBS(Location Based Service)的web或移动端产品的内容中多见超链接(又叫长链接)。但是,大多数超链接的字符长度过长且明文显示,不利于传输安全和数据存储,同时也不利于搜索引擎的抓取,继而影响到搜索引擎优化SEO(Search EngineOptimization)。In the current Internet development, hyperlinks (also known as long links) are often seen in the content of web or mobile products based on user-generated content UGC (User Generated Content) or location-based service LBS (Location Based Service). However, the character length of most hyperlinks is too long and displayed in plain text, which is not conducive to transmission security and data storage, and is also not conducive to crawling by search engines, which in turn affects Search Engine Optimization (SEO).

为了解决上述的问题,大部分的开发团队是通过使用命名规则以促使链接尽可能地缩短,但是链接的长度仍不能满足最优化要求。另外,以百度云盘等为代表的较多平台,采用的多为服务端脚本实现的域名系统DNS(Domain Name System)重定向的方案,其对服务端的拦截和解析能力较为依赖。并且,现有的方案在对超链接进行重定向时,会直接跳转至新请求的页面,因此会有突兀感。In order to solve the above problems, most development teams use naming rules to shorten the link as much as possible, but the length of the link still cannot meet the optimization requirements. In addition, many platforms represented by Baidu cloud disk, etc., mostly adopt the domain name system DNS (Domain Name System) redirection scheme implemented by server-side scripts, which is more dependent on the interception and resolution capabilities of the server. Moreover, when the existing solution redirects the hyperlink, it will directly jump to the newly requested page, so there will be a sense of abruptness.

根据前述的描述可以看出,伴随着超链接的逐步增多,为现有的web或移动端产品带来了极大的不便,主要表现在:According to the foregoing description, it can be seen that with the gradual increase of hyperlinks, it brings great inconvenience to existing web or mobile products, mainly in the following areas:

1、链接在传输过程中明文,且过长;1. The link is in plain text during transmission and is too long;

2、过长的链接不利于搜索引擎抓取;2. Too long links are not conducive to search engine crawling;

3、过长的链接不利于数据存储和读取的高效进行;3. Too long links are not conducive to efficient data storage and reading;

4、过于依赖服务端脚本及DNS重定向解析;4. Too much reliance on server-side scripts and DNS redirection analysis;

5、短链接在加载并重定向过程中,页面会有突兀感。5. When the short link is loaded and redirected, the page will feel abrupt.

发明内容Contents of the invention

有鉴于此,本发明提供一种在浏览器中处理短链接的方法和装置,能够解决链接在传输过程因字符串过长造成的效率低下和在存储环节中因过长造成的读写性能低下问题,提高了传输环节的安全性,避免了链接在变化跳转时的过多等待和用户体验上的突兀感。In view of this, the present invention provides a method and device for processing short links in a browser, which can solve the problem of inefficiency caused by too long character strings in the link transmission process and low read and write performance caused by too long strings in the storage link. Problems, improve the security of the transmission link, avoid excessive waiting when the link changes and jumps and the abruptness of the user experience.

为实现上述目的,根据本发明的一个方面,提供了一种在浏览器中处理短链接的方法。To achieve the above purpose, according to one aspect of the present invention, a method for processing short links in a browser is provided.

一种在浏览器中处理短链接的方法,包括:接收短链接;根据预定的映射关系确定所述短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,其中,所述预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。A method for processing short links in a browser, comprising: receiving a short link; determining a long link corresponding to the short link according to a predetermined mapping relationship, and loading a corresponding page according to the long link when there is a corresponding long link, Wherein, the predetermined mapping relationship defines the corresponding relationship between the short link and the long link, and the short link is associated with its corresponding long link through an index.

可选地,当针对接收的短链接,不存在对应的长链接,则显示报错页面或保持先前加载的页面。Optionally, when there is no corresponding long link for the received short link, display an error page or keep the previously loaded page.

可选地,在根据预定的映射关系确定所述短链接对应的长链接的过程中向用户发出提示。Optionally, a prompt is issued to the user during the process of determining the long link corresponding to the short link according to the predetermined mapping relationship.

可选地,对于一给定的长链接,其对应的短链接是该长链接的哈希值,所述哈希值通过给定的哈希函数获得。Optionally, for a given long link, its corresponding short link is a hash value of the long link, and the hash value is obtained through a given hash function.

可选地,所述短链接和所述长链接及其映射关系被存储到数据库。Optionally, the short link and the long link and their mapping relationship are stored in a database.

可选地,所述短链接和所述长链接及其映射关系被存储到数据库时,通过MD5进行加密处理。Optionally, when the short link and the long link and their mapping relationship are stored in the database, they are encrypted by MD5.

根据本发明的另一方面,提供了一种在浏览器中处理短链接的装置。According to another aspect of the present invention, a device for processing short links in a browser is provided.

一种在浏览器中处理短链接的装置,包括:短链接接收模块,用于接收短链接;短链接处理模块,用于根据预定的映射关系确定所述短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,其中,所述预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。A device for processing short links in a browser, comprising: a short link receiving module, configured to receive a short link; a short link processing module, configured to determine a long link corresponding to the short link according to a predetermined mapping relationship, when there is a corresponding The corresponding long link is loaded according to the long link, wherein the predetermined mapping relationship defines the corresponding relationship between the short link and the long link, and the short link is associated with its corresponding long link through the index.

可选地,当针对接收的短链接,不存在对应的长链接,则显示报错页面或保持先前加载的页面。Optionally, when there is no corresponding long link for the received short link, display an error page or keep the previously loaded page.

可选地,还包括:提示模块,用于在根据预定的映射关系确定所述短链接对应的长链接的过程中向用户发出提示。Optionally, it further includes: a prompt module, configured to send a prompt to the user during the process of determining the long link corresponding to the short link according to the predetermined mapping relationship.

可选地,对于一给定的长链接,其对应的短链接是该长链接的哈希值,所述哈希值通过给定的哈希函数获得。Optionally, for a given long link, its corresponding short link is a hash value of the long link, and the hash value is obtained through a given hash function.

可选地,所述短链接和所述长链接及其映射关系被存储到数据库。Optionally, the short link and the long link and their mapping relationship are stored in a database.

可选地,所述短链接和所述长链接及其映射关系被存储到数据库时,通过MD5进行加密处理。Optionally, when the short link and the long link and their mapping relationship are stored in the database, they are encrypted by MD5.

根据本发明的又一方面,提供了一种在浏览器中处理短链接的装置。According to yet another aspect of the present invention, a device for processing short links in a browser is provided.

一种在浏览器中处理短链接的装置,包括:存储器和处理器,其中,所述存储器存储指令;所述处理器执行所述指令用于:接收短链接;根据预定的映射关系确定所述短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,其中,所述预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。A device for processing short links in a browser, comprising: a memory and a processor, wherein the memory stores instructions; the processor executes the instructions to: receive short links; determine the The long link corresponding to the short link, when there is a corresponding long link, load the corresponding page according to the long link, wherein the predetermined mapping relationship defines the corresponding relationship between the short link and the long link, and the short link is associated to Its corresponding long link.

根据本发明的技术方案,通过将长链接加工处理成符合条件的短链接,并根据短链接查找并访问对应的长链接,可以解决链接在传输过程因字符串过长造成的效率低下和在存储环节中因过长而造成的读写性能低下问题。本发明中,根据预定的规则,通过哈希散列算法对任意目标长链接进行短链接的加工生产,并将长链接、短链接及其映射关系存储到数据存储模块中,并且在数据存储时,还可以预先使用MD5算法进行加密处理,最后通过中间页面进行链接的精准重定向,既提高了传输环节的安全性,同时利于搜索引擎抓取,并且避免了链接在变化跳转时的过多等待和用户体验上的突兀感。According to the technical solution of the present invention, by processing the long links into qualified short links, and searching and accessing the corresponding long links according to the short links, it is possible to solve the problem of inefficiency caused by too long character strings in the link transmission process and the problems in storage. The problem of low read and write performance caused by too long links in the link. In the present invention, according to a predetermined rule, a hash hash algorithm is used to process and produce a short link for any target long link, and store the long link, short link and their mapping relationship in the data storage module, and when the data is stored , you can also use the MD5 algorithm for encryption in advance, and finally carry out precise redirection of the link through the intermediate page, which not only improves the security of the transmission link, but also facilitates search engine crawling, and avoids excessive links when they change and jump Waiting and abruptness in the user experience.

附图说明Description of drawings

附图用于更好地理解本发明,不构成对本发明的不当限定。其中:The accompanying drawings are used to better understand the present invention, and do not constitute improper limitations to the present invention. in:

图1是根据本发明实施例的在浏览器中处理短链接的方法的主要步骤示意图;FIG. 1 is a schematic diagram of main steps of a method for processing short links in a browser according to an embodiment of the present invention;

图2是根据本发明实施例的系统架构图;Fig. 2 is a system architecture diagram according to an embodiment of the present invention;

图3是根据本发明实施例的实现流程示意图;FIG. 3 is a schematic diagram of an implementation process according to an embodiment of the present invention;

图4是本发明一个具体实施例的实现过程示意图;Fig. 4 is a schematic diagram of the implementation process of a specific embodiment of the present invention;

图5是根据本发明一个实施例的在浏览器中处理短链接的装置的主要模块示意图;FIG. 5 is a schematic diagram of main modules of a device for processing short links in a browser according to an embodiment of the present invention;

图6是根据本发明另一实施例的在浏览器中处理短链接的装置的主要模块示意图。Fig. 6 is a schematic diagram of main modules of an apparatus for processing short links in a browser according to another embodiment of the present invention.

具体实施方式detailed description

以下结合附图对本发明的示范性实施例做出说明,其中包括本发明实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本发明的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

图1是根据本发明实施例的在浏览器中处理短链接的方法的主要步骤示意图。如图1所示,本发明的在浏览器中处理短链接的方法主要包括如下的步骤S11至步骤S12。Fig. 1 is a schematic diagram of main steps of a method for processing short links in a browser according to an embodiment of the present invention. As shown in FIG. 1 , the method for processing short links in a browser of the present invention mainly includes the following steps S11 to S12.

步骤S11:接收短链接;Step S11: receiving the short link;

步骤S12:根据预定的映射关系确定短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,其中,预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。Step S12: Determine the long link corresponding to the short link according to the predetermined mapping relationship, and when there is a corresponding long link, load the corresponding page according to the long link, wherein the predetermined mapping relationship defines the corresponding relationship between the short link and the long link, And the short link is associated with its corresponding long link through the index.

根据本发明的技术方案,当针对接收的短链接,不存在对应的长链接,则显示报错页面或保持先前加载的页面。According to the technical solution of the present invention, when there is no corresponding long link for the received short link, an error page is displayed or the previously loaded page is kept.

并且,在根据预定的映射关系确定所述短链接对应的长链接的过程中向用户发出提示。And, a prompt is issued to the user during the process of determining the long link corresponding to the short link according to the predetermined mapping relationship.

其中,对于一给定的长链接,其对应的短链接是该长链接的哈希值,所述哈希值通过给定的哈希函数获得。所述短链接和所述长链接及其映射关系被存储到数据库。Wherein, for a given long link, its corresponding short link is a hash value of the long link, and the hash value is obtained through a given hash function. The short link and the long link and their mapping relationship are stored in a database.

此外,所述短链接和所述长链接及其映射关系被存储到数据库时,通过MD5进行加密处理。In addition, when the short link and the long link and their mapping relationship are stored in the database, they are encrypted by MD5.

图2是根据本发明实施例的系统架构图。为了解决链接在传输过程因字符串过长造成的效率低下和在存储环节中因过长而造成的读写性能低下问题,本发明将长链接加工处理成符合条件的短链接,并根据短链接查找并访问对应的长链接。如图2所示,本发明实施例的系统主要包括:短链接加工模块、短链接分转模块、加解密模块和Redis模块。下面介绍各个模块的功能实现。Fig. 2 is a system architecture diagram according to an embodiment of the present invention. In order to solve the problem of low efficiency caused by too long strings in the transmission process and low read and write performance caused by too long strings in the storage link, the present invention processes long links into qualified short links, and according to the short link Find and visit the corresponding long link. As shown in FIG. 2 , the system of the embodiment of the present invention mainly includes: a short link processing module, a short link distribution module, an encryption and decryption module, and a Redis module. The function implementation of each module is introduced below.

短链接加工模块:基于预定的算法,例如哈希(散列)算法将长链接转换和生产为满足预设要求的短链接,从而将长链接和生成的短链接建立一一对应的映射关系。然后,为生成的短链接建立映射索引,并将短链接与长链接和两者的映射关系存储到数据存储模块。同时,该模块还可以负责完成根据短链接索引出长链接的工作。Short link processing module: Based on a predetermined algorithm, such as a hash (hash) algorithm, the long link is converted and produced into a short link that meets the preset requirements, thereby establishing a one-to-one mapping relationship between the long link and the generated short link. Then, a mapping index is established for the generated short link, and the short link and long link and their mapping relationship are stored in the data storage module. At the same time, this module can also be responsible for completing the work of indexing long links based on short links.

短链接分转模块:该模块可被实现为一个中转页面,通过执行查询脚本,向数据存储模块发起询问,并获取精准查询并匹配的长链接以进行加载。同时,该模块在加载长链接的过程中会予以用户提示(例如“正在进行页面跳转,请等待”)并告知系统正在匹配跳转。如此,即可克服由于页面的突然跳转所带来的突兀感。Short link transfer module: This module can be implemented as a transfer page, by executing query scripts, inquiring about the data storage module, and obtaining precise query and matching long links for loading. At the same time, the module will prompt the user during the process of loading the long link (such as "the page is jumping, please wait") and inform the system that the jump is being matched. In this way, the abrupt feeling caused by the sudden jump of the page can be overcome.

加解密模块:为了保证短链接和长链接的安全性,在上述的存储和读写过程中,还可以使用MD5对短链接和长链接进行加解密的处理,从而可以避免出现明文字符链接。Encryption and decryption module: In order to ensure the security of short links and long links, in the above storage and reading and writing process, MD5 can also be used to encrypt and decrypt short links and long links, so as to avoid plaintext character links.

数据存储模块,可使用的数据库例如:Redis、SQL server、MySQL或MongoDB等,以用于数据的存储和读写,以便将长链接与生成的短链接建立映射索引,并将短链接与长链接进行存储。同时该模块也负责配合完成根据短链接索引出长链接的工作。Data storage module, databases such as Redis, SQL server, MySQL or MongoDB can be used for data storage and reading and writing, so as to establish a mapping index between long links and generated short links, and link short links and long links to store. At the same time, this module is also responsible for cooperating with the task of indexing long links based on short links.

图3是根据本发明实施例的实现流程示意图。如图3所示,短链接加工模块根据预定的规则,通过哈希散列算法对任意目标长链接进行短链接的加工生产,并将长链接、短链接及其映射关系存储到数据存储模块(例如:Redis)中,在数据存储时,还可以预先使用MD5算法进行加密处理。Fig. 3 is a schematic diagram of an implementation process according to an embodiment of the present invention. As shown in Figure 3, the short link processing module performs short link processing and production on any target long link through a hash algorithm according to predetermined rules, and stores the long link, short link and their mapping relationship in the data storage module ( For example: in Redis), when data is stored, the MD5 algorithm can also be used for encryption in advance.

当浏览器通过HTTP请求或HTTPS请求访问短链接时,浏览器即开始加载该特定的短链接,待加载完毕后,即显示为短链接分转页面。When the browser accesses the short link through an HTTP request or HTTPS request, the browser starts to load the specific short link, and after the loading is complete, it will be displayed as a short link transfer page.

短链接分转页面,在短链加载完成后,会提示用户正在前往目标资源。此时,短链接分转页面中的JS脚本开始向数据存储模块(例如:Redis)发起询问,数据存储模块根据短链接尝试索引对应的长链接。如果索引到有效的长链接,则将目标长链接返回至短链接分转页面,以便短链接分转页面可以根据返回的长链接再次进行加载,并在加载完成后显示长链接对应的页面内容;如果未能索引到有效的长链接,则可能包含如下两种情况:The short link transfers to the page. After the short link is loaded, the user will be prompted to go to the target resource. At this time, the JS script in the short link transfer page starts to query the data storage module (for example: Redis), and the data storage module tries to index the corresponding long link according to the short link. If a valid long link is indexed, return the target long link to the short link transfer page, so that the short link transfer page can be loaded again according to the returned long link, and display the page content corresponding to the long link after loading; If a valid long link cannot be indexed, it may include the following two situations:

情况1、该短链接为初始化打开的短连接,也就是浏览器之前并无其他加载内容,此时会给用户展示一个错误页面,提示资源找不到,稍后重试;Situation 1. The short link is a short link opened by initialization, that is, the browser has no other loaded content before. At this time, an error page will be displayed to the user, prompting that the resource cannot be found, and try again later;

情况2、如果是浏览器本身就有一些页面加载,通过点击了某一个按钮触发了这个短链接继而有映射动作,但未能从数据存储模块中索引到有效链接,则保持浏览器之前加载的页面不变,也就是浏览器不做跳转。Situation 2. If the browser itself has some pages loaded, the short link is triggered by clicking a certain button and then there is a mapping action, but the valid link cannot be indexed from the data storage module, then keep the previous loaded by the browser The page remains unchanged, that is, the browser does not jump.

图4是本发明一个具体实施例的实现过程示意图。如图4所示,当通过浏览器访问短链接,如short.abc.com/atf时,浏览器会将该短链接对应的页面加载并显示,之后,短链接分转模块将根据该短链接从数据存储模块Redis中检索对应的长链接,例如可以检索到对应的长链接为:http://abc.ef.com/qwer5678%2344hkfkf。则将检索到的长链接返回至短链接分转页面,以加载对应的内容并显示。如此,即可通过中间页面的查询,实现精准重定向。Fig. 4 is a schematic diagram of an implementation process of a specific embodiment of the present invention. As shown in Figure 4, when a short link is accessed through a browser, such as short.abc.com/atf, the browser will load and display the page corresponding to the short link, and then the short link distribution module will The corresponding long link is retrieved from the data storage module Redis, for example, the corresponding long link can be retrieved as: http://abc.ef.com/qwer5678%2344hkfkf. Then return the retrieved long link to the short link transfer page to load and display the corresponding content. In this way, precise redirection can be achieved through the query of the intermediate page.

本发明的方案可同时适用于PC/iOS/Android系统下的web浏览器应用中,同时,降低了开发者对长链接存储时对数据库的开销,提高了存储时的便捷性,对链接传播时的安全存储以及搜索引擎友好性带来的极大提升。The scheme of the present invention can be applied to web browser applications under PC/iOS/Android systems at the same time, and at the same time, it reduces the developer's overhead on the database when storing long links, improves the convenience of storage, and improves the convenience of link propagation. The secure storage and search engine friendliness have greatly improved.

图5是根据本发明一个实施例的在浏览器中处理短链接的装置的主要模块示意图。如图5所示,本发明的在浏览器中处理短链接的装置50主要包括短链接接收模块51和短链接处理模块52。Fig. 5 is a schematic diagram of main modules of an apparatus for processing short links in a browser according to an embodiment of the present invention. As shown in FIG. 5 , the device 50 for processing short links in a browser of the present invention mainly includes a short link receiving module 51 and a short link processing module 52 .

短链接接收模块51用于接收短链接;短链接处理模块52用于根据预定的映射关系确定所述短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,其中,所述预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。The short link receiving module 51 is used to receive the short link; the short link processing module 52 is used to determine the long link corresponding to the short link according to a predetermined mapping relationship, and when there is a corresponding long link, load the corresponding page according to the long link, Wherein, the predetermined mapping relationship defines the corresponding relationship between the short link and the long link, and the short link is associated with its corresponding long link through an index.

根据本发明的技术方案,当针对接收的短链接,不存在对应的长链接,则显示报错页面或保持先前加载的页面。According to the technical solution of the present invention, when there is no corresponding long link for the received short link, an error page is displayed or the previously loaded page is kept.

另外,本发明的在浏览器中处理短链接的装置50还可以包括提示模块,用于在根据预定的映射关系确定所述短链接对应的长链接的过程中向用户发出提示。In addition, the apparatus 50 for processing short links in the browser of the present invention may further include a prompt module, configured to send prompts to the user during the process of determining the long link corresponding to the short link according to the predetermined mapping relationship.

其中,对于一给定的长链接,其对应的短链接是该长链接的哈希值,所述哈希值通过给定的哈希函数获得。所述短链接和所述长链接及其映射关系被存储到数据库。Wherein, for a given long link, its corresponding short link is a hash value of the long link, and the hash value is obtained through a given hash function. The short link and the long link and their mapping relationship are stored in a database.

并且,所述短链接和所述长链接及其映射关系被存储到数据库时,通过MD5进行加密处理。Moreover, when the short link and the long link and their mapping relationship are stored in the database, they are encrypted by MD5.

图6是根据本发明另一实施例的在浏览器中处理短链接的装置的主要模块示意图。如图6所示,本发明的在浏览器中处理短链接的装置60主要包括存储器61和处理器62。Fig. 6 is a schematic diagram of main modules of an apparatus for processing short links in a browser according to another embodiment of the present invention. As shown in FIG. 6 , the device 60 for processing short links in a browser of the present invention mainly includes a memory 61 and a processor 62 .

其中,存储器61用于存储指令;处理器62执行所述指令用于:接收短链接;根据预定的映射关系确定所述短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,其中,所述预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。Among them, the memory 61 is used to store instructions; the processor 62 executes the instructions to: receive a short link; determine the long link corresponding to the short link according to a predetermined mapping relationship, and when there is a corresponding long link, then according to the long link The corresponding page is loaded, wherein the predetermined mapping relationship defines the corresponding relationship between the short link and the long link, and the short link is associated with its corresponding long link through the index.

根据本发明实施例的技术方案,通过将长链接加工处理成符合条件的短链接,并根据短链接查找并访问对应的长链接,可以解决链接在传输过程因字符串过长造成的效率低下和在存储环节中因过长而造成的读写性能低下问题。本发明中,根据预定的规则,通过哈希散列算法对任意目标长链接进行短链接的加工生产,并将长链接、短链接及其映射关系存储到数据存储模块中,并且在数据存储时,还可以预先使用MD5算法进行加密处理,最后通过中间页面进行链接的精准重定向,既提高了传输环节的安全性,同时利于搜索引擎抓取,并且避免了链接在变化跳转时的过多等待和用户体验上的突兀感。According to the technical solution of the embodiment of the present invention, by processing the long link into a short link that meets the conditions, and searching and accessing the corresponding long link according to the short link, the inefficiency and the inefficiency caused by the string being too long during the link transmission process can be solved. In the storage link, the problem of low read and write performance caused by too long. In the present invention, according to a predetermined rule, a hash hash algorithm is used to process and produce a short link for any target long link, and store the long link, short link and their mapping relationship in the data storage module, and when the data is stored , you can also use the MD5 algorithm for encryption in advance, and finally carry out precise redirection of the link through the intermediate page, which not only improves the security of the transmission link, but also facilitates search engine crawling, and avoids excessive links when they change and jump Waiting and abruptness in the user experience.

上述具体实施方式,并不构成对本发明保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明保护范围之内。The above specific implementation methods do not constitute a limitation to the protection scope of the present invention. It should be apparent to those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (13)

1.一种在浏览器中处理短链接的方法,其特征在于,包括:1. A method for processing short links in a browser, comprising: 接收短链接;Receive a short link; 根据预定的映射关系确定所述短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,Determine the long link corresponding to the short link according to a predetermined mapping relationship, and when there is a corresponding long link, load the corresponding page according to the long link, 其中,所述预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。Wherein, the predetermined mapping relationship defines the corresponding relationship between the short link and the long link, and the short link is associated with its corresponding long link through an index. 2.根据权利要求1所述的方法,其特征在于,当针对接收的短链接,不存在对应的长链接,则显示报错页面或保持先前加载的页面。2. The method according to claim 1, wherein when there is no corresponding long link for the received short link, an error page is displayed or a previously loaded page is maintained. 3.根据权利要求1所述的方法,其特征在于,在根据预定的映射关系确定所述短链接对应的长链接的过程中向用户发出提示。3. The method according to claim 1, characterized in that, during the process of determining the long link corresponding to the short link according to the predetermined mapping relationship, a prompt is issued to the user. 4.根据权利要求1所述的方法,其特征在于,对于一给定的长链接,其对应的短链接是该长链接的哈希值,所述哈希值通过给定的哈希函数获得。4. The method according to claim 1, characterized in that, for a given long link, its corresponding short link is the hash value of the long link, and the hash value is obtained by a given hash function . 5.根据权利要求1所述的方法,其特征在于,所述短链接和所述长链接及其映射关系被存储到数据库。5. The method according to claim 1, wherein the short link and the long link and their mapping relationship are stored in a database. 6.根据权利要求5所述的方法,其特征在于,所述短链接和所述长链接及其映射关系被存储到数据库时,通过MD5进行加密处理。6. The method according to claim 5, characterized in that, when the short link and the long link and their mapping relationship are stored in the database, they are encrypted by MD5. 7.一种在浏览器中处理短链接的装置,其特征在于,包括:7. A device for processing short links in a browser, comprising: 短链接接收模块,用于接收短链接;A short link receiving module, configured to receive a short link; 短链接处理模块,用于根据预定的映射关系确定所述短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,其中,所述预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。A short link processing module, configured to determine a long link corresponding to the short link according to a predetermined mapping relationship, and load a corresponding page according to the long link when there is a corresponding long link, wherein the predetermined mapping relationship defines a short link The corresponding relationship between links and long links, and the short links are associated with their corresponding long links through the index. 8.根据权利要求7所述的装置,其特征在于,当针对接收的短链接,不存在对应的长链接,则显示报错页面或保持先前加载的页面。8. The device according to claim 7, wherein, when there is no corresponding long link for the received short link, an error page is displayed or a previously loaded page is kept. 9.根据权利要求7所述的装置,其特征在于,还包括:提示模块,用于9. The device according to claim 7, further comprising: a prompt module for 在根据预定的映射关系确定所述短链接对应的长链接的过程中向用户发出提示。A prompt is issued to the user during the process of determining the long link corresponding to the short link according to the predetermined mapping relationship. 10.根据权利要求7所述的装置,其特征在于,对于一给定的长链接,其对应的短链接是该长链接的哈希值,所述哈希值通过给定的哈希函数获得。10. The device according to claim 7, characterized in that, for a given long link, its corresponding short link is the hash value of the long link, and the hash value is obtained by a given hash function . 11.根据权利要求7所述的装置,其特征在于,所述短链接和所述长链接及其映射关系被存储到数据库。11. The device according to claim 7, wherein the short link and the long link and their mapping relationship are stored in a database. 12.根据权利要求11所述的装置,其特征在于,所述短链接和所述长链接及其映射关系被存储到数据库时,通过MD5进行加密处理。12. The device according to claim 11, wherein when the short link and the long link and their mapping relationship are stored in the database, encryption processing is performed by MD5. 13.一种在浏览器中处理短链接的装置,其特征在于,包括:13. A device for processing short links in a browser, comprising: 存储器和处理器,其中,memory and processor, where, 所述存储器存储指令;the memory stores instructions; 所述处理器执行所述指令用于:The processor executes the instructions for: 接收短链接;Receive a short link; 根据预定的映射关系确定所述短链接对应的长链接,当存在对应的长链接,则根据该长链接加载对应的页面,Determine the long link corresponding to the short link according to a predetermined mapping relationship, and when there is a corresponding long link, load the corresponding page according to the long link, 其中,所述预定的映射关系定义了短链接和长链接的对应关系,并且短链接通过索引关联到其对应的长链接。Wherein, the predetermined mapping relationship defines the corresponding relationship between the short link and the long link, and the short link is associated with its corresponding long link through an index.
CN201610482137.4A 2016-06-28 2016-06-28 The method and apparatus that a kind of short chain of process in a browser connects Pending CN106202187A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610482137.4A CN106202187A (en) 2016-06-28 2016-06-28 The method and apparatus that a kind of short chain of process in a browser connects

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610482137.4A CN106202187A (en) 2016-06-28 2016-06-28 The method and apparatus that a kind of short chain of process in a browser connects

Publications (1)

Publication Number Publication Date
CN106202187A true CN106202187A (en) 2016-12-07

Family

ID=57461535

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610482137.4A Pending CN106202187A (en) 2016-06-28 2016-06-28 The method and apparatus that a kind of short chain of process in a browser connects

Country Status (1)

Country Link
CN (1) CN106202187A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106817375A (en) * 2017-02-07 2017-06-09 上海斐讯数据通信技术有限公司 Link dazzle system and method
CN107391587A (en) * 2017-06-23 2017-11-24 努比亚技术有限公司 Link is shared and access method, server, terminal and computer-readable storage medium
CN107733972A (en) * 2017-08-28 2018-02-23 阿里巴巴集团控股有限公司 A kind of short linking analytic method, device and equipment
CN107729409A (en) * 2017-09-26 2018-02-23 中国银联股份有限公司 Method and device for generating short links
CN108334569A (en) * 2018-01-16 2018-07-27 中国平安人寿保险股份有限公司 Insuring method, system, equipment and the storage medium connect based on short chain
CN108427751A (en) * 2018-03-13 2018-08-21 深圳乐信软件技术有限公司 A kind of short chain connects jump method, device and electronic equipment
CN109313660A (en) * 2018-08-17 2019-02-05 福建联迪商用设备有限公司 A method and terminal for generating short URL
CN111047413A (en) * 2019-12-17 2020-04-21 秒针信息技术有限公司 Text content acquisition method and device, computer equipment and readable storage medium
CN112307369A (en) * 2019-07-31 2021-02-02 腾讯科技(深圳)有限公司 A short link processing method, device, terminal and storage medium
CN112861032A (en) * 2021-01-20 2021-05-28 银盛通信有限公司 Short link generation method and system
CN116226560A (en) * 2023-03-31 2023-06-06 深圳市星卡科技股份有限公司 Short-link generation method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102333082A (en) * 2010-08-23 2012-01-25 微软公司 The URL of safety shortens
CN102801769A (en) * 2012-03-01 2012-11-28 盛乐信息技术(上海)有限公司 Method and system for generating short links
CN102810089A (en) * 2011-05-30 2012-12-05 盛乐信息技术(上海)有限公司 Content-based short link system and implementation method
CN104601736A (en) * 2013-10-30 2015-05-06 腾讯科技(深圳)有限公司 Method and device for realizing short uniform resource locator (URL) service
CN104717185A (en) * 2013-12-16 2015-06-17 腾讯科技(北京)有限公司 Display and response method, device, server and system for short uniform resource locator

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102333082A (en) * 2010-08-23 2012-01-25 微软公司 The URL of safety shortens
CN102810089A (en) * 2011-05-30 2012-12-05 盛乐信息技术(上海)有限公司 Content-based short link system and implementation method
CN102801769A (en) * 2012-03-01 2012-11-28 盛乐信息技术(上海)有限公司 Method and system for generating short links
CN104601736A (en) * 2013-10-30 2015-05-06 腾讯科技(深圳)有限公司 Method and device for realizing short uniform resource locator (URL) service
CN104717185A (en) * 2013-12-16 2015-06-17 腾讯科技(北京)有限公司 Display and response method, device, server and system for short uniform resource locator

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106817375A (en) * 2017-02-07 2017-06-09 上海斐讯数据通信技术有限公司 Link dazzle system and method
CN107391587A (en) * 2017-06-23 2017-11-24 努比亚技术有限公司 Link is shared and access method, server, terminal and computer-readable storage medium
TWI682653B (en) * 2017-08-28 2020-01-11 香港商阿里巴巴集團服務有限公司 Short link analysis method, device and equipment
CN107733972A (en) * 2017-08-28 2018-02-23 阿里巴巴集团控股有限公司 A kind of short linking analytic method, device and equipment
CN107733972B (en) * 2017-08-28 2020-09-08 阿里巴巴集团控股有限公司 Short link analysis method, device and equipment
US10733257B2 (en) 2017-08-28 2020-08-04 Alibaba Group Holding Limited Short-link parsing methods, apparatus, and devices
WO2019042240A1 (en) * 2017-08-28 2019-03-07 阿里巴巴集团控股有限公司 Short-link parsing method, apparatus and device
CN107729409A (en) * 2017-09-26 2018-02-23 中国银联股份有限公司 Method and device for generating short links
CN108334569A (en) * 2018-01-16 2018-07-27 中国平安人寿保险股份有限公司 Insuring method, system, equipment and the storage medium connect based on short chain
CN108427751A (en) * 2018-03-13 2018-08-21 深圳乐信软件技术有限公司 A kind of short chain connects jump method, device and electronic equipment
CN109313660A (en) * 2018-08-17 2019-02-05 福建联迪商用设备有限公司 A method and terminal for generating short URL
CN112307369A (en) * 2019-07-31 2021-02-02 腾讯科技(深圳)有限公司 A short link processing method, device, terminal and storage medium
CN111047413A (en) * 2019-12-17 2020-04-21 秒针信息技术有限公司 Text content acquisition method and device, computer equipment and readable storage medium
CN111047413B (en) * 2019-12-17 2023-11-07 秒针信息技术有限公司 Method, device, computer equipment and readable storage medium for acquiring text content
CN112861032A (en) * 2021-01-20 2021-05-28 银盛通信有限公司 Short link generation method and system
CN116226560A (en) * 2023-03-31 2023-06-06 深圳市星卡科技股份有限公司 Short-link generation method and device

Similar Documents

Publication Publication Date Title
CN106202187A (en) The method and apparatus that a kind of short chain of process in a browser connects
US10990634B2 (en) Augmenting search results with relevant third-party application content
US9600652B2 (en) Mobile application, identity interface
CN104424199B (en) searching method and device
US9547721B2 (en) Native application search results
US20170357688A1 (en) Providing an application specific extended search capability
US10635659B2 (en) Mobile application bundled with metadata database
CN104272694A (en) System and method for providing private session-based access to a redirected USB device or local device
WO2020024896A1 (en) Blockchain data search method and device and storage medium
US10120951B2 (en) Bifurcated search
CN110019080A (en) Data access method and device
CN108959294B (en) A method and apparatus for accessing a search engine
US10007731B2 (en) Deduplication in search results
US10558814B2 (en) Privacy aware intent resolution with external sources
CN109033302A (en) A kind of method for page jump, device, terminal and storage medium
CN109710832A (en) A method and apparatus for searching for a boarding program
US9996589B2 (en) Holistic federated ranking algorithm
JP7217181B2 (en) WEARABLE DEVICE, INFORMATION PROCESSING METHOD, APPARATUS AND SYSTEM
CN110110184B (en) Information query method, system, computer system and storage medium
US20160239557A1 (en) Accessing Category-Specific Search Servers
US11580246B2 (en) Cryptographic data encoding method with enhanced data security
US11222086B2 (en) Finding content on computer networks
US10423992B2 (en) Method, system, and medium for event based versioning and visibility for content releases
KR101620782B1 (en) Method and System for Storing Data Block Using Previous Stored Data Block
JP2017027471A (en) Distributed database system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20161207

RJ01 Rejection of invention patent application after publication