Resource access method, device, computer equipment, and computer-readable storage medium

By generating redirect URLs, the problems of URLs being difficult to remember and having high transmission costs are solved, simple access and personalized URLs are achieved, and data transmission costs are reduced.

CN114218507BActive Publication Date: 2025-09-09SHENZHEN TCL NEW-TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111552135.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2025-09-09
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

Long URLs make it difficult for users to remember and have high transmission costs. In addition, the meaning of the URL is not obvious, making it difficult to determine the content being accessed.

Method used

By receiving the access request from the browser, obtaining the URL information set, generating the redirect URL based on the preset combination strategy, and sending it to the browser to access the network resources.

Benefits of technology

It realizes concise access URL, reduces data transmission cost and supports personalized URL.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114218507B_ABST
    Figure CN114218507B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a resource access method, apparatus, computer device, and computer-readable storage medium. The method comprises receiving a first access request sent by a browser based on an access URL; obtaining a corresponding URL information set based on the access URL, the URL information set including URL component information; performing information combination processing based on the URL component information contained in the URL information set using a preset combination strategy to obtain a redirect URL corresponding to the access URL; and sending the redirect URL to the browser, so that the browser initiates a second access request based on the redirect URL to access the corresponding network resource. This solution, by obtaining the corresponding URL information set and the redirect URL from the access URL, enables the browser to access the network resource indicated by the redirect URL based on the access URL. This solution allows access to network resources based on a concise access URL and allows personalized URLs to be customized. Furthermore, when sending data containing the URL, the cost of data transmission can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a resource access method, apparatus, computer device, and computer-readable storage medium. Background Art

[0002] Typically, URLs are represented by long strings, such as https: / / blog.csdn.net / xxx / article / details / xxx. These long strings make URLs difficult for users to remember, making it difficult to input the correct URL from memory. Furthermore, the meaning of the URL is unclear, making it difficult to determine the content accessible from the URL. Furthermore, when recommending URLs to others, the length of the URL leads to high data transmission costs. Summary of the Invention

[0003] The embodiments of the present application provide a resource access method, apparatus, computer device, and computer-readable storage medium, which can reduce the cost of data transmission.

[0004] An embodiment of the present application provides a resource access method, including:

[0005] Receiving a first access request sent by a browser based on an access URL;

[0006] Acquire a corresponding website information set according to the accessed website, wherein the website information set includes website composition information;

[0007] Based on the URL composition information contained in the URL information set, information combination processing is performed using a preset combination strategy to obtain a redirect URL corresponding to the accessed URL;

[0008] The redirection URL is sent to the browser, so that the browser initiates a second access request based on the redirection URL to access the corresponding network resource.

[0009] Accordingly, an embodiment of the present application further provides a resource access device, including:

[0010] A receiving unit, configured to receive a first access request sent by a browser based on an access website;

[0011] an acquiring unit, configured to acquire a corresponding website information set according to the accessed website, wherein the website information set includes website composition information;

[0012] A combining unit, configured to perform information combining processing based on the URL composition information contained in the URL information set using a preset combining strategy to obtain a redirect URL corresponding to the accessed URL;

[0013] The sending unit is configured to send the redirection URL to the browser, so that the browser initiates a second access request based on the redirection URL to access the corresponding network resource.

[0014] In one embodiment, the combination unit includes:

[0015] a detection subunit, configured to perform information integrity detection on the URL component information contained in the URL information set, and obtain a detection result of the URL information set;

[0016] The information combining subunit is configured to, if the detection result shows that the URL information set contains complete URL composition information, perform information combining processing on the URL composition information based on a preset combining strategy to obtain a redirect URL corresponding to the accessed URL.

[0017] In one embodiment, the combination unit includes:

[0018] a category determination subunit, configured to determine the information category to which the missing URL component information in the URL information set belongs if the detection result indicates that the URL information set does not contain complete URL component information;

[0019] An information determination subunit, configured to determine corresponding candidate component information according to the information category;

[0020] The combination processing subunit is used to perform information combination processing on the website component information and the candidate component information based on a preset combination strategy to obtain a redirection website corresponding to the accessed website.

