CN112650955A - Method and device for processing Uniform Resource Locator (URL) - Google Patents

Method and device for processing Uniform Resource Locator (URL) Download PDF

Info

Publication number
CN112650955A
CN112650955A CN202011623848.1A CN202011623848A CN112650955A CN 112650955 A CN112650955 A CN 112650955A CN 202011623848 A CN202011623848 A CN 202011623848A CN 112650955 A CN112650955 A CN 112650955A
Authority
CN
China
Prior art keywords
url
conversion model
subdirectory
converted
parameter
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
CN202011623848.1A
Other languages
Chinese (zh)
Other versions
CN112650955B (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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202011623848.1A priority Critical patent/CN112650955B/en
Publication of CN112650955A publication Critical patent/CN112650955A/en
Application granted granted Critical
Publication of CN112650955B publication Critical patent/CN112650955B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/9566URL specific, e.g. using aliases, detecting broken or misspelled links

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 Transfer Between Computers (AREA)

Abstract

The application discloses a processing method of Uniform Resource Locator (URL), which is executed by a terminal device, wherein the terminal device firstly acquires a first URL generated based on user operation, the first URL is a URL based on Hyper Text Transport Protocol (HTTP), and the first URL comprises: domain name, subdirectory, resource name, and parameters. And after the terminal equipment acquires the first URL, matching a corresponding URL conversion model according to the first URL, wherein the URL conversion model corresponding to the first URL is used for converting the first URL into a URL with a format matched with that of a target server URL. And then, converting the first URL by using a URL conversion model matched with the first URL to obtain a converted second URL, wherein the second URL accords with the analysis rule of the target server. And finally, the terminal equipment sends the second URL to the target server.

Description

Method and device for processing Uniform Resource Locator (URL)
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a uniform resource locator URL.
Background
When a user accesses a server through a browser, a terminal device where the browser is located usually sends a Uniform Resource Locator (URL) requested by the user to a target server, but when the URL sent by the terminal device does not match a URL format set by the target server, the URL cannot be received by the target server. For example, in a scenario of downloading and installing an Application (APP) in an iOS enterprise, since the URL that the apple company requests to send to the server to request downloading and installing of the relevant APP cannot have parameters, if the user wishes to download and install the relevant APP, the URL is in the format of: http:// [ domain name ]/[ subdirectory 1]/[ subdirectory 2]/. -? A URL such as http:// applet. com/catalog/taobao. ipaversion ═ 1.0.0& token 9527 of [ parameter a ═ value m ] & [ parameter b ═ value p ] &.
Aiming at the problem that when the URL sent by the terminal equipment is not matched with the URL format set by the target server, the target server cannot receive the URL sent by the terminal equipment, at present, a method of modifying related program codes and reconstructing projects is generally adopted to solve the problem. The specific method comprises the following steps: modifying a front-end program of the terminal equipment, and changing a request and service data organization mode; or modifying the server program and restarting the operation. No matter the program of the terminal equipment or the program of the server is modified, the service can be unavailable in a short time, the method can greatly increase the workload of research and development, test and production processes, the efficiency is very low, and the user experience is not good.
Therefore, a solution to solve the above problems is urgently needed.
Disclosure of Invention
The technical problem to be solved by the application is to provide a processing method of uniform resource locator URL, so as to solve the problems that when the URL sent by a terminal device is not matched with the URL format set by a target server, the program of the terminal device or the program of the server is modified, the service is unavailable in a short time, the workload of research and development, testing and production processes is greatly increased, the efficiency is very low, and the user experience is not good.
In a first aspect, an embodiment of the present application provides a method for processing a uniform resource locator URL, where the method includes:
acquiring a first URL, wherein the first URL is a URL based on a hypertext transfer protocol (HTTP), and the first URL comprises: domain name, subdirectory, resource name and parameters;
matching a corresponding URL conversion model according to the first URL;
converting the first URL by using a URL conversion model matched with the first URL to obtain a converted second URL;
and sending the second URL.
Optionally, the matching of the corresponding URL conversion model according to the first URL includes:
and matching to obtain a first conversion model according to the domain name, the subdirectory and the resource name in the first URL, wherein the first conversion model is used for converting the first URL into the second URL without parameters.
Optionally, the converting the first URL by using a URL conversion model matching the first URL includes:
obtaining a value of at least one parameter in the first URL;
determining the position of the value of the at least one parameter in the subdirectory of the converted URL according to the first conversion model;
and converting the first URL according to the position of the value of the at least one parameter in the subdirectory of the converted URL to obtain the second URL.
Optionally, the matching of the corresponding URL conversion model according to the first URL includes:
and matching to obtain a second conversion model according to the domain name and the parameters in the first URL, wherein the second conversion model is used for converting part or all of the subdirectories in the first URL into the parameters.
Optionally, the converting the first URL by using a URL conversion model matching the first URL includes:
acquiring at least one subdirectory in the first URL;
determining variable names respectively corresponding to the at least one subdirectory according to the second conversion model;
obtaining a parameter format in the converted URL according to the second conversion model;
and converting the first URL according to the parameter format in the converted URL to obtain the second URL.
In a second aspect, an embodiment of the present application provides an apparatus for processing a uniform resource locator URL, where the apparatus includes:
an acquisition module to: acquiring a first URL, wherein the first URL is a URL based on a hypertext transfer protocol (HTTP), and the first URL comprises: domain name, subdirectory, resource name and parameters;
a matching module to: matching a corresponding URL conversion model according to the first URL;
a conversion module to: converting the first URL by using a URL conversion model matched with the first URL to obtain a converted second URL;
a sending module configured to: and sending the second URL.
Optionally, the matching module is configured to:
and matching to obtain a first conversion model according to the domain name, the subdirectory and the resource name in the first URL, wherein the first conversion model is used for converting the first URL into the second URL without parameters.
Optionally, the conversion module is configured to:
obtaining a value of at least one parameter in the first URL;
determining the position of the value of the at least one parameter in the subdirectory of the converted URL according to the first conversion model;
and converting the first URL according to the position of the value of the at least one parameter in the subdirectory of the converted URL to obtain the second URL.
Optionally, the matching module is configured to:
and matching to obtain a second conversion model according to the domain name and the parameters in the first URL, wherein the second conversion model is used for converting part or all of the subdirectories in the first URL into the parameters.
Optionally, the conversion module is configured to:
acquiring at least one subdirectory in the first URL;
determining variable names respectively corresponding to the at least one subdirectory according to the second conversion model;
obtaining a parameter format in the converted URL according to the second conversion model;
and converting the first URL according to the parameter format in the converted URL to obtain the second URL.
Compared with the prior art, the embodiment of the application has the following advantages:
the embodiment provides a processing method of a uniform resource locator URL, which is executed by a terminal device, where the terminal device first obtains a first URL generated based on a user operation, where the first URL is a URL based on an HTTP, and the first URL includes: domain name, subdirectory, resource name, and parameters. And after the terminal equipment acquires the first URL, matching a corresponding URL conversion model according to the first URL, wherein the URL conversion model corresponding to the first URL is used for converting the first URL into a URL with a format matched with that of a target server URL. And then, converting the first URL by using a URL conversion model matched with the first URL to obtain a converted second URL, wherein the second URL accords with the analysis rule of the target server. And finally, the terminal equipment sends the second URL to the target server. Therefore, after the terminal device obtains the first URL, the terminal device converts the first URL into a second URL that meets the analysis rule of the target server by using a URL conversion model matched with the first URL. The first URL can be used for accessing the target server without modifying a program of the terminal equipment or a program of the server, so that the working efficiency is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart illustrating a method for processing a uniform resource locator URL according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a device for processing a uniform resource locator URL according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The inventor of the present application finds, through research, that, in order to solve the problem that the target server cannot receive the URL sent by the terminal device when the URL sent by the terminal device does not match the URL format set by the target server, a method of modifying a related program code and reconstructing a project is generally adopted at present. The specific method comprises the following steps: modifying a front-end program of the terminal equipment, and changing a request and service data organization mode; or modifying the server program and restarting the operation. No matter the program of the terminal equipment or the program of the server is modified, the service can be unavailable in a short time, the method can greatly increase the workload of research and development, test and production processes, the efficiency is very low, and the user experience is not good.
In order to solve the above problem, an embodiment of the present application provides a method for processing a uniform resource locator URL, where the method is executed by a terminal device, the terminal device first obtains a first URL generated based on a user operation, where the first URL is a URL based on HTTP, and the first URL includes: domain name, subdirectory, resource name, and parameters. And after the terminal equipment acquires the first URL, matching a corresponding URL conversion model according to the first URL, wherein the URL conversion model corresponding to the first URL is used for converting the first URL into a URL with a format matched with that of a target server URL. And then, converting the first URL by using a URL conversion model matched with the first URL to obtain a converted second URL, wherein the second URL accords with the analysis rule of the target server. And finally, the terminal equipment sends the second URL to the target server. Therefore, after the terminal device obtains the first URL, the terminal device converts the first URL into a second URL that meets the analysis rule of the target server by using a URL conversion model matched with the first URL. The first URL can be used for accessing the target server without modifying a program of the terminal equipment or a program of the server, so that the working efficiency is improved, and the user experience is improved.
Various non-limiting embodiments of the present application are described in detail below with reference to the accompanying drawings.
Exemplary method
Referring to fig. 1, a flowchart of a method for processing a uniform resource locator URL in an embodiment of the present application is shown. The method shown in fig. 1, in one implementation, may be performed by a terminal device.
In the present embodiment, the method shown in FIG. 1 can be implemented, for example, by the following steps S101-S104.
S101: acquiring a first URL, wherein the first URL is a URL of HTTP (hyper text transport protocol), and the first URL comprises: domain name, subdirectory, resource name, and parameters.
In this embodiment, after a user triggers an operation of accessing a target server, the terminal device generates a first URL based on the user operation, where the first URL is a URL based on HTTP, and the first URL includes: domain name, subdirectory, resource name, and parameters.
S102: and matching the corresponding URL conversion model according to the first URL.
S103: and converting the first URL by using a URL conversion model matched with the first URL to obtain a converted second URL.
Sending the first URL directly to the target server, considering that the first URL may not match the URL format set by the target server, and the first URL may not be received by the target server. Thus, in order to enable the user to successfully access the target server, the first URL may be converted to a URL that matches the format set by the target server. For format conversion, the terminal device firstly matches a URL conversion model corresponding to the first URL according to the first URL, and then converts the first URL by using the URL conversion model matched with the first URL to obtain a converted second URL. Therefore, after the terminal device obtains the first URL, the terminal device converts the first URL into a second URL that meets the analysis rule of the target server by using a URL conversion model matched with the first URL. The first URL can be used for accessing the target server without modifying a program of the terminal equipment or a program of the server, so that the working efficiency is improved, and the user experience is improved.
The server may set that the received URL cannot include the parameter, and may set the number of sub-directories in the received URL. If the target server sets that the received URL cannot include the parameter, when the first URL includes the parameter, in order to enable the first URL to be received by the target server, a value of the parameter in the first URL may be converted into a subdirectory in the first URL according to a URL conversion model corresponding to the first URL to obtain a second URL, where the second URL does not include the parameter; if the number of sub-directories in the URL received by the target server is, for example, 1, when the first URL includes a plurality of sub-directories, in order to enable the first URL to be received by the target server, the sub-directories at the specified positions in the first URL may be converted into the parameters of the first URL according to a URL conversion model corresponding to the first URL, so as to obtain the second URL, where the second URL includes only 1 sub-directory.
In one example, the terminal device may obtain a first conversion model according to a domain name, a subdirectory, and a resource name in the first URL by matching, where the first conversion model is used to convert the first URL into the second URL that does not include parameters. It should be noted that, when performing matching, the terminal device may search, according to the domain name, the subdirectory, and the resource name in the first URL, in a database, whether the first conversion model corresponding to the domain name, the subdirectory, and the resource name in the first URL exists, where the database is used to store a conversion model for converting parameters in the URL into the subdirectory. If the first conversion model is present in the database, indicating that the first URL may be converted to the second URL that does not include parameters according to the first conversion model; if not, it means that when the first URL is sent, the value of the parameter in the first URL does not need to be converted into the subdirectory. It should be noted that, during matching, methods such as configuring a file, using a redis or other cache system, accessing a cloud service, and the like may also be adopted, which are the same as the method for matching in the database, and are not described herein again.
For example, assuming that the first URL is http:// apptore.com/catalog/taobao.iparion ═ 1.0.0& token ═ 9527, the terminal device may search in the database whether a conversion model corresponding to a combination of the domain name "apptore.com", the subdirectory "catalog", and the resource name "taobao.ipa" exists according to the domain name "apptore.com", the subdirectory "catalog", and the resource name "taobao.ipa" in the first URL, and if so, may specify that the first URL may be converted into the second URL that does not include parameters according to the conversion model; if not, it means that when the first URL is sent, the value of the parameter in the first URL does not need to be converted into the subdirectory.
After the first conversion model is obtained, the first URL may be converted by using the first conversion model, and the values of the parameters in the first URL are converted into the subdirectory. It is understood that, before the conversion is performed, the position of the value of the parameter to be converted in the first URL in the subdirectory of the converted URL may be determined first, and then the value of the parameter to be converted in the first URL may be converted to the corresponding position in the subdirectory. In an example, after obtaining the value of the at least one parameter in the first URL, the terminal device may determine, according to the first conversion model, a position of the value of the at least one parameter in a subdirectory of the converted URL, and further convert the value of the parameter to be converted in the first URL to a corresponding position in the subdirectory.
For example, assuming that the first URL is http:// appstore. com/catalog/taobao. ipa ═ 1.0.0& token ═ 9527, the parameters are "version ═ 1.0.0& token ═ 9527", and the subdirectory is "catalog". If the first conversion model indicates: the value of the parameter version is converted into a first-level subdirectory, the value of the parameter token is converted into a second-level subdirectory, then the position of the value of at least one parameter in the first URL in the subdirectory of the converted URL can be determined according to the first conversion model, the content in the quotation marks of the parameter version and token represents the name of the variable converted into the subdirectory, the value of the variable corresponding to the name of the variable is converted into the corresponding position in the subdirectory according to the position sequence of the name of the variable in the subdirectory, and the converted second URL is http:// ap pstore.0.0/9527/taao.
It is easy to find that, in the above example, when the conversion is performed, since the first conversion model sets the value "1.0.0" of the parameter version to be converted into the first-level subdirectory, the first-level subdirectory "catalog" in the first URL is overwritten by the value "1.0.0" of the parameter version. If the first conversion model is: the original first-level subdirectory is unchanged, the value of the parameter token is converted into a second-level subdirectory, the value of the parameter version is converted into a third-level subdirectory, and then the 'in the' model ',' token ',' version '], the' in the 'model', 'token', 'version' ] can be determined according to the first conversion model, so that the 'in the' first-level subdirectory in the first URL is reserved. After conversion, the second URL is http:// taobao.com/catalog/9527/1.0.0/111. action.
The above example illustrates a case where, when the server sets that the received URL cannot include the parameter, the terminal device converts the value of the parameter in the first URL into the subdirectory in the first URL according to the first conversion model to obtain the second URL, where the second URL does not include the parameter.
Next, when the server sets the number of subdirectories in the received URL, the terminal device converts the subdirectory at the specified position in the first URL into the parameter of the first URL to obtain the second URL, where the second URL only contains the number of subdirectories set by the server.
In one example, the terminal device may first obtain a second conversion model according to the domain name and the parameters in the first URL by matching, where the second conversion model is used to convert part or all of the subdirectories in the first URL into parameters. It should be noted that, when performing matching, the terminal device may search, according to the domain name and the parameter in the first URL, in a database, whether the second conversion model corresponding to the domain name and the parameter in the first URL exists, where the database is used to store the conversion model for converting the subdirectory at the specified location in the URL into the parameter of the first URL. If the second conversion model exists in the database, the fact that the subdirectory at the specified position in the first URL can be converted into the parameter of the first URL according to the second conversion model is shown; if not, it means that when the first URL is sent, the subdirectory in the first URL does not need to be converted into the parameter of the first URL.
It is understood that before converting the subdirectory at a specified position in the first URL into the parameters of the first URL, the corresponding variable name of the subdirectory in the converted parameters and the format of the parameters in the converted URL may be first determined. The variable name corresponding to the converted parameters of the subdirectory is used for describing the type of the subdirectory, and the parameter format of the subdirectory in the converted URL is used for specifying the display format of the parameters in the converted URL. In an example, after the terminal device obtains at least one subdirectory in the first URL, the terminal device may determine, according to the second conversion model, variable names corresponding to the at least one subdirectory, respectively, and obtain a parameter format in the converted URL.
For example, assuming that the first URL is http:// taobao.com/store/catalog/product/111.action, according to the second conversion model, the variable name corresponding to the first-level subdirectory "store" is known as "stored name", the variable name corresponding to the second-level subdirectory "catalog" is known as "catalog name", the variable name corresponding to the third-level subdirectory "product" is known as "product name", and according to the second conversion model, the parameter format of the converted URL can be determined as: { "productName": value1, "store name": value2}, it can be known that the first-level subdirectory "store" and the third-level subdirectory "product" need to be converted, and the second-level subdirectory is reserved. According to the first URL and the variable names corresponding to the subdirectories in the first URL, if value1 is product and value2 is store, then the first URL is converted according to the parameter format in the converted URL, the third-level subdirectory product and the first-level subdirectory store, and the obtained second URL is http:// taobao.com/catalog/111. action? product & storeName store.
In one example, the first URL may be parsed, and the sub-directories at different levels in the first URL obtained by parsing may be sequentially placed in an array, where the obtained array may be, for example, "store", "catalog", and "product". At this time, the format of the parameters in the converted URL may be { "productive name: $3," storeName: $1}, where "$ 3" is used to index the storage content of the third element position in the array of the first URL and "$ 1" is used to index the storage content of the first element position in the array of the first URL, as obtained according to the second conversion model. In this way, the storage content "product" of the third element position in the array of the first URL may be directly obtained according to $3 in the parameter format, and the storage content "store" of the first element position in the array of the first URL may be obtained according to $1 in the parameter format, so as to obtain the converted second URL: http:// taobao.com/catalog/111.actionproductName ═ product & storeName ═ store.
In one example, the terminal device may convert all subdirectories in the first URL into parameters of the first URL according to the second conversion model. For example, when the first URL is the http:// taobao.com/store/catalog/product/111.action, according to the second conversion model, the variable name corresponding to the first-level subdirectory "store" is known as "stored name", the variable name corresponding to the second-level subdirectory "catalog" is known as "catalog name", the variable name corresponding to the third-level subdirectory "product" is known as "product name", and according to the second conversion model, the parameter format of the converted URL can be determined as: { "productName": value1, "storeName": value2, "catalogName": value3}, it can be known that the first-level subdirectory "store", the second-level subdirectory "catalogy" and the third-level subdirectory "product" need to be converted. According to the first URL and the variable names corresponding to the subdirectories in the first URL, if value1 is product, value2 is store, and value3 is catalog, the first URL is converted according to the parameter format in the converted URL, the third-level subdirectory product, the first-level subdirectory store and the second-level subdirectory catalog, and the obtained second URL is http:// taobao.
It should be noted that, when it is determined according to the second conversion model that the variable name corresponding to at least one subdirectory in the first URL in the converted parameters is the same as the name of the parameter in the first URL, and the parameter in the first URL is converted into the parameter in the first URL, the value of the parameter in the first URL may be overwritten by the subdirectory. For example, suppose the first URL is http:// taobao. com/store/catalog/product/111. action? If the second conversion model indicates that the first-level subdirectory "store" and the third-level subdirectory "product" are converted, the variable name corresponding to the first-level subdirectory is the "storeName", and the variable name corresponding to the third-level subdirectory is the "productName"; the format of the parameters in the converted URL is as follows: the "productName" 1& "storeName" value2 may be { "productName": $3, "storeName": $1}, for example, it may be found that a parameter named "productName" exists in the first URL, and a variable name corresponding to the third-level subdirectory is the same, so that, at the time of conversion, a value newone of the parameter in the first URL may be covered by the third-level subdirectory "product", and the obtained second URL is http:// taobao.
S104: and sending the second URL.
In this embodiment, after obtaining the second URL that matches the URL format specified by the target server, the terminal device may send the second URL to the target server, so as to implement the access of the user to the target server.
Exemplary device
Based on the method provided by the above embodiment, the embodiment of the present application further provides an apparatus, which is described below with reference to the accompanying drawings.
Referring to fig. 2, a schematic structural diagram of a device for processing a uniform resource locator URL in an embodiment of the present application is shown. The apparatus is applied to a terminal device, and may specifically include:
the acquisition module 201: for obtaining a first URL, the first URL being a hypertext transfer protocol, HTTP, based URL, the first URL comprising: domain name, subdirectory, resource name and parameters;
the matching module 202: the URL conversion model is used for matching a corresponding URL conversion model according to the first URL;
the conversion module 203: the URL conversion module is used for converting the first URL by using a URL conversion model matched with the first URL to obtain a converted second URL;
the sending module 204: for sending the second URL.
By the device, after the terminal device obtains the first URL, the first URL is converted into a second URL which accords with the analysis rule of the target server by using a URL conversion model matched with the first URL. The first URL can be used for accessing the target server without modifying a program of the terminal equipment or a program of the server, so that the working efficiency is improved, and the user experience is improved.
In one implementation, the matching module is configured to:
and matching to obtain a first conversion model according to the domain name, the subdirectory and the resource name in the first URL, wherein the first conversion model is used for converting the first URL into the second URL without parameters.
In one implementation, the conversion module is configured to:
obtaining a value of at least one parameter in the first URL;
determining the position of the value of the at least one parameter in the subdirectory of the converted URL according to the first conversion model;
and converting the first URL according to the position of the value of the at least one parameter in the subdirectory of the converted URL to obtain the second URL.
In one implementation, the matching module is configured to:
and matching to obtain a second conversion model according to the domain name and the parameters in the first URL, wherein the second conversion model is used for converting part or all of the subdirectories in the first URL into the parameters.
In one implementation, the conversion module is configured to:
acquiring at least one subdirectory in the first URL;
determining variable names respectively corresponding to the at least one subdirectory according to the second conversion model;
obtaining a parameter format in the converted URL according to the second conversion model;
and converting the first URL according to the parameter format in the converted URL to obtain the second URL.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the attached claims
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1.A method for processing a uniform resource locator URL, the method comprising:
acquiring a first URL, wherein the first URL is a URL based on a hypertext transfer protocol (HTTP), and the first URL comprises: domain name, subdirectory, resource name and parameters;
matching a corresponding URL conversion model according to the first URL;
converting the first URL by using a URL conversion model matched with the first URL to obtain a converted second URL;
and sending the second URL.
2. The method of claim 1, wherein matching the corresponding URL conversion model according to the first URL comprises:
and matching to obtain a first conversion model according to the domain name, the subdirectory and the resource name in the first URL, wherein the first conversion model is used for converting the first URL into the second URL without parameters.
3. The method of claim 2, wherein transforming the first URL using a URL transformation model that matches the first URL comprises:
obtaining a value of at least one parameter in the first URL;
determining the position of the value of the at least one parameter in the subdirectory of the converted URL according to the first conversion model;
and converting the first URL according to the position of the value of the at least one parameter in the subdirectory of the converted URL to obtain the second URL.
4. The method of claim 1, wherein matching the corresponding URL conversion model according to the first URL comprises:
and matching to obtain a second conversion model according to the domain name and the parameters in the first URL, wherein the second conversion model is used for converting part or all of the subdirectories in the first URL into the parameters.
5. The method of claim 4, wherein transforming the first URL using a URL transformation model that matches the first URL comprises:
acquiring at least one subdirectory in the first URL;
determining variable names respectively corresponding to the at least one subdirectory according to the second conversion model;
obtaining a parameter format in the converted URL according to the second conversion model;
and converting the first URL according to the parameter format in the converted URL to obtain the second URL.
6. An apparatus for processing a Uniform Resource Locator (URL), the apparatus comprising:
an acquisition module to: acquiring a first URL, wherein the first URL is a URL based on a hypertext transfer protocol (HTTP), and the first URL comprises: domain name, subdirectory, resource name and parameters;
a matching module to: matching a corresponding URL conversion model according to the first URL;
a conversion module to: converting the first URL by using a URL conversion model matched with the first URL to obtain a converted second URL;
a sending module configured to: and sending the second URL.
7. The apparatus of claim 6, wherein the matching module is configured to:
and matching to obtain a first conversion model according to the domain name, the subdirectory and the resource name in the first URL, wherein the first conversion model is used for converting the first URL into the second URL without parameters.
8. The apparatus of claim 7, wherein the conversion module is configured to:
obtaining a value of at least one parameter in the first URL;
determining the position of the value of the at least one parameter in the subdirectory of the converted URL according to the first conversion model;
and converting the first URL according to the position of the value of the at least one parameter in the subdirectory of the converted URL to obtain the second URL.
9. The apparatus of claim 6, wherein the matching module is configured to:
and matching to obtain a second conversion model according to the domain name and the parameters in the first URL, wherein the second conversion model is used for converting part or all of the subdirectories in the first URL into the parameters.
10. The apparatus of claim 9, wherein the conversion module is configured to:
acquiring at least one subdirectory in the first URL;
determining variable names respectively corresponding to the at least one subdirectory according to the second conversion model;
obtaining a parameter format in the converted URL according to the second conversion model;
and converting the first URL according to the parameter format in the converted URL to obtain the second URL.
CN202011623848.1A 2020-12-30 2020-12-30 Uniform resource locator URL processing method and device Active CN112650955B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011623848.1A CN112650955B (en) 2020-12-30 2020-12-30 Uniform resource locator URL processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011623848.1A CN112650955B (en) 2020-12-30 2020-12-30 Uniform resource locator URL processing method and device

