Method and system for replacing short link with long link and accessing short link
By generating and sending short links, the problem of long links being too long in text messages is solved, the simplification of text messages content and link security is achieved, ensuring the convenience of user access and the reduction of communication costs.
Patent Information
- Application Number
- CN202411105196.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, long links are too long when sending SMS, resulting in the link content having to be divided into multiple SMS messages, affecting access convenience and significantly increasing communication costs.
By prefabricating a 62-bit printable string array, a random 32-bit UUID is generated and divided into 8 groups. The modulo 62 operation is used to form an 8-bit short link and store it in the database and Redis cache. The third-party system sends the short link to the user through SMS. , after clicking the user, visit the system to find long links from the cache or database for redirection.
Significantly reduce the number of SMS characters, ensure link integrity and accessibility, simplify SMS content, improve readability and user access willingness, and improve link security through high randomness and unpredictability.
Smart Images

Figure CN119128294A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and specifically provides a method and system for implementing long link replacement of short link and access. Background Art
[0002] The present invention discloses a method for converting a long link into a short link, comprising the following steps: S11: concatenating user dimension parameters with the long link; S12: obtaining the short link through a hash algorithm;
[0003] S13: convert to base 62; S14: query whether a base 62 short link already exists in the local database, if so, return the short link, if not, generate a long-short link correspondence record in the local database; S15: refresh local cache; S16: refresh cluster cache; S17: short link splicing resolution service address; S18: return the last short link; the present invention also discloses a method for converting a short link to a long link, comprising the following steps: S21: obtain the resolved domain name in the short link; S22: directional domain name resolution service; S23: obtain the long link from the cache; the present invention can track which specific user clicked the short link after the user clicks the short link, which is convenient for subsequent more detailed data analysis, and at the same time, the short link has no cache hot spot problem.
[0004] The links for good and bad reviews generated by existing business systems are too long, so when they are sent via SMS, the link content has to be split into multiple SMS messages.
[0005] This practice not only affects the convenience of people accessing valid links for evaluation, but also significantly increases communication costs due to the increase in the number of text messages. Summary of the invention
[0006] The present invention aims at the above-mentioned deficiencies of the prior art and provides a method for implementing a long link replacement and access of a short link with strong practicability.
[0007] A further technical task of the present invention is to provide a system that is reasonably designed, safe and applicable, and can replace long links with short links and access them.
[0008] The technical solution adopted by the present invention to solve its technical problem is:
[0009] A method for replacing a short link with a long link and accessing the short link comprises the following steps:
[0010] S1. First, pre-prepare a set of 62-bit printable string arrays;
[0011] S2. The third-party system requests to obtain the short link service;
[0012] S3, the system generates random 32-bit UUIDs and divides them into 8 groups;
[0013] S4. Return the generated short link to the business system;
[0014] S5. The third-party system sends the short link as the evaluation link to the applicant via SMS;
[0015] S6. When the applicant clicks the short link in the text message, the system's replacement service will be accessed.
[0016] Furthermore, in step S1, the character string includes uppercase and lowercase English letters and numbers, and the character string is randomly shuffled.
[0017] Furthermore, in step S2, the third-party system uses the long link to be replaced as an input parameter request interface. After receiving the request, it uses an algorithm to generate a corresponding short link, stores the correspondence between the long and short links in the database and Redis cache, and then returns the short link to the third-party system.
[0018] Furthermore, in step S3, the system generates a random 32-bit UUID and divides it into 8 groups, divides the UUIDs into 8 groups of 4, and then performs a modulo 62 operation on each group to obtain a result, and finally uses these 8 operation results as indexes to take out corresponding characters from the prefabricated string array and splice them together to form a complete 8-bit short link.
[0019] Furthermore, in step S5, after receiving the text message, the person in charge clicks to access the short link, which will request the system. After receiving the request, the system uses the short link to find the corresponding long link from the Redis cache or database and redirects the access.
[0020] A system for replacing long links with short links and accessing them. First, a set of 62-bit printable string arrays is prefabricated. A third-party system requests the short link service. The system generates a random 32-bit UUID and divides it into 8 groups. The generated short link is returned to the business system. The third-party system sends the short link as an evaluation link to the person who handles the business via SMS. Finally, when the person who handles the business clicks the short link in the SMS, the system's replacement service is accessed.
[0021] Furthermore, the character string includes uppercase and lowercase English letters and numbers, and the character string is randomly shuffled.
[0022] Furthermore, when a third-party system requests a short link service, the third-party system uses the long link to be replaced as an input parameter request interface. After receiving the request, an algorithm is used to generate a corresponding short link, and the correspondence between the long and short links is stored in the database and Redis cache, and then the short link is returned to the third-party system.
[0023] Furthermore, the system generates a random 32-bit UUID and divides it into 8 groups, divides the UUIDs into 8 groups of 4, and then obtains a result by performing a modulo 62 operation on each group. Finally, these 8 operation results are used as indexes to take out the corresponding characters from the prefabricated string array and splice them together to form a complete 8-bit short link.
[0024] Furthermore, after receiving the text message, the person in charge clicks on the short link to access the short link, which will request the system. After receiving the request, the system uses the short link to find the corresponding long link from the Redis cache or database and redirect the access.
[0025] Compared with the prior art, the method and system for implementing long link replacement and access with short link of the present invention have the following outstanding beneficial effects:
[0026] The present invention not only greatly reduces the number of characters in the text message content, but also ensures the integrity and accessibility of the link. In actual business scenarios, an evaluation link with a length of up to 800 characters can be replaced with a short link with only 8 characters. This conversion not only greatly simplifies the text message content and reduces the probability of text message segmentation, but also improves the readability of the text message and the user's willingness to access it due to the simplicity of the short link.
[0027] In addition, the short link generation algorithm is highly random and unpredictable, which provides additional protection for the security of the link. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Attached Figure 1 The present invention is a flowchart of a method for implementing a method of replacing a short link with a long link and accessing the short link. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] A best embodiment is given below:
[0032] like Figure 1 As shown, a method for implementing long link replacement and short link access in this embodiment has the following steps:
[0033] S1. First, pre-prepare a set of 62-bit printable string arrays;
[0034] The string includes uppercase and lowercase English letters and numbers, and the string is randomly shuffled to ensure its randomness and uniqueness.
[0035] S2. The third-party system requests to obtain the short link service;
[0036] The third-party system uses the long link that needs to be replaced as the input parameter request interface. After receiving the request, it uses an algorithm to generate the corresponding short link, stores the correspondence between the long and short links in the database and Redis cache, and then returns the short link to the third-party system.
[0037] S3, the system generates random 32-bit UUIDs and divides them into 8 groups;
[0038] The system first generates a random 32-bit UUID to ensure the uniqueness and unpredictability of the link, divides the UUID into 8 groups of 4, then performs a modulo 62 operation on each group to get a result, and finally uses these 8 operation results as indexes to take out the corresponding characters from the prefabricated string array and splice them together to form a complete 8-bit short link.
[0039] S4. Return the generated short link to the business system;
[0040] S5. The third-party system sends the short link as the evaluation link to the applicant via SMS;
[0041] S6. When the applicant clicks the short link in the text message, the replacement service of the system will be accessed;
[0042] After receiving the text message, the person in charge clicks on the short link to access the content. The access will request the system. After receiving the request, the system will use the short link to find the corresponding long link from the Redis cache or database, redirect the access, and seamlessly jump the user to the real evaluation link to complete the evaluation process.
[0043] Based on the above method, a system in this embodiment realizes the replacement of long links with short links and access. First, a set of 62-bit printable string arrays is prefabricated. The third-party system requests to obtain the short link service. The system generates a random 32-bit UUID and divides it into 8 groups. The generated short link is returned to the business system. The third-party system sends the short link as an evaluation link to the person in charge via SMS. Finally, when the person in charge clicks the short link in the SMS, he will access the system's replacement service.
[0044] The character string includes uppercase and lowercase English letters and numbers, and the character string is randomly shuffled.
[0045] When a third-party system requests a short link service, the third-party system uses the long link to be replaced as the input parameter request interface. After receiving the request, it uses an algorithm to generate the corresponding short link, stores the correspondence between the long and short links in the database and Redis cache, and then returns the short link to the third-party system.
[0046] The system generates a random 32-bit UUID and divides it into 8 groups. The UUIDs are divided into 8 groups of 4 each, and each group is subjected to a modulo 62 operation to obtain a result. Finally, these 8 operation results are used as indexes to take out the corresponding characters from the prefabricated string array and splice them together to form a complete 8-bit short link.
[0047] After receiving the text message, the service provider clicks on the short link to access the service. The access will request the system. After receiving the request, the system uses the short link to find the corresponding long link from the Redis cache or database and redirect the access.
[0048] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any technical solutions that comply with the claims of the present invention and any appropriate changes or substitutions made by ordinary technicians in the relevant technical field shall fall within the patent protection scope of the present invention.
[0049] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for replacing a short link with a long link and accessing the link, characterized in that: The steps are as follows: S1. First, pre-prepare a set of 62-bit printable string arrays; S2. The third-party system requests to obtain the short link service; S3, the system generates random 32-bit UUIDs and divides them into 8 groups; S4. Return the generated short link to the business system; S5. The third-party system sends the short link as the evaluation link to the applicant via SMS; S6. When the applicant clicks the short link in the text message, the system's replacement service will be accessed.
2. A method for implementing long link replacement and short link access according to claim 1, characterized in that: In step S1, the character string includes uppercase and lowercase English letters and numbers, and the character string is randomly shuffled.
3. The method for implementing long link replacement and short link access according to claim 2, characterized in that: In step S2, the third-party system uses the long link to be replaced as the input parameter request interface. After receiving the request, it uses an algorithm to generate the corresponding short link, stores the correspondence between the long and short links in the database and Redis cache, and then returns the short link to the third-party system.
4. The method for implementing long link replacement and short link access according to claim 3, characterized in that: In step S3, the system generates a random 32-bit UUID and divides it into 8 groups. The UUIDs are divided into 8 groups of 4 each, and each group is subjected to a modulo 62 operation to obtain a result. Finally, the 8 operation results are used as indexes to take out the corresponding characters from the prefabricated string array and splice them together to form a complete 8-bit short link.
5. A method for implementing long link replacement and short link access according to claim 4, characterized in that: In step S5, after receiving the text message, the person in charge clicks to access the short link, which will request the system. After receiving the request, the system uses the short link to find the corresponding long link from the Redis cache or database and redirects the access.
6. A system for replacing a long link with a short link and accessing the link, characterized in that: First, a set of 62-bit printable string arrays is prefabricated. The third-party system requests the short link service. The system generates a random 32-bit UUID and divides it into 8 groups. The generated short link is returned to the business system. The third-party system sends the short link as an evaluation link via SMS to the person who handles the matter. Finally, when the person who handles the matter clicks the short link in the SMS, the system's replacement service will be accessed.
7. A system for implementing long link replacement and short link access according to claim 6, characterized in that: The character string includes uppercase and lowercase English letters and numbers, and the character string is randomly shuffled.
8. A system for implementing long link replacement and short link access according to claim 7, characterized in that: When a third-party system requests a short link service, the third-party system uses the long link to be replaced as the input parameter request interface. After receiving the request, it uses an algorithm to generate the corresponding short link, stores the correspondence between the long and short links in the database and Redis cache, and then returns the short link to the third-party system.
9. A system for implementing long link replacement and short link access according to claim 8, characterized in that: The system generates a random 32-bit UUID and divides it into 8 groups. The UUIDs are divided into 8 groups of 4 each, and each group is subjected to a modulo 62 operation to obtain a result. Finally, these 8 operation results are used as indexes to take out the corresponding characters from the prefabricated string array and splice them together to form a complete 8-bit short link.
10. A system for implementing long link replacement of short link and access according to claim 9, characterized in that: After receiving the text message, the service provider clicks on the short link to access the service. The access will request the system. After receiving the request, the system uses the short link to find the corresponding long link from the Redis cache or database and redirect the access.
Citation Information
Patent Citations
Long and short link switching method and system
CN106375189A
Short link generation method and device and server
CN110134889A
Method for mutual conversion between long links and short links
CN113542448A
Multi-tenant community application service centralized management method
CN115643287A
File sharing method and system based on short chain service
CN116418577A
