Short link generation method, computer equipment and readable storage medium

By converting the long integer identifier into an N-digit string and generating encrypted strings with a key, the security and high concurrency problems of the existing short link generation methods are solved, and an efficient, secure and extensible short link generation method is realized.

CN119995884AActive Publication Date: 2025-05-13SHENZHEN HUOLI TIAN HUI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510458102.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-05-13
Estimated Expiration
2045-04-14

AI Technical Summary

Technical Problem

The existing short link generation methods have poor security, are prone to cracking and tampering, and are prone to duplication and slow response under high concurrent requests, which cannot meet the needs of large-scale information dissemination.

Method used

By obtaining the long integer identifier, converting it into an N-digit initial character set based on the preset N-digit initial character set, and combining the key string to determine the target key character and offset value, generating an N-digit offset string and encrypted string, and finally splicing it into a short link with the domain name and symbol.

Benefits of technology

It realizes a safe, efficient and scalable short link generation method, reduces the length of short links, improves storage and transmission efficiency, enhances data security, and supports high and generation, which is suitable for large-scale business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119995884A_ABST
    Figure CN119995884A_ABST
Patent Text Reader

Abstract

The invention relates to a short link generation method, computer equipment and a readable storage medium, and relates to the technical field of internet information. The method comprises the following steps: acquiring a long integer identifier; based on the N-nary initial character set, converting the long integer identifier into an N-nary initial character string; determining a target key character in the key character string according to the long integer identifier and the key character string; determining an offset bit value according to the target key character and the N-ary initial character set; determining an N-nary offset character string according to the offset bit value, the N-nary initial character set and the N-nary initial character string; determining an encrypted character string according to the N-ary offset character string, the random character string and the key character string; and splicing the domain name, the short link symbol, the encrypted character string and the target key character into a short link. Compared with a traditional method for directly mapping the short link through the database ID, the technical scheme of the application provides higher security, expandability and anti-conflict capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet information technology, and in particular to a short link generation method, a computer device and a readable storage medium. Background Art

[0002] With the development of the digital age, long links have exposed more and more problems, such as lengthy characters, excessive display space, difficulty in complete presentation on platforms with character length restrictions, and users are prone to errors when entering information manually, which leads to the inability to access the entered long links normally, seriously affecting information dissemination efficiency and user experience.

[0003] In practical applications, in order to improve mapping efficiency and facilitate the generation and management of long links, the system usually assigns a unique long integer identifier to each long link. The current common method of generating short links is to hash the long links to obtain short links, and then establish a correspondence between the short links and the long integer identifiers. However, the short links generated in this way have poor security and are easy to be cracked and tampered with, which may lead to user information leakage or be directed to malicious websites. At the same time, under high concurrent requests, problems such as duplicate generated short links and slow responses are prone to occur, which cannot meet the needs of large-scale information dissemination.

[0004] Therefore, there is an urgent need for a safe and efficient short link generation method. Summary of the invention

[0005] Based on this, it is necessary to provide a short link generation method, a computer device and a readable storage medium to address the above technical problems.

[0006] In a first aspect, a short link generation method is provided, the method comprising: Get the long integer identifier; Based on a preset N-ary initial character set, convert the long integer identifier into an N-ary initial character string; Determine the target key character in the key string according to the long integer identifier and the preset key string; Determine the offset bit value according to the target key character and the N-ary initial character set; Determine an N-ary offset character string according to the offset bit value, the N-ary initial character set and the N-ary initial character string; Determine an encryption string according to the N-ary offset string, a preset random string and the key string; The preset domain name, the short link symbol, the encrypted string and the target key characters are concatenated into a short link.

[0007] As an optional implementation, the long integer identifier is a self-incrementing primary key or a user ID in the database.

[0008] As an optional implementation manner, determining the target key character in the key string according to the long integer identifier and the preset key string includes: Taking the long integer identifier modulo the length of the key character string to determine a first key index; A first target character corresponding to the first key index is taken out from the key character string, and the first target character is determined as the target key character.