[0021] In one embodiment, the candidate composition information corresponds to a priority, and the combination processing unit includes:

[0022] a target information determination subunit, configured to determine target component information according to the priority corresponding to each candidate component information;

[0023] An information combination processing subunit, configured to perform information combination processing on the website component information and the target component information based on a preset combination strategy to obtain a redirection website address corresponding to the accessed website address;

[0024] The resource access device further includes:

[0025] A loop unit is used to return to the step of determining the target component information according to the priority corresponding to each candidate component information if the browser cannot access the specified network resource based on the redirection URL; and to perform information combination processing on the URL component information and the target component information based on a preset combination strategy to obtain the redirection URL corresponding to the access URL until the preset conditions are met.

[0026] In one embodiment, the resource access device further comprises:

[0027] a request receiving unit, configured to receive an access URL generation request, wherein the access URL generation request carries an initial access URL;

[0028] A website generating unit, configured to generate the access website according to the website generating request;

[0029] a division unit, configured to perform information division processing on the initially accessed website to obtain a website information set corresponding to the initially accessed address;

[0030] The relationship establishing unit is used to establish a mapping relationship between the website information set and the access website.

[0031] In one embodiment, the URL generation unit includes:

[0032] a first access URL generation subunit, configured to generate the access URL based on the target URL information if the URL generation request carries target URL information;

[0033] The second access URL generation subunit is configured to generate the access URL according to an information generation strategy if the URL generation request does not carry target URL information.

[0034] In one embodiment, the first access URL generating subunit includes:

[0035] A query module, configured to query a database for an access URL that matches the target URL information when the URL generation request carries the target URL information;

[0036] A generating module is configured to generate the access URL based on the target URL information if no access URL matching the target URL information exists.

[0037] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any resource access method provided in the embodiment of the present application.

[0038] Accordingly, an embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any resource access method provided in the embodiment of the present application.

[0039] The embodiment of the present application receives a first access request sent by a browser based on an access URL; obtains a corresponding URL information set according to the access URL, where the URL information set includes URL composition information; performs information combination processing based on the URL composition information contained in the URL information set using a preset combination strategy to obtain a redirect URL corresponding to the access URL; and sends the redirect URL to the browser, so that the browser initiates a second access request based on the redirect URL to access the corresponding network resource.

[0040] In this solution, the server obtains the corresponding URL information set based on the access URL, and obtains the redirect URL based on the URL information set, so that the browser can access the network resources indicated by the redirect URL based on the access URL. Therefore, through the resource access method provided by this application, the user can set the corresponding access URL for the specified URL, so that the network resources can be accessed based on a concise access URL and the URL can be personalized. When sending data containing the URL, the cost of data transmission can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 This is a flowchart of a resource access method provided by an embodiment of the present application;

[0043] Figure 2 This is a schematic diagram of a resource access device provided in an embodiment of the present application;

[0044] Figure 3 It is a structural diagram of the computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0046] The embodiments of the present application provide a resource access method, apparatus, computer device, and computer-readable storage medium. The resource access apparatus can be integrated into a computer device, which can be a server or a terminal.

[0047] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.

[0048] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.

[0049] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.

[0050] This embodiment will be described from the perspective of a resource access device. The resource access device may be integrated into a computer device, which may be a server or a terminal.

[0051] The embodiment of the present application provides a resource access method, such as Figure 1 As shown, the specific process of the resource access method can be as follows:

[0052] 101. A server receives a first access request sent by a browser based on an access URL.

[0053] A browser is an application used to retrieve, display, and deliver information resources on the World Wide Web (also known as the Web). Web resources are identified by Uniform Resource Identifiers (URIs), which are web pages, images, videos, or any other content displayed on a web page.

[0054] The access website may include a Uniform Resource Locator (URL), which is used to indicate the address of an information resource on the World Wide Web.

[0055] The first access request is used to instruct the server to determine the real website address that the browser needs to access based on the access website address.

[0056] For example, the browser may specifically respond to the access URL entered into the URL input bar or other input area by initiating a first access request to the server indicated by the access URL, thereby instructing the server to determine the real URL that the browser wants to access based on the access address.

