CN112650955B - Uniform resource locator URL processing method and device - Google Patents

Uniform resource locator URL processing method and device Download PDF

Info

Publication number
CN112650955B
CN112650955B CN202011623848.1A CN202011623848A CN112650955B CN 112650955 B CN112650955 B CN 112650955B CN 202011623848 A CN202011623848 A CN 202011623848A CN 112650955 B CN112650955 B CN 112650955B
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.)
Active
Application number
CN202011623848.1A
Other languages
Chinese (zh)
Other versions
CN112650955A (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

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 terminal equipment, wherein the terminal equipment firstly obtains a first URL generated based on user operation, the first URL is based on HTTP, and the first URL comprises: domain name, subdirectory, resource name, and parameters. 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 matched with a URL format of a target server. 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

Uniform resource locator URL processing method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a URL.
Background
When a user accesses a server through a browser, a terminal device where the browser is located typically transmits a uniform resource locator (Uniform Resource Locator, URL) requested by the user to a target server, but when the URL transmitted by the terminal device does not match the URL format set by the target server, the URL cannot be received by the target server. For example, in the scenario of Application (APP) download installation in iOS enterprises, since the URL of the APP related to download installation that the apple company requires to send to the server cannot carry parameters, if the user wants to download the APP related to install, the standard hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) is sent to the target server in the following format: http:// [ domain name ]/[ subdirectory 1]/[ subdirectory 2 ]/..[ subdirectory n ]/[ resource name ]? A URL of [ parameter a=value m ] & [ parameter b=value p ] &..[ parameter n=value q ], such as http: the URL is not received by the target server if/(appstore.com/category/taobao.ipav=1.0.0 & token=9527).
Aiming at the problem that the target server cannot receive the URL sent by the terminal equipment when the URL sent by the terminal equipment is not matched with the URL format set by the target server, the method for reconstructing the project by modifying the related program codes is generally adopted at present. The specific method comprises the following steps: modifying the front-end program of the terminal equipment, and changing the request and service data organization modes; or modifying the server program to put into operation again. The method can greatly increase the workload of research, development, test and production processes, has low efficiency and poor user experience, and can not use the service in a short time no matter the program of the terminal equipment or the program of the server is modified.
Therefore, a solution is urgently needed to solve the above-mentioned problems.
Disclosure of Invention
The technical problem to be solved by the application is to provide a processing method of a Uniform Resource Locator (URL) 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, a program of the terminal device or a program of the server is modified, service is not available in a short time, workload of research and development, testing and putting into production is greatly increased, efficiency is quite low and user experience is poor.
In a first aspect, an embodiment of the present application provides a method for processing a 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 the 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, according to the first URL, the corresponding URL conversion model 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 which does not comprise parameters.
Optionally, the converting the first URL using a URL conversion model matched with the first URL includes:
acquiring a value of at least one parameter in the first URL;
determining a position of a 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, according to the first URL, the corresponding URL conversion model includes:
and according to the domain name and the parameters in the first URL, matching to obtain a second conversion model, 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 using a URL conversion model matched with the first URL includes:
acquiring at least one subdirectory in the first URL;
determining variable names corresponding to the at least one subdirectory respectively 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 a processing apparatus for a URL, where the apparatus includes:
an acquisition module for: 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 for: matching the corresponding URL conversion model according to the first URL;
a conversion module for: 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 which does not comprise parameters.
Optionally, the conversion module is configured to:
acquiring a value of at least one parameter in the first URL;
determining a position of a 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 according to the domain name and the parameters in the first URL, matching to obtain a second conversion model, 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 corresponding to the at least one subdirectory respectively 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 present embodiment provides a method for processing a URL, which is executed by the terminal device, where the terminal device first obtains a first URL generated based on a user operation, where the first URL is an HTTP-based URL, and the first URL includes: domain name, subdirectory, resource name, and parameters. 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 matched with a URL format of a target server. 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 equipment acquires the first URL, the first URL is converted into a second URL conforming to the analysis rule of the target server by using a URL conversion model matched with the first URL. The access to the target server can be realized by using the first URL without modifying the program of the terminal equipment or the 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 that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for processing a URL according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a processing device for URL in an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The inventor of the application finds that, when the URL sent by the terminal device is not matched with the URL format set by the target server, the target server cannot receive the URL sent by the terminal device, and currently, a method of modifying related program codes and reconstructing items is generally adopted to solve the problem. The specific method comprises the following steps: modifying the front-end program of the terminal equipment, and changing the request and service data organization modes; or modifying the server program to put into operation again. The method can greatly increase the workload of research, development, test and production processes, has low efficiency and poor user experience, and can not use the service in a short time no matter the program of the terminal equipment or the program of the server is modified.
In order to solve the above-mentioned problem, an embodiment of the present application provides a method for processing a URL, which is executed by the terminal device, where the terminal device first obtains a first URL generated based on a user operation, where the first URL is an HTTP-based URL, and the first URL includes: domain name, subdirectory, resource name, and parameters. 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 matched with a URL format of a target server. 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 equipment acquires the first URL, the first URL is converted into a second URL conforming to the analysis rule of the target server by using a URL conversion model matched with the first URL. The access to the target server can be realized by using the first URL without modifying the program of the terminal equipment or the 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 attached drawing figures.
Exemplary method
Referring to fig. 1, a flowchart of a processing method of a URL in an embodiment of the present application is shown. The method shown in fig. 1 may be performed by a terminal device in one implementation.
In the present embodiment, the method shown in fig. 1 can be implemented by, for example, the following steps S101 to S104.
S101: acquiring a first URL, wherein the first URL is an HTTP URL, 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 an HTTP-based URL, 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.
The first URL may not be received by the target server, considering that the first URL may not match the URL format set by the target server, and the first URL is directly transmitted to the target server. Thus, to enable the user to successfully access the target server, the first URL may be converted to a URL matching the target server set-up format. In order to perform format conversion, the terminal device first matches a URL conversion model corresponding to the first URL according to the first URL, and further 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 equipment acquires the first URL, the first URL is converted into a second URL conforming to the analysis rule of the target server by using a URL conversion model matched with the first URL. The access to the target server can be realized by using the first URL without modifying the program of the terminal equipment or the program of the server, so that the working efficiency is improved, and the user experience is improved.
The server may set the parameters that cannot be included in the received URL, and may set the number of subdirectories 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, the value of the parameter in the first URL can be converted into a subdirectory in the first URL according to a URL conversion model corresponding to the first URL to obtain the second URL, and the second URL does not include the parameter; if the number of subdirectories in the URL received by the target server is 1, for example, when the first URL includes a plurality of subdirectories, in order to enable the first URL to be received by the target server, the subdirectories at the specified location in the first URL may be converted into 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 contains only 1 subdirectory.
In one example, the terminal device may obtain a first conversion model by matching according to the domain name, the subdirectory, and the resource name in the first URL, where the first conversion model is used to convert the first URL into the second URL that does not include parameters. When the matching is performed, the terminal device may search, in a database, whether the first conversion model corresponding to the domain name, the subdirectory and the resource name in the first URL exists according to the domain name, the subdirectory and the resource name in the first URL, where the database is used to store the conversion model for converting the parameters in the URL into the subdirectory. If the first conversion model exists in the database, the first URL can be converted into the second URL without parameters according to the first conversion model; if not, it is stated that the value of the parameter in the first URL does not need to be converted into the subdirectory when the first URL is sent. It should be noted that, when matching is performed, a configuration file, a redis or other cache system may be used, and a method for accessing a cloud service may be the same as a method for performing matching in a database, which is not described herein.
For example, assuming that the first URL is http:// appstore.com/category/taobao.iparsion=1.0.0 & token=9527, the terminal device may search the database for whether a conversion model corresponding to a combination of the domain name "appstore.com", the sub-category "and the resource name" taobao.ipa "exists according to the domain name" appstore.com ", the sub-category" and the resource name "taobao.ipa" in the first URL, and if so, may convert the first URL into the second URL excluding parameters according to the conversion model; if not, it is stated that the value of the parameter in the first URL does not need to be converted into the subdirectory when the first URL is sent.
After the first conversion model is obtained, the first URL can be converted by using the first conversion model, and the value of the parameter in the first URL is converted into the subdirectory. It will be appreciated that, before conversion, 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 one example, after obtaining the value of 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 the 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/category/taobao.iparsion=1.0.0 & token=9527, the parameter is "version=1.0.0 & token=9527" and the subdirectory is "category". If the first transformation model indicates: the value of "1.0.0" of the parameter version is converted into a primary subdirectory, the value of "9527" of the parameter token is converted into a secondary subdirectory, then [ "version", "token" ], which is used for indicating the position of the value of at least one parameter in the first URL in the subdirectory of the converted URL, the content in the quotation of [ "version", "token" ] represents the name of the variable converted into the subdirectory, and when in conversion, the value of the variable corresponding to the variable name is converted into the corresponding position in the subdirectory according to the position sequence of the variable name in the [ "version", "token" ], and the converted second URL is tp:// application.com/1.0/9527/taobao.
It is not difficult to find that, in the above example, when the conversion is performed, since the first conversion model sets that the value "1.0.0" of the parameter version is converted into the first-level subdirectory, the first-level subdirectory "category" in the first URL is covered by the value "1.0.0" of the parameter version. If the first transformation model is: the original primary subdirectory is unchanged, the value "9527" of the parameter token is converted into a secondary subdirectory, the value "1.0.0" of the parameter version is converted into a tertiary subdirectory, and then the "", "token", "version" ], "" "in" "," token "," version "] can be determined according to the first conversion model at this time, and" "" in the first URL is reserved for the primary subdirectory. After conversion, the second URL is http:// taobao.com/category/9527/1.0.0/111.action.
The above example illustrates a case where when the server sets that the parameter cannot be included in the received URL, 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 parameter is not included in the second URL.
When the server sets the number of subdirectories in the received URL, the terminal device converts the subdirectories in the designated position in the first URL into parameters 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 by matching according to the domain name and the parameters in the first URL, where the second conversion model is used to convert part or all of the subdirectories in the first URL into parameters. When matching is performed, the terminal device may search, 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 a conversion model for converting the subdirectory of the specified location in the URL into the parameter in the first URL. If the second conversion model exists in the database, the description can convert the subdirectory of the appointed position of the first URL into the parameter of the first URL according to the second conversion model; if not, it is stated that the sub-directory in the first URL does not need to be converted into the parameters of the first URL when the first URL is sent.
It will be appreciated that before converting a subdirectory at a specified location in the first URL into a parameter of the first URL, a corresponding variable name of the subdirectory in the converted parameter and a format of the parameter in the converted URL may be determined first. 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 obtaining at least one sub-directory in the first URL, the terminal device may determine variable names corresponding to the at least one sub-directory respectively according to the second conversion model, and obtain a parameter format in the converted URL.
For example, assuming that the first URL is http:// taobao.com/store/category/product/111. Action, according to the second conversion model, the variable name corresponding to the primary sub-directory "store" is known as "store name", the variable name corresponding to the secondary sub-directory "category" is known as "category name", the variable name corresponding to the tertiary sub-directory "product" is known as "product name", and according to the second conversion model, the parameter format of the converted URL may be determined as follows: { "ProductName": value1, "stoneName": value2}, it is known that the primary sub-directory "store" and the tertiary sub-directory "product" need to be converted, and the secondary sub-directory remains. According to the first URL and variable names corresponding to the subdirectories in the first URL, it is known that value1 is a product and value2 is a store, then according to the parameter format, the three-level subdirectory product and the first-level subdirectory store in the converted URL, the first URL is converted, and the obtained second URL is http:// taobao.com/catalyst/111.action? product name=product & stonename=store.
In one example, the first URL may be parsed, and then each level of subdirectory in the first URL obtained by parsing is sequentially placed in an array, where the obtained array may be, for example [ "store", "category", "product" ]. At this time, the parameter format in the URL obtained by the second conversion model may be { "ProducName": $3 }, "stoneName": $1}, where "$3" is used to index the stored content of the third element position in the array of the first URL, and "$1" is used to index the stored content of the first element position in the array of the first URL. In this way, the stored content "product" of the third element position in the array of the first URL may be obtained directly according to $3 in the parameter format, and the stored content "store" of the first element position in the array of the first URL may be obtained according to $1 in the parameter format, thereby obtaining the converted second URL: http:// taobao.com/category/111.actionproductname=product & stonenname=store.
In one example, the terminal device may translate all subdirectories in the first URL into parameters of the first URL according to the second translation model. For example, when the first URL is assumed to be http:// taobao.com/store/category/product/111. Action, according to the second conversion model, the variable name corresponding to the first-level subdirectory "store" is known to be "store name", the variable name corresponding to the second-level subdirectory "category" is known to be "category", the variable name corresponding to the third-level subdirectory "product" is known to be "product name", and according to the second conversion model, it may be determined that the parameter format of the converted URL is: { "ProductName": value1, "stoneName": value2, "catagnName": value3}, it is known that the primary subdirectory "store", the secondary subdirectory "catagno" and the tertiary subdirectory "product" need to be converted. According to the first URL and variable names corresponding to the subdirectories in the first URL, it is known that value1 is a product, value2 is a store, value3 is a catalyst, and according to the parameter format, the three-level subdirectory product, the first-level subdirectory store and the second-level subdirectory catalyst in the converted URL, the first URL is converted, and the obtained second URL is http:// taobao.com/111.actionproduct name=product & ston name=store & catalyst name=catalyst.
It should be noted that, when it is determined according to the second conversion model that the name of the variable corresponding to the at least one sub-directory in the first URL in the converted parameter is the same as the name of the parameter in the first URL, when the sub-directory is converted into the parameter in the first URL, the value of the parameter in the first URL may be covered by the sub-directory. For example, assume that the first URL is http:// taobao.com/store/category/product/111. Action? product name=new, if the second conversion model indicates that the primary subdirectory "store" and the tertiary subdirectory "product" are converted, where the variable name corresponding to the primary subdirectory is "store name" and the variable name corresponding to the tertiary subdirectory is "product name"; the parameter format in the converted URL is as follows: "ProductName" =value 1 =value 2 may be { "ProductName": $3, "stoneName": $1}, it may be found that a parameter named "ProductName" exists in the first URL, and the parameter name is the same as the variable name corresponding to the third-level subdirectory, and when the parameter name in the first URL is converted, the value new of the parameter in the first URL may be covered by the third-level subdirectory "product", and the second URL is http:// taobao.com/catalyst/111.actionproduct Name=product & stoneName=store.
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 access of the user to the target server.
Exemplary apparatus
Based on the method provided by the embodiment, the embodiment of the application also provides a device, and the device is described below with reference to the accompanying drawings.
Referring to fig. 2, a schematic structural diagram of a processing device of a URL in an embodiment of the present application is shown. The device applied to the terminal equipment can specifically comprise:
the acquisition module 201: for obtaining a first URL, the first URL being a URL based on the hypertext transfer protocol HTTP, the first URL comprising: domain name, subdirectory, resource name, and parameters;
matching module 202: the URL conversion model is used for matching the corresponding URL according to the first URL;
conversion module 203: the URL conversion model is used for converting the first URL by utilizing 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 equipment acquires the first URL, the first URL is converted into the second URL conforming to the analysis rule of the target server by using a URL conversion model matched with the first URL. The access to the target server can be realized by using the first URL without modifying the program of the terminal equipment or the 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 which does not comprise parameters.
In one implementation, the conversion module is configured to:
acquiring a value of at least one parameter in the first URL;
determining a position of a 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 according to the domain name and the parameters in the first URL, matching to obtain a second conversion model, 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 corresponding to the at least one subdirectory respectively 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 application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure 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 is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims
The foregoing description of the preferred embodiments of the present application is not intended to limit the invention to the particular embodiments of the present application, but to limit the scope of the invention to the particular embodiments of the present application.