[0009] As an optional implementation manner, determining the offset bit value according to the target key character and the N-ary initial character set includes: Based on the N-ary initial character set, converting the target key character into a long integer value; The long integer value is determined as the offset bit value.

[0010] As an optional implementation manner, determining the N-ary offset character string according to the offset bit value, the N-ary initial character set, and the N-ary initial character string includes: Dynamically cyclically shifting the N-ary initial character set according to the offset bit value to generate an N-ary offset character set; The characters in the N-ary initial character string are replaced according to the N-ary offset character set to determine the N-ary offset character string.

[0011] As an optional implementation manner, the formula for dynamically cyclically shifting the N-ary initial character set according to the offset bit value is: ; Among them, i is the character a in the N-base initial character set i The position number, is the offset bit value, k is the length of the N-base initial character set, and j is the character a in the N-base initial character set i The position number after shifting.

[0012] As an optional implementation manner, determining the encryption string according to the N-ary offset string, the preset random string and the key string includes: Convert the character located at the first preset position in the N-ary offset string to an integer and then perform modulo operation on the length of the random string to obtain a second key index; A second target character corresponding to the second key index is taken out from the key character string, and the second target character is added to a second preset position in the N-ary offset character string to obtain the encrypted character string.

[0013] As an optional implementation manner, the key character string and the random character string are both character strings with no repeated characters.

[0014] In a second aspect, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the processor executes the computer program, the method steps described in any one of the first aspects are implemented.

[0015] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method steps described in any one of the first aspects are implemented.

[0016] The present application provides a short link generation method, the method comprising: obtaining a long integer identifier; based on a preset N-base initial character set, converting the long integer identifier into an N-base initial character string; determining the target key character in the key character string according to the long integer identifier and the preset key character string; determining the offset bit value according to the target key character and the N-base initial character set; determining the N-base offset character string according to the offset bit value, the N-base initial character set and the N-base initial character string; determining the encrypted character string according to the N-base offset character string, a preset random character string and the key character string; splicing the preset domain name, short link symbol, the encrypted character string and the target key character into a short link, the technical solution provided by the embodiment of the present application brings at least the following beneficial effects: through efficient base conversion, key perturbation, multi-dimensional mapping and short link optimization, a safe, efficient and scalable short link generation method is provided, which has the following beneficial effects: reducing the length of the short link and improving the storage and transmission efficiency. Preventing ID incremental exposure and enhancing data security. Using key perturbation to improve the unpredictability of short links. It supports high concurrency generation, prevents conflicts, and is suitable for large-scale business scenarios. It is compatible with different encryption modes and is suitable for various scenarios such as short URLs, invitation codes, and resource identifiers. The short link format is standardized and compatible with a variety of terminals and access methods. Compared with the traditional database ID direct mapping short link method, the technical solution of this application provides stronger security, scalability, and anti-conflict capabilities, and is suitable for a variety of high-security, high-concurrency short link demand scenarios.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] 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 only 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.

[0019] Figure 1 A flowchart of a short link generation method provided in an embodiment of the present application; Figure 2 A flowchart of a method for determining a target key character provided in an embodiment of the present application; Figure 3 A flowchart of a method for determining an offset bit value provided in an embodiment of the present application; Figure 4 A flowchart of a method for determining an N-ary offset string provided in an embodiment of the present application; Figure 5 A flowchart of a method for determining an encrypted string provided in an embodiment of the present application; Figure 6 A flowchart of an example of a short link generation method provided in an embodiment of the present application; Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0021] The following will describe in detail a short link generation method provided by an embodiment of the present application in combination with a specific implementation method. Figure 1 A flowchart of a short link generation method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the specific steps are as follows: Step S101, obtaining a long integer identifier.

[0022] In implementation, the long integer identifier can be a database auto-increment primary key, or a unique identifier such as a user ID or an order number. For example, the long integer identifier can be set to 123456789.

[0023] As an optional implementation, the long integer identifier is a self-incrementing primary key or a user ID in the database.

[0024] Step S102: based on a preset N-ary initial character set, convert the long integer identifier into an N-ary initial character string.