[0057] Optionally, the browser may respond to a triggering operation on a hyperlink containing an access address and send a first access request to the server.

[0058] The server receives a first access request sent by the browser.

[0059] 102. The server obtains a corresponding URL information set according to the accessed URL, where the URL information set includes URL composition information.

[0060] The URL information set may include URL composition information, and the URL composition information may include one or more of protocol composition information, domain name composition information, and path composition information in the URL.

[0061] For example, the server may specifically query a database for a corresponding URL information set based on the accessed URL.

[0062] Optionally, you can obtain the key fields in the access URL and query the corresponding URL information set based on the key fields of the access URL. For example, the access URL is http: / / m.xxx.cn, where "http" is the communication protocol and "cn" is the super domain name. The communication protocol and super domain name are a lot of repeated information. Different access addresses may contain "http" and "cn". Therefore, you can obtain "m.xxx" as the key field and query the corresponding URL information set in the database.

[0063] 103. The server performs information combination processing based on the URL composition information included in the URL information set using a preset combination strategy to obtain a redirect URL corresponding to the accessed URL.

[0064] The preset combination strategy may include a strategy for combining website address composition information.

[0065] The redirection URL may be a real URL determined by the server and to be accessed by the browser based on the access address.

[0066] For example, the preset combination strategy may be to sequentially concatenate the protocol component information, the domain name component information, and the path component information, with the protocol component information and the domain name component information connected by ": / / ", and the domain name component information and the path component information connected by " / ". Based on the URL component information contained in the URL information set, the server concatenates the URL component information according to the preset combination strategy to obtain a redirect URL corresponding to the accessed URL.

[0067] It is understandable that the URL composition information contained in the URL information set stored in the database may be lost due to some reasons. For example, data is lost due to a program error in the process of generating the network information set, or data is lost due to server crashes, network disconnections, etc. In this case, a complete redirect URL cannot be formed based on the URL composition information contained in the URL information set.

[0068] Since a URL is usually composed of protocol component information, domain name component information, and path component information, optionally, when the protocol component information is lost, the URL information set can be supplemented based on common protocols so that a complete redirect URL can be obtained; or, a prompt message can be sent to the user, prompting the user that there is an error in accessing the URL and please enter the original URL, etc.

[0069] 104. The server sends the redirection URL to the browser, so that the browser initiates a second access request based on the redirection URL to access the corresponding network resource.

[0070] The second access request may be a request sent by a browser for accessing network resources.

[0071] The network resource may be a Web information resource.

[0072] For example, the server may send the redirection URL to the browser, and the browser may access the network resource server indicated by the redirection URL based on the received redirection URL to obtain the corresponding network resource.

[0073] In the resource access method provided in the embodiment of the present application, in step 103, the information integrity of the URL component information in the URL information set can be first checked, and the redirect URL can be obtained in different ways according to the integrity of the URL component information, which is described in detail below.

[0074] In one embodiment, the step of "combining the information using a preset combination strategy based on the URL component information included in the URL information set to obtain a redirect URL corresponding to the accessed URL" may specifically include:

[0075] Performing an information integrity check on the URL component information contained in the URL information set to obtain a check result of the URL information set;

[0076] If the detection result shows that the URL information set contains complete URL component information, the URL component information is combined based on a preset combination strategy to obtain a redirect URL corresponding to the accessed URL.

[0077] For example, the server may perform an integrity check on the URL composition information contained in the URL information set. If the URL information set includes protocol composition information, domain name composition information, and path composition information, then the URL composition information contained in the URL information set is complete. Alternatively, when the URL information set includes protocol composition information, domain name composition information, path composition information, and other composition information, then the URL composition information contained in the URL information set is complete. Otherwise, the URL composition information contained in the URL information set is incomplete.

[0078] After the server performs an integrity check on the URL component information in the URL information set, it obtains the detection result of the URL information combination. When the detection result shows that the URL information set contains complete URL component information, it combines the URL component information based on the preset combination strategy to obtain the redirect URL corresponding to the accessed URL.

[0079] For the detailed process of information combination processing, please refer to the process described in step 103 of the embodiment of this application, which will not be repeated here.