Publications (2)

Publication Number Publication Date
CN112650955A true CN112650955A (en) 2021-04-13
CN112650955B CN112650955B (en) 2024-04-12

Family

ID=75366813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011623848.1A Active CN112650955B (en) 2020-12-30 2020-12-30 Uniform resource locator URL processing method and device

Country Status (1)

Country Link
CN (1) CN112650955B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050138137A1 (en) * 2003-12-19 2005-06-23 Microsoft Corporation Using parameterized URLs for retrieving resource content items
US20110078553A1 (en) * 2009-09-29 2011-03-31 Falk Reimann Translating between address representations
KR20110132849A (en) * 2010-06-03 2011-12-09 주식회사 다음커뮤니케이션 Device and method for transformation url
US20150161282A1 (en) * 2013-12-11 2015-06-11 Yahoo! Inc. Method and System for Smart URL Shortening Service
CN105721224A (en) * 2016-03-31 2016-06-29 网易(杭州)网络有限公司 Method, device and system for processing uniform resource locator
CN105787038A (en) * 2016-02-25 2016-07-20 北京搜狗科技发展有限公司 Method and electronic equipment for exploring transformation rule of uniform resource locators
CN106953937A (en) * 2016-11-16 2017-07-14 阿里巴巴集团控股有限公司 A kind of uniform resource position mark URL conversion method and device
CN107547671A (en) * 2016-06-29 2018-01-05 中兴通讯股份有限公司 A kind of URL matching process and device
CN109543121A (en) * 2018-11-09 2019-03-29 深圳万物云联科技有限公司 A kind of exterior chain url resource transfer method and device
CN110808955A (en) * 2019-09-29 2020-02-18 烽火通信科技股份有限公司 System and method for realizing URL dynamic transformation

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050138137A1 (en) * 2003-12-19 2005-06-23 Microsoft Corporation Using parameterized URLs for retrieving resource content items
US20110078553A1 (en) * 2009-09-29 2011-03-31 Falk Reimann Translating between address representations
KR20110132849A (en) * 2010-06-03 2011-12-09 주식회사 다음커뮤니케이션 Device and method for transformation url
US20150161282A1 (en) * 2013-12-11 2015-06-11 Yahoo! Inc. Method and System for Smart URL Shortening Service
CN105787038A (en) * 2016-02-25 2016-07-20 北京搜狗科技发展有限公司 Method and electronic equipment for exploring transformation rule of uniform resource locators
CN105721224A (en) * 2016-03-31 2016-06-29 网易(杭州)网络有限公司 Method, device and system for processing uniform resource locator
CN107547671A (en) * 2016-06-29 2018-01-05 中兴通讯股份有限公司 A kind of URL matching process and device
CN106953937A (en) * 2016-11-16 2017-07-14 阿里巴巴集团控股有限公司 A kind of uniform resource position mark URL conversion method and device
CN109543121A (en) * 2018-11-09 2019-03-29 深圳万物云联科技有限公司 A kind of exterior chain url resource transfer method and device
CN110808955A (en) * 2019-09-29 2020-02-18 烽火通信科技股份有限公司 System and method for realizing URL dynamic transformation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郭一华: "短网址服务系统的实现及相关技术研究", 软件, pages 81 - 85 *