[0025] In implementation, the computer can start iteration based on a preset N-base initial character set, and each time calculate the remainder of the value corresponding to the long integer identifier modulo the N-base radix, the remainder corresponds to the subscript of a character in the N-base initial character set, that is, the serial number of the character, which can start from 0. After indexing the character, it can be added to the front of the current string. Then the value corresponding to the long integer identifier is divided by the N-base radix and rounded down to update the value corresponding to the long integer identifier. Repeat this process until the value corresponding to the long integer identifier becomes 0, and the final string is the converted N-base initial string. The N-base character set can adopt a 62-base character set, such as: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ. You can perform continuous modulo and integer division on the long integer identifier, map the remainder to the 62-base character set, and arrange them in reverse order. For example, to convert 123456789 to 62-base, you can calculate 123456789÷62=1991238, the remainder is 33, and the character corresponding to index 33 in the N-base character set (the 62-base character set) is x. Then calculate 1991238÷62=32116, the remainder is 6, and the character corresponding to index 6 in the N-base character set is 6. Continue to calculate 32116÷62=518, the remainder is 0, and the character corresponding to index 0 in the N-base character set is 0. Continue to calculate 518÷62=8, the remainder is 22, and the character corresponding to index 22 in the N-base character set is m. Finally, calculate 8÷62=0, the remainder is 8, and the character corresponding to index 8 in the N-base character set is 8. The characters indexed in the overall calculation process can be arranged in reverse order to obtain an N-base initial character string of 8m0x6.

[0026] Step S103, determining the target key character in the key character string according to the long integer identifier and the preset key character string.

[0027] In implementation, the computer may determine the target key character in the key string according to the long integer identifier and the preset key string.

[0028] As an optional implementation, Figure 2 A flowchart of a method for determining a target key character provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the specific steps of determining the target key character in the key string according to the long integer identifier and the preset key string in step S103 are as follows: Step S201: Taking the modulus of the length of the key character string by the long integer identifier to determine the first key index.

[0029] In practice, the length of the key string is limited (for example, 62 characters). The long integer identifier can be a very large number, which may far exceed the index range of the key string. By taking the modulus of the length of the key string, the long integer identifier can be mapped to the index range of the key string. For example: the long integer identifier is 123456789, and the preset key string can be x1y2z3a4b5c6d7e8 f9g0hijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, key length is 62, first key index = 123456789 mod 62 = 39.

[0030] Step S202: extract a first target character corresponding to a first key index from the key character string, and determine the first target character as a target key character.

[0031] In implementation, the first key index is an index position in the key string. The character corresponding to the index is taken from the key string as the target key character. The character will be used for encryption mapping and short link splicing in subsequent steps. Taking the first key index as 39 as an example, the character at index 39 in the key string is the target key character. For example, in the embodiment of step S202, the character at index 39 in the key string is n.

[0032] Step S104, determining the offset bit value according to the target key character and the N-ary initial character set.

[0033] In implementation, the offset bit value may be used for encryption processing, and the computer may determine the offset bit value based on the target key character and the N-ary initial character set.

[0034] As an optional implementation, Figure 3 A flowchart of a method for determining an offset bit value provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the specific steps of determining the offset bit value according to the target key character and the N-ary initial character set in step S104 are as follows: Step S301, based on the N-ary initial character set, convert the target key character into a long integer value.

[0035] In implementation, the computer may find the index of the target key character in the N-ary initial character set and multiply the index by the base N of the N-ary initial character set. If it is a target key string, then for the i-th character S of the target key string i, find its index index in the N-ary initial character set (S i ), calculate index (S i ) and N i The product of is added to the result. After traversing the entire target key string, the accumulated result is the converted long integer value. If a character in the target key string is not found in the N-base initial character set, it is determined to be an illegal character and the computer can throw a corresponding exception. For example: the target key character is n, in the 62-base character set 012345 The index in 6789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ is 23, so the long integer value of the target key character n after conversion = 23×62 0 =23.

[0036] Step S302, determining the long integer value as the offset bit value.

[0037] In implementation, the computer may determine the long integer value after the target key character is converted as the offset bit value.

[0038] Step S105, determining the N-ary offset character string according to the offset bit value, the N-ary initial character set and the N-ary initial character string.