[0080] Because a URL is usually composed of protocol component information, domain name component information, and path component information, when the detection result indicates that the URL component information contained in the URL information set is incomplete, corresponding candidate component information can be determined based on the information category of the missing URL component information to supplement it. That is, in one embodiment, the resource access method provided in the embodiment of the present application may further include:

[0081] If the detection result is that the URL information set does not contain complete URL component information, determining the information category to which the missing URL component information in the URL information set belongs;

[0082] Determine corresponding candidate component information according to the information category;

[0083] Based on the preset combination strategy, the URL component information and the candidate component information are combined to obtain the redirect URL corresponding to the visited URL.

[0084] The information category indicates the category of the URL component information. For example, the URL component information is protocol component information, domain name component information, or path component information.

[0085] The candidate component information may be replacement information for the missing URL component information.

[0086] For example, if the detection result is that the URL information set does not contain complete URL composition information, then the information category to which the missing URL composition information in the URL information set belongs is determined; if the determined URL composition information is protocol composition information, then the corresponding candidate composition information can be determined to be "http" or "https", and the candidate composition information is used as the URL composition information.

[0087] As shown in the URL: https: / / blog.csdn.net / xxx / article / details / xxx, when the path component information "xxx / article / details / xxx" is missing, the homepage information can be accessed based on https: / / blog.csdn.net, and the user can enter the target page on the homepage. Therefore, if the missing URL component information is path component information, the blank component information can be used as candidate component information.

[0088] The server performs information combination processing based on the URL component information and the candidate component information to obtain a redirect URL corresponding to the accessed URL.

[0089] When the client communicates with the network resource server, different protocols may be used, for example, http, https, mailto, and ftp. Corresponding priorities may be set for different protocols. Based on the protocol priorities, attempts are made one by one to see if the correct redirection URL can be obtained. In addition to setting priorities for candidate component information corresponding to the protocol component information, priorities may also be set for other candidate component information. That is, in one embodiment, the candidate component information has corresponding priorities. The step of "combining the URL component information and the candidate component information based on a preset combination strategy to obtain a redirection URL corresponding to the accessed URL" may specifically include:

[0090] Determine the target component information according to the priority corresponding to each candidate component information;

[0091] Based on the preset combination strategy, the URL component information and the target component information are combined and processed to obtain the redirect URL corresponding to the accessed URL;

[0092] The resource access method provided in the embodiment of the present application may further include:

[0093] If the browser cannot access the specified network resource based on the redirect URL, it returns to execute according to the priority corresponding to each candidate component information to determine the target component information; based on the preset combination strategy, the URL component information and the target component information are combined and processed to obtain the redirect URL corresponding to the access URL until the preset conditions are met.

[0094] For example, the candidate component information corresponding to each information category may have a priority. When the URL component information corresponding to the information category is missing in the URL information set, the candidate component information with the highest priority in the candidate component information is determined as the target component information. Based on the preset combination strategy, the URL component information and the target component information are combined to obtain the redirect URL corresponding to the accessed URL.

[0095] The redirection URL is sent to the browser, and the browser accesses the network resource server indicated by the redirection URL based on the received redirection URL. If the browser cannot access the specified network resource based on the redirection URL, that is, when the access to the network resource server indicated by the redirection URL fails, the candidate component information with a priority only lower than the highest priority is determined as the target component information. Based on the preset combination strategy, the URL component information and the target component information are combined and processed to obtain the redirection URL corresponding to the accessed URL, and so on, until the browser successfully accesses the specified network resource, or all candidate network information has been used as the target component information to generate redirection URLs.

[0096] When URL composition information for two or more information categories is missing, the target composition information corresponding to the different information categories can be determined based on the control variable method. For example, if both information category A and information category B are missing, the candidate composition information with the first priority in information category A is first obtained as the target composition information. Then, based on the priority of the candidate composition information of information category B, it is sequentially combined with the target composition information of category A and the URL composition information in the URL information set. If the browser cannot access the specified network resource, the candidate composition information with the second priority in information category A is obtained as the target composition information. Then, based on the priority of the candidate composition information of information category B, it is sequentially combined with the target composition information of category A and the URL composition information in the URL information set, and so on.

