Link redirect methods, device and storage medium
Through the link redirection method, short links are mapped to different long links according to preset rules, which solves the problems of high URL Scheme link modification costs and insufficient real-time performance in the existing technology, and achieves flexibility and cost reduction in resource promotion.
Patent Information
- Application Number
- PCT/CN2024/086843
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-11
- Filing Date
- 2024-04-09
- Publication Date
- 2024-10-17
AI Technical Summary
In scenarios such as resource promotion, the cost of changing existing URL Scheme links is high and the real-time nature cannot meet the needs. As a result, short links need to be frequently modified during resource promotion, which increases the cost and complexity.
By providing a link redirection method, the preset redirection rules are determined based on the short links to be accessed in the target application, the mapping conditions currently met are determined, and the short links are mapped to long links corresponding to the target mapping conditions, realizing the same short link. Links are mapped into different long links under different mapping conditions, reducing the cost of resource promotion.
In the resource promotion scenario, you only need to modify the long link and mapping conditions in the preset redirection rules of the short link to cope with long link changes without modifying the short link, which reduces costs and improves real-time performance and flexibility.
Smart Images

Figure CN2024086843_17102024_PF_FP_ABST
Abstract
Description
Link redirection method, device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on and claims priority to the Chinese patent application with Chinese application number 202310382420.X and application date April 11, 2023. The disclosed content of the Chinese patent application is hereby introduced as a whole into this application. Technical Field
[0003] The embodiments of the present disclosure relate to the field of computer and network communication technology, and in particular to a link redirection method, device, and storage medium. Background Art
[0004] In scenarios such as resource promotion, it is often necessary to place specific links in specific resource locations to achieve promotion. The existing implementation solutions are costly and cannot meet the real-time requirements.
[0005] Summary of the Invention
[0006] The embodiments of the present disclosure provide a link redirection method, device, and storage medium to enable the same short link to be mapped to different long links under different mapping conditions, thereby reducing the cost of resource promotion.
[0007] In a first aspect, an embodiment of the present disclosure provides a link redirection method, comprising:
[0008] Determining, based on the short link to be accessed of the target application, a preset redirection rule corresponding to the short link to be accessed, wherein the preset redirection rule includes a plurality of different long links corresponding to the short link to be accessed and mapping conditions corresponding to the plurality of different long links;
[0009] Determining a currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links;
[0010] Map the short link to be accessed to a long link corresponding to the target mapping condition.
[0011] In a second aspect, an embodiment of the present disclosure provides a link redirection method, comprising:
[0012] Receiving a short link generation instruction for a target application, wherein the short link generation instruction includes a plurality of different long links corresponding to the target short link to be generated, and mapping conditions corresponding to the plurality of different long links;
[0013] Generating target short links for the multiple different long links;
[0014] A redirection rule corresponding to the target short link is generated according to multiple different long links corresponding to the target short link and mapping conditions corresponding to the multiple different long links, and the redirection rule is distributed to the client corresponding to the target application.
[0015] In a third aspect, an embodiment of the present disclosure provides a link redirection device, including:
[0016] a query unit, configured to determine, based on a short link to be accessed of a target application, a preset redirection rule corresponding to the short link to be accessed, wherein the preset redirection rule includes a plurality of different long links corresponding to the short link to be accessed and mapping conditions corresponding to the plurality of different long links;
[0017] a determination unit, configured to determine a currently satisfied target mapping condition from the mapping conditions corresponding to the plurality of different long links;
[0018] A mapping unit is configured to map the short link to be accessed into a long link corresponding to the target mapping condition.
[0019] In a fourth aspect, an embodiment of the present disclosure provides a link redirection device, including:
[0020] An input unit, configured to receive a short link generation instruction for a target application, wherein the short link generation instruction includes a plurality of different long links corresponding to the target short link to be generated, and mapping conditions corresponding to the plurality of different long links;
[0021] A generating unit, configured to generate target short links for the multiple different long links; and generate redirection rules corresponding to the target short links according to the multiple different long links corresponding to the target short links and the mapping conditions corresponding to the multiple different long links.
[0022] A distribution unit is used to distribute the redirection rule to the client corresponding to the target application.
[0023] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
[0024] The memory stores computer-executable instructions;
[0025] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the link redirection method described in the first aspect and various possible designs of the first aspect, or the link redirection method described in the second aspect and various possible designs of the second aspect.
[0026] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the link redirection method described in the first aspect and various possible designs of the first aspect, or the link redirection method described in the second aspect and various possible designs of the second aspect is implemented.
[0027] In the seventh aspect, an embodiment of the present disclosure provides a computer program product, including computer-executable instructions. When a processor executes the computer-executable instructions, it implements the link redirection method described in the first aspect and various possible designs of the first aspect, or the link redirection method described in the second aspect and various possible designs of the second aspect.
[0028] In an eighth aspect, an embodiment of the present disclosure provides a computer program comprising computer-executable instructions. When a processor executes the computer-executable instructions, the link redirection method described in the first aspect and various possible designs of the first aspect, or the link redirection method described in the second aspect and various possible designs of the second aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0030] FIG1 is a flow chart of a link redirection method according to an embodiment of the present disclosure;
[0031] FIG2 is a flow chart of a link redirection method provided by another embodiment of the present disclosure;
[0032] FIG3 is a flow chart of a link redirection method provided by another embodiment of the present disclosure;
[0033] FIG4 is a structural block diagram of a link redirection device provided by an embodiment of the present disclosure;
[0034] FIG5 is a structural block diagram of a link redirection device provided by another embodiment of the present disclosure;
[0035] FIG6 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0037] In scenarios such as resource promotion, it is often necessary to place specific links (such as URL schemes) in specific resource locations to achieve promotion.
[0038] The process of accessing a page through a conventional URL Scheme is that after the user clicks the URL Scheme on the terminal device, the target application to which the URL Scheme belongs is determined, and then it is determined whether the user is currently in the target application. If it is determined that the user is not currently in the target application, the target application is started, and then the target application opens the corresponding page according to the URL Scheme; if it is determined that the user is currently in the target application, the target application directly opens the corresponding page according to the URL Scheme.
[0039] When promoting resources on a large scale, the URL scheme links of the promoted resources often need to be released in large quantities on the Internet. If the URL scheme needs to be changed later, the cost will be relatively high and the effectiveness will not meet the needs.
[0040] In order to solve the above technical problems, the present disclosure provides a link redirection method, hoping to achieve that the same short link can be mapped to different long links under different mapping conditions during the redirection process. In application scenarios such as resource (such as activity page) promotion, only one short link needs to be placed in the resource position. When the long link to be promoted changes, there is no need to modify the short link placed in the resource position, thereby reducing costs. Specifically, the link redirection method includes, based on the short link to be accessed of the target application, determining a preset redirection rule corresponding to the short link to be accessed, wherein the preset redirection rule includes multiple different long links corresponding to the short link to be accessed, and mapping conditions corresponding to the multiple different long links; determining the target mapping condition currently satisfied from the mapping conditions corresponding to the multiple different long links; and mapping the short link to be accessed to the long link corresponding to the target mapping condition.
[0041] The process of accessing a page through the short link URL Scheme disclosed in the present invention is that after the user clicks the short link URL Scheme on the terminal device, the target application to which the short link URL Scheme belongs is determined, and then it is determined whether the user is currently in the target application. If it is determined that the user is not currently in the target application, the target application is started, and then the target application executes the above-mentioned link redirection method to obtain the long link URL Scheme corresponding to the short link URL Scheme, and opens the corresponding page according to the long link URL Scheme; if it is determined that the user is currently in the target application, the target application directly executes the above-mentioned link redirection method to obtain the long link URL Scheme corresponding to the short link URL Scheme, and opens the corresponding page according to the long link URL Scheme.
[0042] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0043] The link redirection method disclosed herein will be described in detail below with reference to specific embodiments.
[0044] Referring to FIG1 , FIG1 is a flow chart of a link redirection method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device, and the link redirection method includes:
[0045] S101. Determine, based on a short link to be accessed of a target application, a preset redirection rule corresponding to the short link to be accessed, wherein the preset redirection rule includes multiple different long links corresponding to the short link to be accessed and mapping conditions corresponding to the multiple different long links.
[0046] In this embodiment, for any short link of the target application, a preset redirection rule can be pre-configured, wherein the preset redirection rule is a mapping rule between a short link and a long link. In this embodiment, the same short link can be mapped to different long links under different mapping conditions, that is, the short link and the long link are in a one-to-many mapping relationship. In this way, if the long link for accessing the resource to be promoted changes in the resource promotion application scenario, it can still be mapped to the same short link, that is, there is no need to modify the short link. It is only necessary to modify (or add) the long link and the corresponding mapping condition in the preset redirection rule corresponding to the short link. The mapping conditions include but are not limited to the attribute conditions and / or time conditions of the target application, that is, the same short link can be mapped to different long links under different attribute conditions and / or different time conditions, wherein the attributes include but are not limited to the version information of the target application.
[0047] In some embodiments, multiple different long links corresponding to the short link to be accessed are used to access different resources to be promoted. The resources to be promoted may be different under different mapping conditions, that is, the mapping conditions corresponding to multiple different long links of multiple different resources to be promoted are different; of course, it is also possible that the resource to be promoted remains unchanged, but there are multiple long links to access the resource to be promoted, and the mapping conditions corresponding to the multiple different long links of the same resource to be promoted are different.
[0048] In some embodiments, the corresponding preset redirection rule of any short link of the target application can be recorded in the configuration file of the target application. For any short link to be accessed, the corresponding preset redirection rule can be found from the configuration file.
[0049] S102: Determine a currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links.
[0050] In this embodiment, since the preset redirection rule of the short link to be accessed corresponds to multiple different long links under different mapping conditions, it is necessary to determine which mapping condition is currently met, and the met mapping condition is the target mapping condition.
[0051] For example, if any of the mapping conditions corresponding to multiple different long links includes the attribute conditions and / or time conditions of the target application, it can be determined whether the current attribute information and / or current time of the target application meets any of the different mapping conditions; if any mapping condition is met, the mapping condition is determined as the target mapping condition.
[0052] S103: Map the short link to be accessed to a long link corresponding to the target mapping condition.
[0053] In this embodiment, after determining the target mapping condition currently met, the long link corresponding to the target mapping condition can be determined from the preset redirection rules corresponding to the short link to be accessed, and then the short link to be accessed can be mapped to the long link corresponding to the target mapping condition. The target application can jump to the corresponding page based on the mapped long link.
[0054] The link redirection method provided in this embodiment determines the preset redirection rule corresponding to the short link to be accessed based on the short link to be accessed of the target application, wherein the preset redirection rule includes multiple different long links corresponding to the short link to be accessed and mapping conditions corresponding to the multiple different long links; determines the currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links; and maps the short link to be accessed to the long link corresponding to the target mapping condition. Through the redirection process, the same short link can be mapped to different long links under different mapping conditions. In application scenarios such as resource promotion, only one short link needs to be placed in the resource position. When the long link to be promoted changes, there is no need to modify the short link placed in the resource position, thereby reducing costs.
[0055] In some embodiments, the link redirection method of this embodiment can be applied to the situation of accessing a short link to be accessed. Before determining the preset redirection rule corresponding to the short link to be accessed based on the short link to be accessed of the target application, it can also include: parsing the short link to be accessed to determine the target application accessed by the short link to be accessed; judging whether the user is currently in the target application. If it is determined that the user is not currently in the target application, the target application is started, and then the above S101-S103 are executed; if it is determined that the user is currently in the target application, the above S101-S103 are directly executed.
[0056] Based on any of the above embodiments, the preset redirection rule corresponding to any short link of the target application can be recorded in the configuration file of the target application. To facilitate the generation of short links and the search for preset redirection rules, this embodiment defines page identification information in the short link, and then establishes a correspondence between the page identification information and the preset redirection rule corresponding to the short link in the configuration file of the target application. The page identification information included in the short link is used to search the configuration file for the preset redirection rule corresponding to the short link.
[0057] More specifically, the short link format in this embodiment is defined as follows:
[0058] H: / / short_link? page_key=xxx
[0059] Here, H is a common identifier of each application (ie, the protocol name scheme), which is defined as H here for convenience of expression.
[0060] short_link is the domain name (host) of the protocol. Developers can define it by themselves. Here it is defined as short_link for convenience.
[0061] page_key=xxx is the identification information of the page, which is used to identify a specific page. In actual situations, "xxx" can be replaced with the identification information of a specific page. In some embodiments, the keyword of the query parameter in the long link can be used. For example, the identification information of the homepage of the Spring Festival activity collection card can be defined as page_key=2023_cny_homepage.
[0062] Furthermore, the preset redirection rule corresponding to any short link of the target application is recorded in the configuration file of the target application. The configuration file of the target application may include one or more preset redirection rules corresponding to short links, for example, a preset redirection rule for the short link H: / / short_link?page_key=page_a (with page_key=page_a for page identification) and a preset redirection rule for the short link H: / / short_link?page_key=page_b (with page_key=page_b for page identification).
[0063] Based on the configuration file of the target application above, if the short link to be accessed is:
[0064] H: / / short_link? page_key=page_b
[0065] Parse the short link to be accessed to obtain the identification information of the page to be accessed included in the short link to be accessed: "page_key=page_b". According to the identification information of the page to be accessed, search the configuration file of the target application for the preset redirection rule corresponding to the short link to be accessed. The preset redirection rule to be found is, for example:
[0066] When the target application version is later than x and the current timestamp is greater than 1675069232, the corresponding long link is "H: / / lynxview?url=a"; when the target application version is earlier than x, the corresponding long link is "H: / / webview?url=c".
[0067] It should be noted that the configuration file of the target application may also contain a short link corresponding to a long link. For example, the short link is:
[0068] H: / / short_link? page_key=2023_cny_homepage
[0069] In the target application's configuration file, the preset redirection rule corresponding to the short link can be found through the identification information of the page corresponding to the short link, "page_key=2023_cny_homepage":
[0070] "2023_cny_homepage":"H: / / lynxview?url=xx",
[0071] It can be seen that the short link only corresponds to one long link "H: / / lynxview?url=xx".
[0072] On the basis of any of the above embodiments, the mapping conditions corresponding to the multiple different long links corresponding to the short link to be accessed may be mutually exclusive, that is, if one of the mapping conditions is currently satisfied, it is impossible to satisfy the other conditions at the same time. Alternatively, the mapping conditions corresponding to the multiple different long links corresponding to the short link to be accessed may not be mutually exclusive, but the mapping conditions corresponding to the multiple different long links have a certain priority order. When determining the currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links, the currently satisfied target mapping condition may be determined from the mapping conditions corresponding to the multiple different long links according to the priority of the mapping conditions corresponding to the multiple different long links. If it is determined that the mapping condition with a high priority is currently satisfied, there is no need to judge the subsequent mapping condition with a low priority, and the mapping condition with a high priority is directly used as the target mapping condition.
[0073] Based on any of the above embodiments, when determining the currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links, if it is determined that any of the mapping conditions corresponding to the multiple different long links is not currently satisfied, the redirection is determined to have failed, and a preset page (such as the homepage of the target application) or a prompt message can be displayed to prompt the user when the redirection fails.
[0074] Based on any of the above embodiments, as shown in FIG2 , when determining the preset redirection rule corresponding to the short link to be accessed according to the short link to be accessed of the target application, the following steps may be included:
[0075] S201. Searching for a preset redirection rule corresponding to the short link to be accessed from a configuration file stored in memory and / or disk;
[0076] S202. If the preset redirection rule corresponding to the short link to be accessed is not found in the configuration file stored in the memory and / or disk, a new configuration file is obtained from the server to update the configuration file stored in the memory and / or disk, and then the preset redirection rule corresponding to the short link to be accessed is searched again in the updated configuration file in the memory and / or disk.
[0077] In this embodiment, the configuration file of the target application can be pulled from the server after the target application is cold started and written to the client's local memory and / or disk. Furthermore, for the short link to be accessed, the preset redirection rule corresponding to the short link to be accessed can be searched from the configuration file stored in the memory and / or disk. In some embodiments, the full configuration file of the target application (including the preset redirection rules corresponding to all short links) can be stored in the disk, and the configuration file of part of the target application (including the preset redirection rules corresponding to part of the short links) can be stored in the memory. The preset redirection rule corresponding to the short link to be accessed can be first searched from the configuration file stored in the memory. If not found, the preset redirection rule corresponding to the short link to be accessed can be searched from the configuration file stored on the disk, thereby effectively improving the query speed.
[0078] However, since the configuration file of the target application on the server may be updated, there may be a situation where the preset redirection rule corresponding to the short link to be accessed is not found from the configuration file stored in the memory and / or disk. Therefore, a new configuration file can be obtained from the server to update the configuration file stored in the memory and / or disk, and then the preset redirection rule corresponding to the short link to be accessed is searched again from the updated configuration file in the memory and / or disk to ensure that the preset redirection rule corresponding to the short link to be accessed is effective, thereby ensuring successful link redirection.
[0079] In addition, a new configuration file can be obtained from the server at a preset interval to update the configuration file in the memory and / or disk storage, and the configuration file in the memory and / or disk storage can be guaranteed to be the latest configuration file through polling. For example, an update can be performed every 3000 seconds.
[0080] In some embodiments, the server in this embodiment may be a Content Delivery Network (CDN) server; the terminal device may send a configuration file acquisition request to the CDN server and receive a new configuration file returned by the CDN server. The CDN server is a distributed storage system that can handle high-volume access with fast access speeds, low cost, and good stability, and can support polling. Using a conventional service API, however, requires addressing high-volume stability and access speed issues, and polling consumes significant service resources and is costly.
[0081] Refer to Figure 3, which is a flowchart of a link redirection method provided by an embodiment of the present disclosure. The method of this embodiment is a method for generating a short link and corresponding redirection rules, which can be applied in a server. The link redirection method includes:
[0082] S301. Receive a short link generation instruction for a target application, wherein the short link generation instruction includes multiple different long links corresponding to the target short link to be generated, and mapping conditions corresponding to the multiple different long links.
[0083] In this embodiment, the user can apply for a short link for the target application, and the server can provide the user with a visual entry and editing interface (such as a form-based input interface). The user can use the interface to input multiple different long links corresponding to the target short link to be generated, as well as the mapping conditions corresponding to the multiple different long links (such as inputting application attributes, time information, etc.), thereby issuing a short link generation instruction to the server.
[0084] S302: Generate target short links for the multiple different long links.
[0085] In this embodiment, the preset short link format can refer to the examples in the above embodiments.
[0086] The short link generation instruction includes identification information of the page corresponding to the target short link. The identification information of the page can be a keyword in the query parameter of the long link, or can be other characters, such as randomly generated or generated according to a specific rule, or set by the user. Furthermore, target short links can be generated for the multiple different long links based on the page identification information and a preset short link format, so that the target short links include the identification information of the page.
[0087] S303: Generate a redirection rule corresponding to the target short link according to the multiple different long links corresponding to the target short link and the mapping conditions corresponding to the multiple different long links.
[0088] In this embodiment, after obtaining multiple different long links corresponding to the target short link and mapping conditions corresponding to the multiple different long links, a redirection rule corresponding to the short link to be edited, such as shown in the above example, can be generated.
[0089] S304: Distribute the redirection rule to the client corresponding to the target application.
[0090] In this embodiment, the redirection rules may be distributed by the server by pushing them to the client corresponding to the target application (the terminal device on which the target application is installed), or by sending them to the client when the client pulls the redirection rules.
[0091] In some embodiments, the redirection rules corresponding to the target short link can be distributed in the form of a configuration file.
[0092] In some embodiments, the redirection rules can be distributed to the client corresponding to the target application through the CDN server. The CDN server is a distributed storage that can handle large-traffic access with fast access speed, low cost and good stability.
[0093] Specifically, the server may write the redirection rules into the database first, and then send them to the CDN server.
[0094] Furthermore, when the terminal device determines the preset redirection rule corresponding to the short link to be accessed based on the short link to be accessed of the target application, if the preset redirection rule corresponding to the short link to be accessed is not found from the configuration file stored in the memory and / or disk, the terminal device requests a new configuration file from the CDN server, and the CDN server queries whether there is a preset redirection rule corresponding to the short link to be accessed in the configuration file stored in it. If there is a preset redirection rule corresponding to the short link to be accessed in the configuration file stored in the CDN server, the configuration file is sent to the terminal device to update the configuration file stored in the memory and / or disk of the terminal device, and the terminal device then searches for the preset redirection rule corresponding to the short link to be accessed from the updated configuration file in the memory and / or disk; if there is no preset redirection rule corresponding to the short link to be accessed in the configuration file stored in the CDN server, the database is requested for a new configuration file, and the new configuration file is sent to the terminal device to update the configuration file stored in the memory and / or disk of the terminal device, and the terminal device then searches for the preset redirection rule corresponding to the short link to be accessed from the updated configuration file in the memory and / or disk.
[0095] Based on any of the above embodiments, before generating target short links for the multiple different long links, the method further includes:
[0096] The multiple different long links corresponding to the target short link and / or the mapping conditions corresponding to the multiple different long links are tested; if the test fails, an error prompt message is displayed.
[0097] In this embodiment, after obtaining the short link generation instruction including multiple different long links corresponding to the target short link to be generated and the mapping conditions corresponding to the multiple different long links, the multiple different long links corresponding to the target short link and / or the mapping conditions corresponding to the multiple different long links can be detected, including but not limited to determining whether the attribute information and time information are accurate, determining whether the mapping conditions corresponding to multiple different long links conflict, determining whether the identification information of the page corresponding to the target short link is repeated with the identification information of the pages corresponding to other short links, etc. If the detection fails, the user can be prompted to modify it, and if the detection passes, the subsequent steps can be continued.
[0098] Corresponding to the link redirection method described in the preceding embodiment, Figure 4 is a block diagram of a link redirection device provided in an embodiment of the present disclosure, which can be used to execute the aforementioned link redirection method on a terminal device. For ease of illustration, only the portions relevant to the present embodiment are shown. Referring to Figure 4 , the link redirection device 400 includes a query unit 401, a determination unit 402, and a mapping unit 403.
[0099] The query unit 401 is configured to determine, based on a short link to be accessed of a target application, a preset redirection rule corresponding to the short link to be accessed, wherein the preset redirection rule includes a plurality of different long links corresponding to the short link to be accessed and mapping conditions corresponding to the plurality of different long links;
[0100] The determination unit 402 is configured to determine a currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links;
[0101] The mapping unit 403 is configured to map the short link to be accessed into a long link corresponding to the target mapping condition.
[0102] In one or more embodiments of the present disclosure, the multiple different long links corresponding to the short link to be accessed are used to access multiple different resources to be promoted, and the mapping conditions corresponding to the multiple different long links of the multiple different resources to be promoted are different; or
[0103] The multiple different long links corresponding to the short link to be accessed are used to access the same resource to be promoted, and the mapping conditions corresponding to the multiple different long links of the same resource to be promoted are different.
[0104] In one or more embodiments of the present disclosure, when determining the preset redirection rule corresponding to the short link to be accessed of the target application based on the short link to be accessed, the query unit 401 is configured to:
[0105] Parsing the short link to be accessed to obtain identification information of the page to be accessed included in the short link to be accessed;
[0106] According to the identification information of the page to be accessed, a preset redirection rule corresponding to the short link to be accessed is searched from the configuration file of the target application, wherein the configuration file includes preset redirection rules corresponding to different preset page identification information.
[0107] In one or more embodiments of the present disclosure, any mapping condition among the mapping conditions corresponding to the multiple different long links includes an attribute condition and / or a time condition of the target application;
[0108] When determining the currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links, the determining unit 402 is configured to:
[0109] Determining whether the current attribute information and / or the current time of the target application satisfies any one of the different mapping conditions;
[0110] If any mapping condition is satisfied, the mapping condition is determined as the target mapping condition.
[0111] In one or more embodiments of the present disclosure, when determining the currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links, the determination unit 402 is configured to:
[0112] According to the priorities of the mapping conditions corresponding to the multiple different long links, a currently satisfied target mapping condition is determined from the mapping conditions corresponding to the multiple different long links.
[0113] In one or more embodiments of the present disclosure, the determining unit 402 is further configured to:
[0114] If it is determined that any mapping condition among the mapping conditions corresponding to the multiple different long links is not currently satisfied, it is determined that the redirection fails, and a preset page or a prompt message is displayed.
[0115] In one or more embodiments of the present disclosure, the judgment unit 402 is further used to parse the short link to be accessed and determine the target application accessed by the short link to be accessed before determining the preset redirection rule corresponding to the short link to be accessed based on the short link to be accessed of the target application; determine whether the user is currently in the target application, and if it is determined that the user is not currently in the target application, start the target application.
[0116] In one or more embodiments of the present disclosure, when determining the preset redirection rule corresponding to the short link to be accessed of the target application based on the short link to be accessed, the query unit 401 is configured to:
[0117] Searching for a preset redirection rule corresponding to the short link to be accessed from a configuration file stored in memory and / or disk;
[0118] If the preset redirection rule corresponding to the short link to be accessed is not found in the configuration file stored in the memory and / or disk, a new configuration file is obtained from the server to update the configuration file stored in the memory and / or disk, and then the preset redirection rule corresponding to the short link to be accessed is searched again from the updated configuration file in the memory and / or disk.
[0119] In one or more embodiments of the present disclosure, the query unit 401 is further configured to:
[0120] A new configuration file is obtained from the server at a preset interval to update the configuration file stored in the local memory and / or disk.
[0121] In one or more embodiments of the present disclosure, the server is a content delivery network (CDN) server; when the query unit 401 obtains a new configuration file from the server, it is used to:
[0122] Send a configuration file acquisition request to the CDN server and receive a new configuration file returned by the CDN server.
[0123] The device provided in this embodiment can be used to execute the technical solution of the above-mentioned terminal device side method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0124] Corresponding to the link redirection method described in the preceding embodiment, Figure 5 is a block diagram of a link redirection device provided in an embodiment of the present disclosure, which can be used to execute the aforementioned server-side link redirection method. For ease of illustration, only the portions relevant to the present embodiment are shown. Referring to Figure 5 , the link redirection device 500 includes an input unit 501, a generation unit 502, and a distribution unit 503.
[0125] The input unit 501 is configured to receive a short link generation instruction for a target application, wherein the short link generation instruction includes a plurality of different long links corresponding to the target short link to be generated, and mapping conditions corresponding to the plurality of different long links;
[0126] Generating unit 502, configured to generate target short links for the multiple different long links; generating redirection rules corresponding to the target short links according to the multiple different long links corresponding to the target short links and the mapping conditions corresponding to the multiple different long links;
[0127] The distribution unit 503 is used to distribute the redirection rule to the client corresponding to the target application.
[0128] In one or more embodiments of the present disclosure, the short link generation instruction further includes identification information of the page corresponding to the target short link;
[0129] When generating target short links for the multiple different long links, the generating unit 502 is configured to:
[0130] Target short links are generated for the multiple different long links according to the identification information of the page and the preset short link format, so that the target short links include the identification information of the page.
[0131] In one or more embodiments of the present disclosure, when distributing the redirection rule to the client corresponding to the target application, the distribution unit 503 is configured to:
[0132] The redirection rule is distributed to the client corresponding to the target application through the CDN server.
[0133] In one or more embodiments of the present disclosure, the input unit 501 is further configured to:
[0134] Detecting multiple different long links corresponding to the target short link and / or mapping conditions corresponding to the multiple different long links;
[0135] If the test fails, an error message will be displayed.
[0136] The device provided in this embodiment can be used to execute the technical solution of the above-mentioned server-side method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.
[0137] Referring to FIG6 , a schematic diagram of the structure of an electronic device 600 suitable for implementing an embodiment of the present disclosure is shown. The electronic device 600 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG6 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0138] As shown in Figure 6, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0139] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 6 shows an electronic device 600 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0140] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in any method of the embodiment of the present disclosure are performed.
[0141] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0142] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0143] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in any one of the above embodiments.
[0144] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0145] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0147] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0148] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0149] In a first aspect, according to one or more embodiments of the present disclosure, a link redirection method is provided, comprising:
[0150] Determining, based on the short link to be accessed of the target application, a preset redirection rule corresponding to the short link to be accessed, wherein the preset redirection rule includes a plurality of different long links corresponding to the short link to be accessed and mapping conditions corresponding to the plurality of different long links;
[0151] Determining a currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links;
[0152] Map the short link to be accessed to a long link corresponding to the target mapping condition.
[0153] According to one or more embodiments of the present disclosure, the multiple different long links corresponding to the short link to be accessed are used to access multiple different resources to be promoted, and the mapping conditions corresponding to the multiple different long links of the multiple different resources to be promoted are different; or
[0154] The multiple different long links corresponding to the short link to be accessed are used to access the same resource to be promoted, and the mapping conditions corresponding to the multiple different long links of the same resource to be promoted are different.
[0155] According to one or more embodiments of the present disclosure, determining a preset redirection rule corresponding to a short link to be accessed of a target application according to the short link to be accessed includes:
[0156] Parsing the short link to be accessed to obtain identification information of the page to be accessed included in the short link to be accessed;
[0157] According to the identification information of the page to be accessed, a preset redirection rule corresponding to the short link to be accessed is searched from the configuration file of the target application, wherein the configuration file includes preset redirection rules corresponding to different preset page identification information.
[0158] According to one or more embodiments of the present disclosure, any mapping condition among the mapping conditions corresponding to the multiple different long links includes an attribute condition and / or a time condition of the target application;
[0159] The determining, from the mapping conditions corresponding to the multiple different long links, a target mapping condition that is currently satisfied, includes:
[0160] Determining whether the current attribute information and / or the current time of the target application satisfies any one of the different mapping conditions;
[0161] If any mapping condition is satisfied, the mapping condition is determined as the target mapping condition.
[0162] According to one or more embodiments of the present disclosure, determining the currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links includes:
[0163] According to the priorities of the mapping conditions corresponding to the multiple different long links, a currently satisfied target mapping condition is determined from the mapping conditions corresponding to the multiple different long links.
[0164] According to one or more embodiments of the present disclosure, the method further includes:
[0165] If it is determined that any mapping condition among the mapping conditions corresponding to the multiple different long links is not satisfied currently, it is determined that the redirection fails, and the attribute displays a preset page or displays a prompt message.
[0166] According to one or more embodiments of the present disclosure, before determining the preset redirection rule corresponding to the short link to be accessed based on the short link to be accessed of the target application, the method further includes:
[0167] Parsing the short link to be accessed to determine the target application accessed by the short link to be accessed;
[0168] Determine whether the target application is currently in the target application; if it is determined that the target application is not currently in the target application, start the target application.
[0169] According to one or more embodiments of the present disclosure, determining a preset redirection rule corresponding to a short link to be accessed of a target application according to the short link to be accessed includes:
[0170] Searching for a preset redirection rule corresponding to the short link to be accessed from a configuration file stored in memory and / or disk;
[0171] If the preset redirection rule corresponding to the short link to be accessed is not found in the configuration file stored in the memory and / or disk, a new configuration file is obtained from the server to update the configuration file stored in the memory and / or disk, and then the preset redirection rule corresponding to the short link to be accessed is searched again from the updated configuration file in the memory and / or disk.
[0172] According to one or more embodiments of the present disclosure, the method further includes:
[0173] A new configuration file is obtained from the server at a preset interval to update the configuration file stored in the local memory and / or disk.
[0174] According to one or more embodiments of the present disclosure, the server is a content delivery network (CDN) server; and obtaining a new configuration file from the server includes:
[0175] Send a configuration file acquisition request to the CDN server and receive a new configuration file returned by the CDN server.
[0176] In a second aspect, according to one or more embodiments of the present disclosure, a link redirection method is provided, comprising:
[0177] Receiving a short link generation instruction for a target application, wherein the short link generation instruction includes a plurality of different long links corresponding to the target short link to be generated, and mapping conditions corresponding to the plurality of different long links;
[0178] Generating target short links for the multiple different long links;
[0179] A redirection rule corresponding to the target short link is generated according to multiple different long links corresponding to the target short link and mapping conditions corresponding to the multiple different long links, and the redirection rule is distributed to the client corresponding to the target application.
[0180] According to one or more embodiments of the present disclosure, the short link generation instruction further includes identification information of the page corresponding to the target short link;
[0181] Generating target short links for the multiple different long links includes:
[0182] Target short links are generated for the multiple different long links according to the identification information of the page and the preset short link format, so that the target short links include the identification information of the page.
[0183] According to one or more embodiments of the present disclosure, distributing the redirection rule to the client corresponding to the target application includes:
[0184] The redirection rule is distributed to the client corresponding to the target application through the CDN server.
[0185] According to one or more embodiments of the present disclosure, before generating target short links for the multiple different long links, the method further includes:
[0186] Detecting multiple different long links corresponding to the target short link and / or mapping conditions corresponding to the multiple different long links;
[0187] If the test fails, an error message will be displayed.
[0188] In a third aspect, according to one or more embodiments of the present disclosure, a link redirection device is provided, including:
[0189] a query unit, configured to determine, based on a short link to be accessed of a target application, a preset redirection rule corresponding to the short link to be accessed, wherein the preset redirection rule includes a plurality of different long links corresponding to the short link to be accessed and mapping conditions corresponding to the plurality of different long links;
[0190] a determination unit, configured to determine a currently satisfied target mapping condition from the mapping conditions corresponding to the plurality of different long links;
[0191] A mapping unit is configured to map the short link to be accessed into a long link corresponding to the target mapping condition.
[0192] According to one or more embodiments of the present disclosure, the multiple different long links corresponding to the short link to be accessed are used to access multiple different resources to be promoted, and the mapping conditions corresponding to the multiple different long links of the multiple different resources to be promoted are different; or
[0193] The multiple different long links corresponding to the short link to be accessed are used to access the same resource to be promoted, and the mapping conditions corresponding to the multiple different long links of the same resource to be promoted are different.
[0194] According to one or more embodiments of the present disclosure, when the query unit determines the preset redirection rule corresponding to the short link to be accessed based on the short link to be accessed of the target application, it is configured to:
[0195] Parsing the short link to be accessed to obtain identification information of the page to be accessed included in the short link to be accessed;
[0196] According to the identification information of the page to be accessed, a preset redirection rule corresponding to the short link to be accessed is searched from the configuration file of the target application, wherein the configuration file includes preset redirection rules corresponding to different preset page identification information.
[0197] According to one or more embodiments of the present disclosure, any mapping condition among the mapping conditions corresponding to the multiple different long links includes an attribute condition and / or a time condition of the target application;
[0198] When the determination unit determines the currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links, the determination unit is configured to:
[0199] Determining whether the current attribute information and / or the current time of the target application satisfies any one of the different mapping conditions;
[0200] If any mapping condition is satisfied, the mapping condition is determined as the target mapping condition.
[0201] According to one or more embodiments of the present disclosure, when the judgment unit determines the currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links, it is configured to:
[0202] According to the priorities of the mapping conditions corresponding to the multiple different long links, a currently satisfied target mapping condition is determined from the mapping conditions corresponding to the multiple different long links.
[0203] According to one or more embodiments of the present disclosure, the judgment unit is further configured to:
[0204] If it is determined that any mapping condition among the mapping conditions corresponding to the multiple different long links is not satisfied currently, it is determined that the redirection fails, and the attribute displays a preset page or displays a prompt message.
[0205] According to one or more embodiments of the present disclosure, the judgment unit is further used to parse the short link to be accessed and determine the target application accessed by the short link to be accessed before determining the preset redirection rule corresponding to the short link to be accessed based on the short link to be accessed of the target application; judge whether the user is currently in the target application, and if it is determined that the user is not currently in the target application, start the target application.
[0206] According to one or more embodiments of the present disclosure, when the query unit determines the preset redirection rule corresponding to the short link to be accessed based on the short link to be accessed of the target application, it is configured to:
[0207] Searching for a preset redirection rule corresponding to the short link to be accessed from a configuration file stored in memory and / or disk;
[0208] If the preset redirection rule corresponding to the short link to be accessed is not found in the configuration file stored in the memory and / or disk, a new configuration file is obtained from the server to update the configuration file stored in the memory and / or disk, and then the preset redirection rule corresponding to the short link to be accessed is searched again from the updated configuration file in the memory and / or disk.
[0209] According to one or more embodiments of the present disclosure, the query unit is further configured to:
[0210] A new configuration file is obtained from the server at a preset interval to update the configuration file stored in the local memory and / or disk.
[0211] According to one or more embodiments of the present disclosure, the server is a content delivery network (CDN) server; when the query unit obtains a new configuration file from the server, it is configured to:
[0212] Send a configuration file acquisition request to the CDN server and receive a new configuration file returned by the CDN server.
[0213] In a fourth aspect, according to one or more embodiments of the present disclosure, a link redirection device is provided, including:
[0214] An input unit, configured to receive a short link generation instruction for a target application, wherein the short link generation instruction includes a plurality of different long links corresponding to the target short link to be generated, and mapping conditions corresponding to the plurality of different long links;
[0215] A generating unit, configured to generate a target short link for the multiple different long links; and generate a redirection rule corresponding to the target short link according to the multiple different long links corresponding to the target short link and the mapping conditions corresponding to the multiple different long links.
[0216] A distribution unit is used to distribute the redirection rule to the client corresponding to the target application.
[0217] According to one or more embodiments of the present disclosure, the short link generation instruction further includes identification information of the page corresponding to the target short link;
[0218] When generating target short links for the multiple different long links, the generating unit is configured to:
[0219] Target short links are generated for the multiple different long links according to the identification information of the page and the preset short link format, so that the target short links include the identification information of the page.
[0220] According to one or more embodiments of the present disclosure, when distributing the redirection rule to the client corresponding to the target application, the distribution unit is configured to:
[0221] The redirection rule is distributed to the client corresponding to the target application through the CDN server.
[0222] According to one or more embodiments of the present disclosure, the input unit is further configured to:
[0223] Detecting multiple different long links corresponding to the target short link and / or mapping conditions corresponding to the multiple different long links;
[0224] If the test fails, an error message will be displayed.
[0225] In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0226] The memory stores computer-executable instructions;
[0227] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the link redirection method described in the first aspect and various possible designs of the first aspect, or the link redirection method described in the second aspect and various possible designs of the second aspect.
[0228] In the sixth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the processor executes the computer-executable instructions, the link redirection method described in the first aspect and various possible designs of the first aspect, or the link redirection method described in the second aspect and various possible designs of the second aspect is implemented.
[0229] In the seventh aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising computer-executable instructions. When a processor executes the computer-executable instructions, the link redirection method described in the first aspect and various possible designs of the first aspect, or the link redirection method described in the second aspect and various possible designs of the second aspect is implemented.
[0230] In an eighth aspect, according to one or more embodiments of the present disclosure, a computer program is provided, comprising computer-executable instructions. When a processor executes the computer-executable instructions, the link redirection method described in the first aspect and various possible designs of the first aspect, or the link redirection method described in the second aspect and various possible designs of the second aspect is implemented.
[0231] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0232] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0233] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A link redirection method, comprising: Determine, according to the short link to be accessed of the target application, a preset redirection rule corresponding to the short link to be accessed, wherein the preset redirection rule includes a plurality of different long links corresponding to the short link to be accessed and mapping conditions corresponding to the plurality of different long links; Determining a currently satisfied target mapping condition from the mapping conditions corresponding to the multiple different long links; The short link to be accessed is mapped to a long link corresponding to the target mapping condition.
2. The method according to claim 1, wherein: The multiple different long links corresponding to the short link to be accessed are used to access multiple different resources to be promoted, and the mapping conditions corresponding to the multiple different long links of the multiple different resources to be promoted are different; or The multiple different long links corresponding to the short link to be accessed are used to access the same resource to be promoted, and the mapping conditions corresponding to the multiple different long links of the same resource to be promoted are different.
3. The method according to claim 1 or 2, wherein: The step of determining, according to the short link to be accessed of the target application, a preset redirection rule corresponding to the short link to be accessed includes: Parsing the short link to be visited, and obtaining identification information of the page to be visited included in the short link to be visited; According to the identification information of the page to be visited, a preset redirection rule corresponding to the short link to be visited is searched from the configuration file of the target application, wherein the configuration file includes preset redirection rules corresponding to different preset page identification information.
4. The method according to any one of claims 1 to 3, wherein: Any mapping condition among the mapping conditions corresponding to the multiple different long links includes an attribute condition and / or a time condition of a target application; The determining, from the mapping conditions corresponding to the multiple different long links, the target mapping condition currently satisfied includes: Determining whether the current attribute information and / or the current time of the target application satisfies any mapping condition of the different mapping conditions; If any mapping condition is satisfied, the mapping condition is determined as the target mapping condition.
5. The method according to any one of claims 1 to 4, wherein: The determining, from the mapping conditions corresponding to the multiple different long links, the target mapping condition currently satisfied includes: According to the priorities of the mapping conditions corresponding to the multiple different long links, a currently satisfied target mapping condition is determined from the mapping conditions corresponding to the multiple different long links.
6. The method according to any one of claims 1 to 5, wherein: The method further comprises: If it is determined that any mapping condition among the mapping conditions corresponding to the multiple different long links is not satisfied currently, it is determined that the redirection fails, and a preset page is displayed or a prompt message is displayed.
7. The method according to any one of claims 1 to 6, wherein: The step of determining, according to the short link to be accessed of the target application, a preset redirection rule corresponding to the short link to be accessed includes: Searching for a preset redirection rule corresponding to the short link to be accessed from a configuration file stored in memory and / or disk; If the preset redirection rule corresponding to the short link to be accessed is not found in the configuration file stored in the memory and / or disk, a new configuration file is obtained from the server to update the configuration file stored in the memory and / or disk, and then the preset redirection rule corresponding to the short link to be accessed is searched again from the updated configuration file in the memory and / or disk.
8. The method according to claim 7, wherein: The server is a content delivery network CDN server; The obtaining of a new configuration file from the server includes: Send a configuration file acquisition request to the CDN server, and receive a new configuration file returned by the CDN server.
9. A link redirection method, comprising: Receiving a short link generation instruction for a target application, wherein the short link generation instruction includes a plurality of different long links corresponding to the target short link to be generated, and mapping conditions corresponding to the plurality of different long links; Generating target short links for the multiple different long links; A redirection rule corresponding to the target short link is generated according to a plurality of different long links corresponding to the target short link and mapping conditions corresponding to the plurality of different long links, and the redirection rule is distributed to a client corresponding to the target application.
10. The method according to claim 9, wherein: The short link generation instruction also includes identification information of the page corresponding to the target short link; The generating target short links for the different long links includes: Generate target links for different long links according to the identification information of the page and the preset short link format The target short link includes the identification information of the page.
11. A link redirection device, comprising: A query unit, configured to determine, according to a short link to be accessed of a target application, a preset redirection rule corresponding to the short link to be accessed, wherein the preset redirection rule includes a plurality of different long links corresponding to the short link to be accessed and mapping conditions corresponding to the plurality of different long links; A determination unit, configured to determine a currently satisfied target mapping condition from among the mapping conditions corresponding to the plurality of different long links; A mapping unit is used to map the short link to be accessed into a long link corresponding to the target mapping condition.
12. A link redirection device, comprising: An input unit, configured to receive a short link generation instruction for a target application, wherein the short link generation instruction includes a plurality of different long links corresponding to the target short link to be generated, and mapping conditions corresponding to the plurality of different long links; A generating unit, used for generating a target short link according to a preset short link format; Generate a redirection rule corresponding to the target short link according to the multiple different long links corresponding to the target short link and the mapping conditions corresponding to the multiple different long links A distribution unit is used to distribute the redirection rule to the client corresponding to the target application.
13. An electronic device comprising: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 10.
14. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 10 is implemented.
15. A computer program product, comprising computer executable instructions, and when a processor executes the computer executable instructions, the method according to any one of claims 1 to 10 is implemented.
16. A computer program, comprising computer executable instructions, wherein when a processor executes the computer executable instructions, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Short link skipping method and device, short link server and storage medium
CN109918586A
Access processing method and device, equipment and storage medium
CN111767481A
Method and System For URL Shortening
US20200380059A1