[0039] In implementation, the computer may determine the N-ary offset character string according to the offset bit value, the N-ary initial character set, and the N-ary initial character string.

[0040] As an optional implementation, Figure 4 A flowchart of a method for determining an N-ary offset string provided in an embodiment of the present application, such as Figure 4 As shown, in step S105, the specific steps of determining the N-ary offset character string according to the offset bit value, the N-ary initial character set and the N-ary initial character string are as follows: Step S401, dynamically cyclically shifting the N-ary initial character set according to the offset bit value to generate an N-ary offset character set.

[0041] In implementation, a dynamic circular shift method can be used to shift the N-ary initial character set to ensure that the character mapping changes and improve the encryption strength. The shift method can be left or right. For example: N-ary initial character set 0123456789abcdefghijklmnopqrstuvwxyzABCDEFG HIJKLMNOPQRSTUVWXYZ, shift right 23 bits, that is, move the first 23 characters to the end, and get the N-ary offset character set FGHIJKLMNOPQRSTUVWXYZ0123456789abcde fghijklmnopqrstuvwxyzABCDE. The N-ary offset character set can be used for character replacement to ensure the unpredictability of short links.

[0042] Step S402: replace characters in the N-ary initial character string according to the N-ary offset character set to determine the N-ary offset character string.

[0043] In implementation, the computer can replace each character in the N-ary initial string (generated in step S102) with a new character according to the character mapping rule. The index of each character in the N-ary initial string in the N-ary initial character set can be found. Replace with the character at the same index position in the N-ary offset string. For example: the N-ary initial string (calculated in step S102) is 8m0x6. Replace character by character. Table 1 is a character offset comparison table provided in an embodiment of the present application, as shown in Table 1: Table 1

[0044] That is, the N-ary offset string is Q1FnM. The N-ary offset string is used as the basis of the encrypted string to enhance security.

[0045] As an optional implementation, the formula for dynamically cyclically shifting the N-ary initial character set according to the offset bit value in step S401 is: .

[0046] Where i is the character S in the N-ary initial character set. i The position number, is the offset bit value, k is the length of the N-base initial character set, and j is the character S in the N-base initial character set. i The position number after shifting.

[0047] Step S106, determining an encryption string according to the N-ary offset string, a preset random string and a key string.

[0048] In implementation, the computer may determine the encryption string according to the N-ary offset string, the preset random string and the key string.

[0049] As an optional implementation, Figure 5 A flowchart of a method for determining an encrypted string provided in an embodiment of the present application, such as Figure 5 As shown, in step S106, the specific steps of determining the encrypted string according to the N-ary offset string, the preset random string and the key string are as follows: Step S501: Convert the character at the first preset position in the N-ary offset string into an integer and then perform modulo operation on the length of the random string to obtain a second key index.

[0050] In implementation, the first preset position (such as the first position of the string) can be pre-set, and the character at the first preset position in the N-ary offset string is converted into an integer, and then modulo calculation is performed to calculate the integer value modulo the preset random string length to ensure that the index does not exceed the random string range. For example, the N-ary offset string can be Q1FnM generated in step S105. The first preset position is set to the first character Q, and the N-ary character set is 0123456789abcdefghijklmnopqrstuvwxyzABCDE FGHIJKLMNOPQRSTUVWXYZ, Q belongs to the uppercase letters (A~Z). A's index = 36 (starting from 0). Q is the 17th letter in the uppercase alphabet, and Q's index = 36+(17-1)=42. Preset a random string, such as abc123XYZ, with a length of 9, and calculate the second key index = 42mod9=6.

[0051] Step S502: extract a second target character corresponding to a second key index from the key character string, and add the second target character to a second preset position in the N-ary offset character string to obtain an encrypted character string.

[0052] In implementation, the computer can use the second key index to find the second target character in the key string, and then insert the character at a specific position in the N-ary offset string, such as setting a second preset position (such as the front, middle or end of the string) to increase the complexity of the short link and make it more difficult to guess. For example: the key string is x1y2z3a4b5c6d7e8f9g0hijklmnopqrstuvwxyzABCD EFGHIJKLMNOPQRSTUVWXYZ, the second key index = 6, the character corresponding to index 6 in the key string is a (the index starts from 0), the second preset position is set to before the N-ary offset string, the N-ary offset string is Q1FnM, and the encrypted string after inserting the second target character a is aQ1FnM.