[0097] In the resource access method provided in the embodiment of the present application, the server can determine the real URL that the browser wants to access based on the access URL. The reason is that there is a mapping relationship between the access URL and the real URL that the browser wants to access, and the mapping relationship between the access address and the real address can be flexibly set based on the user's needs, which is described in detail below.

[0098] In one embodiment, the resource access method provided by this application may further include:

[0099] Receive an access URL generation request, the access URL generation request carrying an initial access URL;

[0100] Generate access URL according to URL generation request;

[0101] Perform information division processing on the initial access URL to obtain a URL information set corresponding to the initial access address;

[0102] A mapping relationship is established between the URL information set and the access URL.

[0103] The access URL generation request is used to instruct the server to generate an access URL and establish a mapping relationship between the access URL and the initial access URL.

[0104] The initial access address may be a real address to be accessed based on the access address.

[0105] For example, the server may receive a URL generation request, and the URL generation request carries the initial access URL. The server may divide the information of the initial access URL into URL composition information such as protocol composition information, domain name composition information, path composition information, and other composition information according to the composition of the URL, or divide the information into URL composition information such as protocol composition information, domain name composition information, and path composition information.

[0106] A URL information set is generated based on the URL composition information obtained by the division.

[0107] The method for generating the access address is determined based on whether the URL generation request carries target URL information. That is, in one embodiment, the step of "generating the access URL based on the URL generation request" may specifically include:

[0108] If the URL generation request carries target URL information, then the access URL is generated based on the target URL information;

[0109] If the URL generation request does not carry the target URL information, the access URL is generated according to the information generation strategy.

[0110] For example, if the URL generation request carries target URL information, it means that the user wants to generate an access URL based on the target URL information.

[0111] Optionally, if the target URL information is a complete URL, the target complete information is used as the access URL; if the target URL information is not a complete URL, the access URL information is generated based on the target URL information and protocol composition information.

[0112] If the URL generation request does not carry the target URL information, the access URL is generated according to the information generation strategy. For example, a six-digit number is randomly generated as the basic URL information, and then the access URL is generated based on the basic URL information, or 1 is added to the generated historical basic URL information to obtain the basic URL information, and then the access URL is generated based on the basic URL information.

[0113] The accessed URLs are mapped to the URL information set to obtain a mapping relationship between the accessed URLs and the URL information set, and the mapping relationship is stored in a database.

[0114] Optionally, a mapping relationship between key fields of the accessed URL and the URL information set may be established.

[0115] To prevent the generated access URL from being duplicated with the access URL in the database, when determining the corresponding URL set information based on the access URL, more than one URL set information may be obtained, resulting in an incorrect redirect URL. That is, in one embodiment, the step of "if the URL generation request carries target URL information, generating the access URL based on the target URL information" may specifically include:

[0116] When the URL generation request carries the target URL information, query the database to see if there is an access URL that matches the target URL information;

[0117] If there is no access URL matching the target URL information, an access URL is generated based on the target URL information.

[0118] For example, the server may query the database to see whether an access URL matching the target URL information already exists. For example, the target URL information is the same as the access URL, or the target URL information is the same as the key fields in the access URL. If not, the access URL is generated based on the target URL information; if it exists, a prompt message is sent.

[0119] As can be seen from the above, the server in the embodiment of the present application receives a first access request sent by a browser based on an access URL; obtains a corresponding URL information set according to the access URL, and the URL information set includes URL composition information; based on the URL composition information contained in the URL information set, performs information combination processing according to a preset combination strategy to obtain a redirect URL corresponding to the access URL; sends the redirect URL to the browser, so that the browser initiates a second access request based on the redirect URL to access the corresponding network resource.

[0120] In this solution, the server obtains the corresponding URL information set based on the access URL, and obtains the redirect URL based on the URL information set, so that the browser can access the network resources indicated by the redirect URL based on the access URL. Therefore, through the resource access method provided by this application, the user can set the corresponding access URL for the specified URL, so that the network resources can be accessed based on a concise access URL and the URL can be personalized. When sending data containing the URL, the cost of data transmission can be reduced.