Claims (6)

1.A method for processing a 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 the 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;
sending the second URL;
wherein,
the matching the corresponding URL conversion model according to the first URL includes: according to the domain name, the subdirectory and the resource name in the first URL, matching to obtain a first conversion model, wherein the first conversion model is used for converting the first URL into the second URL which does not comprise parameters;
the converting the first URL using a URL conversion model matching the first URL includes: acquiring a value of at least one parameter in the first URL; determining a position of a 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.
2. The method of claim 1, wherein said matching the corresponding URL transformation model according to the first URL comprises:
and according to the domain name and the parameters in the first URL, matching to obtain a second conversion model, wherein the second conversion model is used for converting part or all of the subdirectories in the first URL into the parameters.
3. The method of claim 2, wherein converting the first URL using a URL conversion model that matches the first URL comprises:
acquiring at least one subdirectory in the first URL;
determining variable names corresponding to the at least one subdirectory respectively 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.
4. A processing apparatus for a uniform resource locator URL, the apparatus comprising:
an acquisition module for: 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 for: matching the corresponding URL conversion model according to the first URL;
a conversion module for: 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: sending the second URL;
wherein,
the matching module is used for: according to the domain name, the subdirectory and the resource name in the first URL, matching to obtain a first conversion model, wherein the first conversion model is used for converting the first URL into the second URL which does not comprise parameters;
the conversion module is used for: acquiring a value of at least one parameter in the first URL; determining a position of a 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.
5. The apparatus of claim 4, wherein the matching module is configured to:
and according to the domain name and the parameters in the first URL, matching to obtain a second conversion model, wherein the second conversion model is used for converting part or all of the subdirectories in the first URL into the parameters.
6. The apparatus of claim 5, wherein the conversion module is configured to:
acquiring at least one subdirectory in the first URL;
determining variable names corresponding to the at least one subdirectory respectively 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 CN112650955A (en) 2021-04-13
CN112650955B true 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 (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110132849A (en) * 2010-06-03 2011-12-09 주식회사 다음커뮤니케이션 Device and method for transformation url
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

Family Cites Families (3)

* 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
US9262544B2 (en) * 2009-09-29 2016-02-16 Sap Se Translating between address representations
US20150161282A1 (en) * 2013-12-11 2015-06-11 Yahoo! Inc. Method and System for Smart URL Shortening Service

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110132849A (en) * 2010-06-03 2011-12-09 주식회사 다음커뮤니케이션 Device and method for transformation url
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
短网址服务系统的实现及相关技术研究;郭一华;软件;81-85 *

Also Published As

Publication number Publication date
CN112650955A (en) 2021-04-13

Similar Documents

Publication Publication Date Title
US8375362B1 (en) Wizard for web service search adapter
CN102393857B (en) Method and system for local call based on web page
CN104915398B (en) A kind of webpage buries method and device a little
US20140181262A1 (en) Use of internet information services logging to collect user information in an asynchronous manner
CN104821954A (en) Cross-platform remote procedure call method
CN112765103B (en) File analysis method, system, device and equipment
CN111930614B (en) Automatic testing method, device, equipment and medium
CN105721519B (en) A kind of webpage data acquiring method, apparatus and system
CN101916283B (en) Method for acquiring link information from dynamic webpage and server thereof
CN109600381B (en) Interface adaptation method, device and system
CN108984202B (en) Electronic resource sharing method and device and storage medium
CN112579421A (en) Interface testing method, system and computer readable storage medium
CN114741261A (en) Distributed link tracking method, device, equipment and storage medium
CN112650955B (en) Uniform resource locator URL processing method and device
CN111124873A (en) Method and device for returning Mock data
CN109672732B (en) Interface adaptation method, device and system
CN111324832A (en) Method, system, device and medium for accessing website through short network address
CN111209325A (en) Service system interface identification method, device and storage medium
CN107483294B (en) Method and device for monitoring network request
CN112084245B (en) Data management method, device, equipment and storage medium based on micro-service architecture
CN109063142A (en) Web page resources method for pushing and server
CN111400623B (en) Method and device for searching information
CN112597019A (en) Front-end code debugging method, device, system and medium
CN111107080A (en) Error information pushing method, device, equipment and readable storage medium
CN114629788B (en) Configuration information updating method, system, storage medium and electronic 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