[0053] As an optional implementation, the key character string and the random character string are both character strings with no repeated characters.

[0054] Step S107, concatenate the preset domain name, short link symbol, encrypted string and target key characters into a short link.

[0055] In implementation, the computer can concatenate the preset domain name, short link symbol, encryption string and target key character into a short link, and the preset short link format can be domain name + " / " + encryption string + target key character. For example: the preset domain name is http: / / short.ly, the encryption string is aQ1FnM, and the target key character is n, then the short link generated by the computer is http: / / short.ly / aQ1FnMn.

[0056] As an optional implementation, Figure 6 This is a flowchart of an example of a short link generation method provided in an embodiment of the present application, such as Figure 6 As shown, the specific steps are as follows: Step S601, obtaining a long integer ID, wherein the long integer ID is a natural self-increasing digital sequence without repeated characters.

[0057] Step S602: based on a preset N-ary initial character set S, convert the long integer identifier ID into an N-ary initial character string SN.

[0058] Step S603: Taking the modulus of the length of the preset key string K by the long integer identifier ID to determine the first key index Y.

[0059] Step S604: extract the first target character corresponding to the first key index Y from the key character string K, and determine the first target character as the target key character X.

[0060] Step S605: based on the N-ary initial character set S, convert the target key character X into a long integer value C.

[0061] Step S606: determine the long integer value C as the offset value .

[0062] Step S607, dynamically cyclically shifting the N-ary initial character set S according to the offset bit value ∆ to generate an N-ary offset character set S'.

[0063] Step S608: Replace characters in the N-ary initial character string SN according to the N-ary offset character set S' to determine the N-ary offset character string SN'.

[0064] Step S609: convert the character at the first preset position in the N-ary offset string SN' into an integer and then perform modulo operation on the length of the preset random string R to obtain a second key index Ω.

[0065] Step S610: Take out the second target character K corresponding to the second key index Ω from the key string K. Ω , and the second target character K Ω Add to the second preset position in the N-ary offset string SN' to obtain the encrypted string SN''.

[0066] Step S611, concatenate the preset domain name, short link symbol, encrypted string SN'' and target key character X into a short link.

[0067] The embodiment of the present application provides a method for generating a short link, the method comprising: obtaining a long integer identifier. Based on a preset N-base initial character set, converting the long integer identifier into an N-base initial character string. Determining the target key character in the key character string according to the long integer identifier and the preset key character string. Determining the offset bit value according to the target key character and the N-base initial character set. Determining the N-base offset character string according to the offset bit value, the N-base initial character set and the N-base initial character string. Determining the encrypted character string according to the N-base offset character string, the preset random character string and the key character string. Concatenating the preset domain name, short link symbol, encrypted character string and target key character into a short link. The embodiment of the present application provides an efficient, secure and controllable short link generation method through long integer identifier conversion, encryption processing and short link generation. By mapping the high-base character set, the length of the long integer identifier can be shortened and the storage and transmission efficiency can be improved. In addition, since the database ID is directly used as a short link, it is easy to guess and traverse. This solution uses base conversion and key perturbation to make the generated short link irregular. Even if the attacker obtains part of the short link, the original long integer identifier cannot be reversed to protect the database structure. Based on the modulus operation of the long integer identifier and the key string, each short link has a dynamic change characteristic. The offset bit is calculated by the target key character to ensure that the short links of the same long integer identifier under different key conditions are different. The N-base initial character set is dynamically cyclically shifted so that the mapping relationship changes with the key string. The technician can replace the key to ensure that the short link encryption method is flexible and controllable to meet different security requirements. The random string and the target key character are embedded in the final short link, and the random perturbation level can be adjusted to meet different encryption requirements. The technical solution provided in the embodiment of the present application can be applied to short URL services, invitation code generation, resource unique identification, transaction orders, and logistics order number mapping. The base, key, and perturbation parameters can be adjusted according to different business requirements to make the solution have good versatility.