[0121] In order to facilitate better implementation of the resource access method provided in the embodiment of the present application, a resource access device is also provided in one embodiment. The meanings of the terms are the same as those in the above resource access method, and the specific implementation details can be referred to the description in the method embodiment.

[0122] The resource access device can be integrated into a computer device, such as Figure 2 As shown, the resource access device may include: a receiving unit 301, an acquiring unit 302, a combining unit 303 and a sending unit 304, specifically as follows:

[0123] (1) Receiving unit 301: used to receive a first access request sent by a browser based on an access URL.

[0124] (2) Acquisition unit 302: used to acquire a corresponding website information set according to the accessed website, where the website information set includes website composition information.

[0125] (3) Combining unit 303: used to perform information combination processing based on the URL composition information contained in the URL information set using a preset combination strategy to obtain a redirect URL corresponding to the accessed URL.

[0126] In one embodiment, the combining unit 303 includes a detection subunit and an information combining subunit, specifically:

[0127] Detection subunit: used for performing information integrity detection on the URL component information contained in the URL information set to obtain the detection result of the URL information set;

[0128] Information combination subunit: used for, if the detection result shows that the URL information set contains complete URL composition information, performing information combination processing on the URL composition information based on a preset combination strategy to obtain a redirect URL corresponding to the accessed URL.

[0129] In one embodiment, the combining unit 303 includes a category determining subunit, an information determining subunit, and a combining processing subunit. Specifically:

[0130] Category determination subunit: for determining the information category to which the missing URL component information in the URL information set belongs if the detection result shows that the URL information set does not contain complete URL component information;

[0131] Information determination subunit: used to determine corresponding candidate component information according to the information category;

[0132] The combination processing subunit is used to perform information combination processing on the URL component information and the candidate component information based on the preset combination strategy to obtain the redirection URL corresponding to the accessed URL.

[0133] In one embodiment, candidate component information has corresponding priorities, and the combination processing unit includes a target information determination subunit and an information combination processing subunit, specifically:

[0134] Target information determination subunit: used to determine target component information according to the priority corresponding to each candidate component information;

[0135] Information combination processing subunit: used for performing information combination processing on the URL component information and the target component information based on a preset combination strategy to obtain the redirect URL corresponding to the accessed URL;

[0136] The resource access device further includes a loop unit, specifically:

[0137] Loop unit: used for returning to the execution and determining the target component information according to the priority corresponding to each candidate component information if the browser cannot access the specified network resource based on the redirection URL; performing information combination processing on the URL component information and the target component information based on the preset combination strategy to obtain the redirection URL corresponding to the accessed URL until the preset conditions are met.

[0138] (4) Sending unit 304: used to send the redirection URL to the browser, so that the browser initiates a second access request based on the redirection URL to access the corresponding network resource.

[0139] In one embodiment, the resource access device further includes a request receiving unit, a URL generating unit, a dividing unit, and a relationship establishing unit. Specifically:

[0140] Request receiving unit: used to receive an access URL generation request, the access URL generation request carries an initial access URL;

[0141] URL generation unit: used to generate an access URL according to a URL generation request;

[0142] Division unit: used for dividing the information of the initial access URL to obtain the URL information set corresponding to the initial access address;

[0143] Relationship establishment unit: used to establish a mapping relationship between the URL information set and the access URL.

[0144] In one embodiment, the URL generation unit includes a first access URL generation subunit and a second access URL generation subunit, specifically:

[0145] A first access URL generation subunit is configured to generate an access URL based on the target URL information if the URL generation request carries the target URL information;

[0146] The second access URL generation subunit is configured to generate an access URL according to an information generation strategy if the URL generation request does not carry target URL information.

[0147] In one embodiment, the first access URL generation subunit includes a query module and a generation module, specifically:

[0148] Query module: used to query the database for access URLs that match the target URL information when the URL generation request carries the target URL information;

[0149] Generation module: used to generate an access URL based on the target URL information if there is no access URL matching the target URL information.