Also Published As

Publication number Publication date
CN112650955B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
US9444899B2 (en) Use of internet information services logging to collect user information in an asynchronous manner
CN102393857B (en) Method and system for local call based on web page
KR20190044134A (en) Website access method, apparatus, and website system
US20030192040A1 (en) System and method for obtaining software
CN107566477B (en) Method and device for acquiring files in distributed file system cluster
CN106055375B (en) Application program installation method and device
CN111200523B (en) Method, device, equipment and storage medium for configuring middle platform system
CN103559056A (en) File downloading method and device
CN105072398B (en) A kind of device updating method and device
CN112765103A (en) File analysis method, system, device and equipment
US20140096237A1 (en) Information processing system, access right management method, information processing apparatus and control method and control program therefor
CN111124873A (en) Method and device for returning Mock data
CN104283865A (en) Download processing method and device, server and client device
CN109600381B (en) Interface adaptation method, device and system
CN111221711A (en) User behavior data processing method, server and storage medium
CN114844814A (en) Pressure testing method and device
CN107766047B (en) Meteorological mode cloud deployment device
CN109672732B (en) Interface adaptation method, device and system
CN112379965A (en) Sandbox file mapping system, client device, mapping end device, sandbox file mapping method and electronic equipment
CN112650955B (en) Uniform resource locator URL processing method and device
CN111026637B (en) Method and device for positioning problem code
CN112671615A (en) Method, system and storage medium for collecting operation behavior data of front-end user
CN107196986B (en) Redirection method and device
CN116319837B (en) File synchronization method, device and equipment supporting multiple protocols and storage medium
CN110929500B (en) File comparison method and related device

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
GR01 Patent grant
GR01 Patent grant