[0068] It should be understood that although Figures 1 to 6The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figures 1 to 6 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0069] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.

[0070] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program that can be run on the processor. When the processor executes the computer program, the method steps of dynamically identifying flight changes are implemented. Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the computer device may include a processor 701, a system bus 702, a non-volatile storage medium 703, an internal memory 704, a network interface 705, a display screen 706, and an input device 707. Among them, the non-volatile storage medium 703 stores an operating system 7031 and a computer program 7032. The processor 701 is used to execute the computer program 7032 to implement the above-mentioned short link generation method steps. The system bus 702 is used to connect the processor 701, the non-volatile storage medium 703, the internal memory 704, the network interface 705, the display screen 706, and the input device 707 to ensure efficient communication between the components. The internal memory 704 is used to temporarily store the running programs and data, helping the processor 701 to quickly access the required information, thereby improving the overall system performance. The network interface 705 (such as a network card) enables the computer device to be connected to a local area network or the Internet to achieve data transmission and remote communication. The display screen 706 is used to present the short link generated by the computer device to the user. The input device 707 (such as a keyboard, a mouse, a touch screen, etc.) is used to allow the user to input a long integer identifier and a short link generation instruction to the computer device to achieve interactive operations with the computer device.

[0071] In one embodiment, a computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned short link generation method when executed by a processor.

[0072] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0073] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0074] It should also 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 display, data for analysis, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0075] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0076] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0077] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A short link generation method, characterized in that: The method comprises: Get the long integer identifier; Based on a preset N-ary initial character set, convert the long integer identifier into an N-ary initial character string; Determine the target key character in the key string according to the long integer identifier and the preset key string; Determine the offset bit value according to the target key character and the N-ary initial character set; Determine an N-ary offset character string according to the offset bit value, the N-ary initial character set and the N-ary initial character string; Determine an encryption string according to the N-ary offset string, a preset random string and the key string; The preset domain name, the short link symbol, the encrypted string and the target key characters are concatenated into a short link.

2. The method according to claim 1, characterized in that The long integer identifier is a self-incrementing primary key or a user ID in the database.

3. The method according to claim 1, characterized in that The step of determining the target key character in the key string according to the long integer identifier and the preset key string includes: Taking the long integer identifier modulo the length of the key character string to determine a first key index; A first target character corresponding to the first key index is taken out from the key character string, and the first target character is determined as the target key character.

4. The method according to claim 1, characterized in that The step of determining the offset bit value according to the target key character and the N-ary initial character set includes: Based on the N-ary initial character set, converting the target key character into a long integer value; The long integer value is determined as the offset bit value.

5. The method according to claim 1, characterized in that The step of determining the N-ary offset character string according to the offset bit value, the N-ary initial character set, and the N-ary initial character string includes: Dynamically cyclically shifting the N-ary initial character set according to the offset bit value to generate an N-ary offset character set; The characters in the N-ary initial character string are replaced according to the N-ary offset character set to determine the N-ary offset character string.

6. The method according to claim 5, characterized in that The formula for dynamically cyclically shifting the N-ary initial character set according to the offset bit value is: ; Among them, i is the character a in the N-base initial character set i The position number, is the offset bit value, k is the length of the N-base initial character set, and j is the character a in the N-base initial character set i The position number after shifting.

7. The method according to claim 1, characterized in that The step of determining an encryption string according to the N-ary offset string, a preset random string, and the key string includes: Convert the character located at the first preset position in the N-ary offset string to an integer and then perform modulo operation on the length of the random string to obtain a second key index; A second target character corresponding to the second key index is taken out from the key character string, and the second target character is added to a second preset position in the N-ary offset character string to obtain the encrypted character string.

8. The method according to claim 7, characterized in that The key character string and the random character string are both character strings with no repeated characters.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Short link generation method and system, short link analysis method and system, equipment and storage medium

    CN114039801A

  • Short link generation method and device, equipment and medium

    CN115203600A

  • Short link generation method and device, electronic equipment and storage medium

    CN117171461A