[0150] As can be seen from the above, the resource access device of the embodiment of the present application receives a first access request sent by the browser based on the access URL through the receiving unit 301; the acquisition unit 302 acquires a corresponding URL information set according to the access URL, and the URL information set includes URL composition information; the combination unit 303 performs information combination processing based on the URL composition information contained in the URL information set according to a preset combination strategy to obtain a redirect URL corresponding to the access URL; finally, the redirect URL is sent to the browser through the sending unit 304, so that the browser initiates a second access request based on the redirect URL to access the corresponding network resource.

[0151] In this solution, the server obtains the corresponding URL information set based on the access URL, and obtains the redirect URL based on the URL information set, so that the browser can access the network resources indicated by the redirect URL based on the access URL. Therefore, through the resource access method provided by this application, the user can set the corresponding access URL for the specified URL, so that the network resources can be accessed based on a concise access URL and the URL can be personalized. When sending data containing the URL, the cost of data transmission can be reduced.

[0152] The embodiment of the present application also provides a computer device, which can be a terminal or a server. Figure 3 , which shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:

[0153] The computer device may include one or more processing core processors 1001, one or more computer readable storage media memories 1002, a power supply 1003, an input unit 1004 and other components. Those skilled in the art will understand that Figure 3 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.

[0154] Processor 1001 is the control center of the computer device. It connects the various components of the entire computer device using various interfaces and lines. By running or executing software programs and / or modules stored in memory 1002 and accessing data stored in memory 1002, it performs various functions of the computer device and processes data, thereby providing overall monitoring of the computer device. Optionally, processor 1001 may include one or more processing cores. Preferably, processor 1001 may integrate an application processor and a modem processor. The application processor primarily processes the operating system, user interface, and computer programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 1001.

[0155] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.

[0156] The computer device also includes a power supply 1003 for supplying power to various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 1003 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0157] The computer device may further include an input unit 1004, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0158] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1001 in the computer device will load the executable files corresponding to one or more computer program processes into the memory 1002 according to the following instructions, and the processor 1001 will run the computer programs stored in the memory 1002 to implement various functions as follows:

[0159] Receiving a first access request sent by a browser based on an access URL;

[0160] Obtain a corresponding URL information set according to the accessed URL, where the URL information set includes URL composition information;

[0161] Based on the URL composition information contained in the URL information set, the information is combined and processed using a preset combination strategy to obtain a redirect URL corresponding to the accessed URL;

[0162] The redirection URL is sent to the browser, so that the browser initiates a second access request based on the redirection URL to access the corresponding network resource.

[0163] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.

[0164] As can be seen from the above, the computer device of the embodiment of the present application receives a first access request sent by a browser based on an access URL; obtains a corresponding URL information set according to the access URL, and the URL information set includes URL composition information; based on the URL composition information contained in the URL information set, performs information combination processing according to a preset combination strategy to obtain a redirect URL corresponding to the access URL; sends the redirect URL to the browser, so that the browser initiates a second access request based on the redirect URL to access the corresponding network resource.

[0165] In this solution, the server obtains the corresponding URL information set based on the access URL, and obtains the redirect URL based on the URL information set, so that the browser can access the network resources indicated by the redirect URL based on the access URL. Therefore, through the resource access method provided by this application, the user can set the corresponding access URL for the specified URL, so that the network resources can be accessed based on a concise access URL and the URL can be personalized. When sending data containing the URL, the cost of data transmission can be reduced.

[0166] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.

[0167] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0168] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be loaded by a processor to execute any resource access method provided in the embodiment of the present application.

[0169] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.

[0170] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0171] Since the computer program stored in the computer-readable storage medium can execute any resource access method provided in the embodiments of the present application, the beneficial effects that can be achieved by any resource access method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0172] The above is a detailed introduction to a resource access method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. At the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A resource access method, characterized in that: include: Receiving a first access request sent by a browser based on an access URL; Acquire a corresponding website information set according to the accessed website, wherein the website information set includes website composition information; Based on the URL composition information contained in the URL information set, information combination processing is performed using a preset combination strategy to obtain a redirect URL corresponding to the accessed URL; Sending the redirection URL to the browser, so that the browser initiates a second access request based on the redirection URL to access the corresponding network resource; The method further comprises: Receive an access URL generation request, wherein the access URL generation request carries an initial access URL; Generate the access URL according to the URL generation request; Performing information division processing on the initially accessed website to obtain a website information set corresponding to the initially accessed address; Establishing a mapping relationship between the website information set and the access website; The step of generating the access URL according to the URL generation request includes: If the URL generation request carries target URL information, generating the access URL based on the target URL information; If the URL generation request does not carry target URL information, generating the access URL according to the information generation strategy; If the URL generation request carries target URL information, generating the access URL based on the target URL information includes: When the URL generation request carries target URL information, querying a database to see whether there is an access URL that matches the target URL information; If there is no access URL matching the target URL information, generating the access URL based on the target URL information; If the target URL is a complete URL, the complete target information is used as the access URL; If the target URL information is not a complete URL, access URL information is generated based on the target URL information and the protocol composition information.

2. The method according to claim 1, characterized in that The process of performing information combination processing based on the URL composition information contained in the URL information set and using a preset combination strategy to obtain a redirect URL corresponding to the access URL includes: Performing an information integrity test on the URL component information contained in the URL information set to obtain a test result of the URL information set; If the detection result is that the URL information set contains complete URL component information, the URL component information is subjected to information combination processing based on a preset combination strategy to obtain a redirect URL corresponding to the access URL.

3. The method according to claim 2, characterized in that The method further comprises: If the detection result is that the URL information set does not contain complete URL component information, determining the information category to which the missing URL component information in the URL information set belongs; Determining corresponding candidate component information according to the information category; Based on a preset combination strategy, the website component information and the candidate component information are subjected to information combination processing to obtain a redirection website address corresponding to the accessed website address.

4. The method according to claim 3, characterized in that The candidate component information has a corresponding priority. Based on a preset combination strategy, the URL component information and the candidate component information are combined to obtain a redirect URL corresponding to the access URL, including: Determine the target component information according to the priority corresponding to each candidate component information; Based on a preset combination strategy, the website component information and the target component information are combined to obtain a redirection website corresponding to the accessed website; The method further comprises: If the browser cannot access the specified network resource based on the redirect URL, it returns to execute the target component information determined according to the priority corresponding to each candidate component information; based on the preset combination strategy, the URL component information and the target component information are combined to obtain the redirect URL corresponding to the access URL until the preset conditions are met.

5. The method according to claim 1, wherein The generation strategy includes: Randomly generate a six-digit number as the basic URL information, and generate the access URL based on the basic URL information; or, Add 1 to the generated historical basic URL information to obtain the basic URL information, and generate the access URL based on the basic URL information.

6. A resource access device, characterized in that: include: A receiving unit, configured to receive a first access request sent by a browser based on an access website; an acquiring unit, configured to acquire a corresponding website information set according to the accessed website, wherein the website information set includes website composition information; A combining unit, configured to perform information combining processing based on the URL composition information contained in the URL information set using a preset combining strategy to obtain a redirect URL corresponding to the accessed URL; a sending unit, configured to send the redirection URL to the browser, so that the browser initiates a second access request based on the redirection URL to access the corresponding network resource; Request receiving unit: used to receive an access URL generation request, the access URL generation request carries an initial access URL; URL generation unit: used to generate an access URL according to a URL generation request; Division unit: used for dividing the information of the initial access URL to obtain the URL information set corresponding to the initial access address; Relationship establishment unit: used to establish a mapping relationship between the URL information set and the access URL; The step of generating the access URL according to the URL generation request includes: If the URL generation request carries target URL information, generating the access URL based on the target URL information; If the URL generation request does not carry target URL information, generating the access URL according to the information generation strategy; If the URL generation request carries target URL information, generating the access URL based on the target URL information includes: When the URL generation request carries target URL information, querying a database to see whether there is an access URL that matches the target URL information; If there is no access URL matching the target URL information, generating the access URL based on the target URL information; If the target URL is a complete URL, the complete target information is used as the access URL; If the target URL information is not a complete URL, access URL information is generated based on the target URL information and the protocol composition information.

7. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the resource access method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the resource access method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Page redirection method and device

    CN108021564A

  • Short domain name management method and system, electronic device and storage medium

    CN113438331A