CN115640471A - Short link generation method and device, computer equipment and storage medium - Google Patents

Short link generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115640471A
CN115640471A CN202211249855.9A CN202211249855A CN115640471A CN 115640471 A CN115640471 A CN 115640471A CN 202211249855 A CN202211249855 A CN 202211249855A CN 115640471 A CN115640471 A CN 115640471A
Authority
CN
China
Prior art keywords
link
short
long
short link
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211249855.9A
Other languages
Chinese (zh)
Inventor
赖宏发
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Consumer Finance Co Ltd
Original Assignee
Ping An Consumer Finance Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Consumer Finance Co Ltd filed Critical Ping An Consumer Finance Co Ltd
Priority to CN202211249855.9A priority Critical patent/CN115640471A/en
Publication of CN115640471A publication Critical patent/CN115640471A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the technical field of computers, can be applied to the fields of medical treatment and finance, and particularly relates to a short link generation method, a short link generation device, short link generation equipment and a short link generation medium, wherein the method comprises the following steps: obtaining a long chain joint to be treated; processing the long link to obtain a short code of the long link; generating a corresponding short link according to the short code and a protocol in the long link; searching a preset link storage library according to the short link, and judging whether the short link exists or not; if not, outputting the short link, and storing the short link in the link storage library. According to the method and the device, the short links corresponding to the long links are generated according to the long links, so that the generation technology of the short links is optimized, and the generation efficiency of the short links is improved.

Description

Short link generation method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a short link generation method, apparatus, computer device, and storage medium.
Background
Short links, also known as short addresses, short web addresses, web address shortages, URL shortages, etc., refer to a technology and service on the internet that can provide a very short URL in place of a possibly longer URL. The user may redirect to the original URL when accessing the shortened URL. Most URL shortening services are provided with APIs. URL shortening services are widely used in the medical and financial fields.
When long links related to the medical and financial fields need to be shared with related users, corresponding short links can be generated according to the long links, and then the short links are shared. The short link generation can be realized in two ways, one way is to apply the MD5 algorithm to the long network address to generate a 32-bit string, divide the string into 4 segments, each segment has 1 byte, and cyclically process the four segments to take 4 bytes. Then each segment and 0x3fffffff (30 bits 1) and operation, these 30 bits are divided into 6 segments, every 5 bits of numbers are used as index of alphabet to obtain specific character, and the operation is successively proceeded to obtain 6-bit character string. At the initial stage of system online, the generated long network addresses are few and can not be repeated, and the algorithm is simple and effective; but are not suitable for application in large data volume scenarios, repeated short links may occur. The other method is that the unique character string is generated after the number and the character combination are mapped to a certain degree, and then the short link is stored in a cache and a database. However, the database generally has a large storage amount, which results in low query performance, and when a cache has a problem, the database is a performance bottleneck. Therefore, optimizing the short link generation technology and improving the short link generation efficiency are problems to be solved at present.
Disclosure of Invention
The present application mainly aims to provide a short link generation method, an apparatus, a computer device, and a storage medium, and aims to optimize a short link generation technology and improve short link generation efficiency.
In order to achieve the above object, the present application provides a short link generation method, including:
obtaining a long chain junction to be treated;
processing the long link to obtain a short code of the long link;
generating a corresponding short link according to the short code and a protocol in the long link;
searching a preset link storage library according to the short link, and judging whether the short link exists or not;
if not, outputting the short link, and storing the short link in the link storage library.
Further, the processing the long link to obtain the short code of the long link includes:
calculating the long link according to a decimal algorithm to obtain characters consisting of sixty-two letters and data;
processing the character through a snowflake algorithm to obtain the character ID;
and converting by combining the character ID with the character to obtain the short code of the long link.
Further, the generating a corresponding short link according to the short code in combination with the protocol in the long link includes:
acquiring a protocol of the long link;
and splicing the short codes according to a preset rule and the protocol to obtain the short link corresponding to the long link.
Further, the storing the short link in the link store comprises:
and storing the short links and the long links corresponding to the short links together in a link repository, wherein the link repository stores the short links and the long links in an aof and rdb mixed persistence mode, and the link repository is a redis cluster.
Further, after the storing the short link in the link repository, the method further includes:
sending an access request based on the short-chain contact;
intercepting a short code of the short link based on the access request;
judging whether the short code is invalid or not;
if not, skipping to the corresponding long link according to the short link;
and accessing the corresponding page based on the long chain.
Further, the skipping to the corresponding long link according to the short link further includes:
judging whether the short link has a password or not;
if yes, triggering a password acquisition request;
and receiving the password based on the password obtaining request, and unlocking the short link.
Further, the accessing the corresponding page based on the long link includes:
acquiring state information of a server;
judging whether the server can be normally accessed according to the state information;
and if not, suspending sending the access request to the server.
The present application further provides a short link generation device, the device includes:
the acquisition module is used for acquiring a long link to be processed;
the processing module is used for processing the long link to obtain the short code of the long link;
the generating module is used for generating a corresponding short link according to the short code and the protocol in the long link;
the searching module is used for searching a preset link storage library according to the short link and judging whether the short link exists or not;
and the output module is used for outputting the short link and storing the short link in the link storage library if the short link is not stored in the link storage library.
The present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the short link generation method according to any one of the above when executing the computer program.
The present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the short link generation methods described above.
The embodiment of the application provides a short link generation method, which comprises the steps of processing a long link by obtaining the long link to be processed, obtaining a short code of the long link, generating a corresponding short link according to the short code and a protocol in the long link, searching a preset link storage library according to the short link, judging whether the short link exists or not, outputting the short link if the short link does not exist, storing the short link in the link storage library, realizing automatic generation of the short link, optimizing a generation technology of the short link, and further improving generation efficiency of the short link.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating a short link generation method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a short link generation method according to another embodiment of the present application;
FIG. 3 is a schematic flow chart diagram illustrating a short link generation method according to another embodiment of the present application;
FIG. 4 is a schematic flow chart diagram illustrating a short link generation method according to another embodiment of the present application;
FIG. 5 is a schematic flowchart illustrating a short link generation method according to another embodiment of the present application;
FIG. 6 is a schematic flowchart illustrating a short link generation method according to another embodiment of the present application;
FIG. 7 is a schematic structural diagram of an embodiment of a short link generation apparatus according to the present application;
FIG. 8 is a block diagram illustrating a computer device according to an embodiment of the present invention.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, an embodiment of the present application provides a short link generation method, which includes steps S10 to S50, and the detailed description of each step of the short link generation method is as follows.
And S10, obtaining the long chain joint to be processed.
The embodiment is applied to generating the corresponding short link according to the long link in the fields of finance and medical treatment. Legal and regular long links are obtained based on the public website, the long links can be network links, short message links, picture links and the like, and the long links are preferably financial information links or medical information links in the medical field. The acquisition of the long link provides an effective basis for the subsequent generation of the corresponding short link according to the long link.
And S20, processing the long link to obtain the short code of the long link.
In this embodiment, after the long chain link to be processed is obtained, the long chain link is processed to obtain the short code of the long chain link. Specifically, the long link is calculated according to a decimal algorithm, characters consisting of sixty-two letters and data are obtained, the characters are processed through a snowflake algorithm, the character ID is obtained, conversion is carried out according to the character ID and the characters, the short code of the long link is obtained, and the short code is obtained to provide an effective basis for the subsequent generation of the short link.
And S30, generating a corresponding short link according to the short code and the protocol in the long link.
In this embodiment, after the long link is processed to obtain the short code of the long link, the corresponding short link is generated according to the short code and the protocol in the long link. Specifically, the short link is generated based on the long link correspondence, and therefore, a link protocol in the short link should be the same as a link protocol of the long link, so that the protocol of the long link is obtained first, and then the short codes are spliced according to a preset rule in combination with the protocol, so as to obtain the short link corresponding to the long link. The preset rule is a rule for splicing the short code and the protocol, the preset rule further comprises information such as short code failure time and passwords, and the preset rule can be set according to actual needs. And generating a corresponding short link according to the short code and a protocol in the long link, so as to realize the automatic generation of the short link.
And S40, searching a preset link storage library according to the short link, and judging whether the short link exists or not.
In this embodiment, after the short link is generated according to the short code and the protocol in the long link, a preset link repository is searched according to the short link, and whether the short link exists is determined. The link repository is a repository preset for storing short links; and searching a preset link storage library according to the short link, and judging whether the short link exists or not, so as to prevent the repeated short link from being generated and further influence the subsequent page access based on the short link.
And S50, if not, outputting the short link, and storing the short link in the link storage library.
In this embodiment, after searching a preset link repository according to the short link and determining whether the short link exists, if the short link does not exist, it is determined that the short link is a unique short link, that is, the short link does not exist identically, and page access based on the short link cannot be affected subsequently, so that the short link is output, and the short link and a long link corresponding to the short link are stored in the link repository together, where the link repository stores the short link in an aof and rdb mixed persistence manner, and the link repository is a redis cluster. The short link is stored in the link storage library, so that when page access is required to be performed according to the short link subsequently, the short link does not need to be generated again, and the short link can be directly read, so that the link generation time is saved, and the user experience is improved.
The embodiment provides a short link generation method, which includes acquiring a long link to be processed, processing the long link, acquiring a short code of the long link, generating a corresponding short link according to the short code in combination with a protocol in the long link, searching a preset link repository according to the short link, judging whether the short link exists, outputting the short link if the short link does not exist, storing the short link in the link repository, realizing automatic generation of the short link, optimizing a short link generation technology, and further improving short link generation efficiency.
Referring to fig. 2, in an embodiment, the processing the long link to obtain the short code of the long link includes the following steps S21 to S23:
s21, calculating the long link according to a decimal algorithm to obtain sixty-two-digit letters and characters formed by data;
s22, processing the character through a snowflake algorithm to obtain the character ID;
and S23, converting by combining the characters according to the character ID to obtain the short code of the long link.
In this embodiment, the decimal algorithm is calculated based on a 10-based numerical system, and the most widely used carry system is used. The snowflake algorithm is a Twitter open-sourced distributed ID generation algorithm. Clock callback refers to the situation that when the snowflake algorithm is dependent on the time of the server for processing, the machine fails to dial back the time of the server, and therefore repeated IDs are generated. Calculating the long link according to a decimal algorithm to obtain characters consisting of sixty-two-bit letters and data, wherein the characters consisting of the sixty-two-bit letters and the data sequentially consist of 26 lower-case letters, 26 upper-case letters and 10 numbers; and processing the characters through a snowflake algorithm to obtain the character ID, wherein the snowflake algorithm enables each character in the characters consisting of sixty-two letters and data to generate a unique corresponding ID along with the increment of processing time, and when the characters are processed through the snowflake algorithm to obtain the character ID, the processing condition needs to be monitored so as to prevent the clock callback condition and further generate repeated IDs. Specifically, whether the processing time of the character processed by the snowflake algorithm is within a preset time difference range is judged, and if yes, the character is waited to finish the processing by itself; if the time difference is not within the preset time difference range, intervening an ID generation process by using an expansion position so as to obtain the character ID; and finally, converting the short code of the long link by combining the character ID with the character. And processing the long link to obtain the short code of the long link, and providing an effective basis for generating the short link according to the short code subsequently.
Referring to fig. 3, in one embodiment, the generating the corresponding short link according to the short code and the protocol in the long link includes the following steps S31 to S32:
s31, acquiring a protocol of the long link;
and S32, splicing the short codes according to a preset rule and the protocol to obtain a short link corresponding to the long link.
In this embodiment, a protocol refers to a set of rules for specifying how "control information" and "data information" are exchanged between communication entities, such as application processes interacting within a network computing environment, and is generally divided into two types, connectionless (connection-less) and connection-oriented (connection-oriented). And acquiring a protocol of the long link, and splicing the short codes according to a preset rule by combining the protocol to further obtain the short link corresponding to the long link. And splicing the short codes based on a preset rule in combination with a protocol and a domain name to obtain short links, so as to realize the generation of the short links. When the short link is generated, a user-defined short link can be generated according to the user requirement, specifically, the user inputs a user-defined short code according to the actual requirement, a receiving terminal receives the user-defined short code and triggers a short code generation request, a redis cluster is inquired based on the short code generation request to verify whether the user-defined short code exists, if the user-defined short code exists, the user-defined short code is triggered to be modified, the user-defined short code is modified by the user, a new user-defined short code which is different from the existing short code of the redis cluster is obtained, then the short link is generated according to the new user-defined short code, and the short link is kept in the redis cluster, so that the generation of the short link is realized.
In one embodiment, said storing said short link in said link repository comprises:
and storing the short links and the long links corresponding to the short links together in a link repository, wherein the link repository stores the short links and the long links in an aof and rdb mixed persistence mode, and the link repository is a redis cluster.
In this embodiment, in order to make the link storage library storing links large enough, a redis cluster is used for link storage, and the redis cluster can store mass data, so that the short links can be completely stored while high concurrency is generated, and high-performance access is provided. The redis cluster is stored in a mixed persistence mode of aof and rdb, when the redis cluster fails, rapid recovery is facilitated, specifically, the generated aof and rdb files are synchronized to other addresses of a local server and other servers, and can be stored in a remote cloud server at regular time, so that loss of the aof and rdb files caused by server disk failure is effectively prevented in a storage mode of multiple copies, and the completeness of the redis data is further ensured. The short link and the corresponding long link are stored in the link storage library together, so that the short link can be directly read without generating the short link again when the webpage is accessed according to the short link, the link generation time is saved, and the user experience is improved.
Referring to FIG. 4, in one embodiment, after storing the short link in the link repository, the following steps S51-S55 are further included:
s51, sending an access request based on the short-chain contact;
s52, intercepting the short code of the short link based on the access request;
s53, judging whether the short code is invalid or not;
s54, if not, skipping to the corresponding long link according to the short link;
and S55, accessing the corresponding page based on the long chain.
In this embodiment, when a web page corresponding to a short link needs to be accessed, the short link is read, an access request is sent based on the short link contact, a server intercepts a short code of the short link based on the access request, and judges whether the short code is invalid or not, if the short link is invalid, a page corresponding to the short link cannot be accessed, an effective short link should be generated again, and then page access is performed with the effective short link; and if the short link is an effective short link, judging that the short link can access the page corresponding to the short link, directly jumping to the long link corresponding to the short link according to the short link, and accessing the corresponding page based on the long link, thereby realizing the access to the page.
Referring to fig. 5, in an embodiment, before jumping to the corresponding long link according to the short link, the method further includes the following steps S541-S543:
s541, judging whether the short link has a password;
s542, if yes, triggering a password obtaining request;
s543, receiving the password based on the password obtaining request, and unlocking the short link.
In this embodiment, after the short code in the short link is ensured to be the valid short code, it is further necessary to determine whether the short link has the password, and if the short link has the password, the short link needs to be decrypted first, and then page access is performed. Specifically, a password obtaining request is triggered, an unlocking password of the short link is obtained based on the password obtaining request, the unlocking password is identified and compared whether the unlocking password is consistent with a preset password or not, if the unlocking password is not consistent with the preset password, the unlocking password is judged to be wrong, a password obtaining instruction is triggered again according to the wrong password, the unlocking password consistent with the preset password is obtained based on the instruction, then the short link is decrypted according to the unlocking password to obtain a decrypted short link, the short link is skipped to a corresponding long link according to the decrypted short link, and the corresponding page is accessed based on the long link, so that the page is accessed; and if the short link does not have the password, directly jumping to the corresponding long link according to the short link, and accessing the corresponding page based on the long link, thereby realizing the access to the page.
Referring to FIG. 6, in one embodiment, the accessing the corresponding page based on the long link includes the following steps S551-S553:
s551, acquiring the state information of the server;
s552, judging whether the server can be normally accessed according to the state information;
s553, if not, suspending sending the access request to the server.
In this embodiment, a limited access is preset for the short link access service, where the limited access refers to limiting an access amount of the short link within a preset capability range, and when the access amount is exceeded, the short link access service is suspended and the user is prompted to try again later. Meanwhile, a fusing mechanism is preset for the short link, when a certain node of the short link access server has a performance bottleneck, the node which cannot be accessed in a short time is caused to be accessed, at the moment, an access request is not sent to the server through the fusing mechanism, and the access request is sent again after the node is recovered, so that invalid access is avoided, and access resources are wasted. In order to avoid invalid access to a page, when a corresponding page is accessed based on the long chain, state information of a server is obtained, whether the server can be normally accessed is judged according to the state information, if the server can be normally accessed, an access request is sent to the server, and then an access page is obtained; if the server cannot normally access at present, the sending of the access request to the server is suspended, and after the server can normally access, the access request is triggered, so that continuous invalid access is avoided, and access resources are wasted.
Referring to fig. 7, the present application provides a short link generation device comprising:
an obtaining module 10, configured to obtain a long link to be processed;
a processing module 20, configured to process the long link to obtain a short code of the long link;
a generating module 30, configured to generate a corresponding short link according to the short code in combination with the protocol in the long link;
the searching module 40 is configured to search a preset link repository according to the short link, and determine whether the short link already exists;
and the output module 50 is used for outputting the short link and storing the short link in the link storage library if the short link is not output.
As mentioned above, it is understood that the components of the short link generation apparatus set forth herein may perform the functions of any of the short link generation methods described above.
In one embodiment, the processing module 20 is further configured to perform:
calculating the long link according to a decimal algorithm to obtain characters consisting of sixty-two letters and data;
processing the characters through a snowflake algorithm to obtain the character ID;
and combining the character ID with the character for conversion to obtain the short code of the long link.
In one embodiment, the generating module 30 is further configured to perform:
acquiring a protocol of the long link;
and splicing the short codes according to a preset rule and the protocol to obtain a short link corresponding to the long link.
In one embodiment, the output module 50 is further configured to perform:
and storing the short links and the long links corresponding to the short links together in a link repository, wherein the link repository stores the short links and the long links in an aof and rdb mixed persistence mode, and the link repository is a redis cluster.
In one embodiment, the output module 50 is further configured to perform:
sending an access request based on the short-chain contact;
intercepting a short code of the short link based on the access request;
judging whether the short code is invalid or not;
if not, skipping to the corresponding long link according to the short link;
accessing a corresponding page based on the long chain.
In one embodiment, the output module 50 is further configured to perform:
judging whether the short link has a password or not;
if yes, triggering a password acquisition request;
and receiving the password based on the password acquisition request, and unlocking the short link.
In one embodiment, the output module 50 is further configured to perform:
acquiring state information of a server;
judging whether the server can be normally accessed according to the state information;
and if not, suspending sending the access request to the server.
Referring to fig. 8, a computer device is further provided in the embodiment of the present application, and an internal structure of the computer device may be as shown in fig. 8. The computer equipment comprises a processor, a memory, a network interface, a display device and an input device which are connected through a system bus. Wherein, the network interface of the computer equipment is used for communicating with an external terminal through network connection. The display device of the computer device is used for displaying the interactive page. The input means of the computer device is for receiving input from a user. The computer device is designed with a processor for providing computing and control capabilities. The memory of the computer device includes non-volatile storage media. The non-volatile storage medium stores an operating system, a computer program, and a database. The database of the computer device is used for storing the original data. The computer program is executed by a processor to implement a short link generation method.
The processor executes the short link generation method, and the method comprises the following steps: obtaining a long chain junction to be treated; processing the long link to obtain a short code of the long link; generating a corresponding short link according to the short code and a protocol in the long link; searching a preset link storage library according to the short link, and judging whether the short link exists or not; if not, outputting the short link, and storing the short link in the link storage library. The computer provides a short link generation method, wherein a long link to be processed is obtained, the long link is processed, a short code of the long link is obtained, a corresponding short link is generated according to the short code and a protocol in the long link, a preset link storage library is searched according to the short link, whether the short link exists or not is judged, if not, the short link is output and stored in the link storage library, so that the automatic generation of the short link is realized, the generation technology of the short link is optimized, and the generation efficiency of the short link is improved.
The present application further provides a computer readable storage medium having stored thereon a computer program which, when executed by the processor, implements a short link generation method comprising the steps of: obtaining a long chain joint to be treated; processing the long link to obtain a short code of the long link; generating a corresponding short link according to the short code and a protocol in the long link; searching a preset link storage library according to the short link, and judging whether the short link exists or not; if not, outputting the short link, and storing the short link in the link storage library. The computer readable storage medium provides a short link generation method, wherein a long link to be processed is obtained, the long link is processed, a short code of the long link is obtained, a corresponding short link is generated according to the short code and a protocol in the long link, a preset link storage library is searched according to the short link, whether the short link exists or not is judged, if not, the short link is output and stored in the link storage library, so that the automatic generation of the short link is realized, the generation technology of the short link is optimized, and the generation efficiency of the short link is further improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct bused dynamic RAM (DRDRAM), and bused dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of another identical element in a process, apparatus, article, or method comprising the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all the equivalent structures or equivalent processes that can be directly or indirectly applied to other related technical fields by using the contents of the specification and the drawings of the present application are also included in the scope of the present application.

Claims (10)

1. A short link generation method, comprising:
obtaining a long chain junction to be treated;
processing the long link to obtain a short code of the long link;
generating a corresponding short link according to the short code and a protocol in the long link;
searching a preset link storage library according to the short link, and judging whether the short link exists or not;
if not, outputting the short link, and storing the short link in the link storage library.
2. The short link generation method of claim 1, wherein the processing the long link to obtain the short code of the long link comprises:
calculating the long link according to a decimal algorithm to obtain characters consisting of sixty-two letters and data;
processing the characters through a snowflake algorithm to obtain the character ID;
and combining the character ID with the character for conversion to obtain the short code of the long link.
3. The short link generation method of claim 1, wherein generating the corresponding short link according to the short code in combination with a protocol in the long link comprises:
acquiring a protocol of the long link;
and splicing the short codes according to a preset rule and the protocol to obtain the short link corresponding to the long link.
4. The short link generation method of claim 1, wherein the storing the short link in the link store comprises:
and storing the short links and the long links corresponding to the short links together in a link repository, wherein the link repository stores the short links and the long links in an aof and rdb mixed persistence mode, and the link repository is a redis cluster.
5. The short link generation method of claim 1, further comprising, after storing the short link in the link store:
sending an access request based on the short-chain contact;
intercepting a short code of the short link based on the access request;
judging whether the short code is invalid or not;
if not, skipping to the corresponding long link according to the short link;
accessing a corresponding page based on the long chain.
6. The method of claim 5, wherein the skipping to the corresponding long link according to the short link further comprises:
judging whether the short link has a password or not;
if yes, triggering a password acquisition request;
and receiving the password based on the password obtaining request, and unlocking the short link.
7. The short link generation method according to claim 5, wherein the accessing a corresponding page based on the long link comprises:
acquiring state information of a server;
judging whether the server can be normally accessed according to the state information;
and if not, suspending sending the access request to the server.
8. A short link generation device, comprising:
the acquisition module is used for acquiring a long link to be processed;
the processing module is used for processing the long link to obtain the short code of the long link;
the generating module is used for generating a corresponding short link according to the short code and the protocol in the long link;
the searching module is used for searching a preset link storage library according to the short link and judging whether the short link exists or not;
and the output module is used for outputting the short link and storing the short link in the link storage library if the short link is not stored in the link storage library.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the short link generation method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the short link generation method according to any one of claims 1 to 7.
CN202211249855.9A 2022-10-12 2022-10-12 Short link generation method and device, computer equipment and storage medium Pending CN115640471A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211249855.9A CN115640471A (en) 2022-10-12 2022-10-12 Short link generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211249855.9A CN115640471A (en) 2022-10-12 2022-10-12 Short link generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115640471A true CN115640471A (en) 2023-01-24

Family

ID=84945246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211249855.9A Pending CN115640471A (en) 2022-10-12 2022-10-12 Short link generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115640471A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501997A (en) * 2023-06-28 2023-07-28 太平金融科技服务(上海)有限公司深圳分公司 Short link generation method, device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501997A (en) * 2023-06-28 2023-07-28 太平金融科技服务(上海)有限公司深圳分公司 Short link generation method, device, electronic equipment and storage medium
CN116501997B (en) * 2023-06-28 2023-09-26 太平金融科技服务(上海)有限公司深圳分公司 Short link generation method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112073405B (en) Webpage data loading method and device, computer equipment and storage medium
CN110866198B (en) Static resource caching method, system, device, computer equipment and storage medium
CN102915363B (en) Web site collection method and system
CN110489421B (en) Data storage method, apparatus, computer readable storage medium and computer device
CN107918617B (en) Data query method and device
CN111460241B (en) Data query method and device, electronic equipment and storage medium
CN107844488B (en) Data query method and device
CN115640471A (en) Short link generation method and device, computer equipment and storage medium
CN114024728A (en) Honeypot building method and application method
CN113505318A (en) Short link generation method, device, equipment and storage medium
CN111782244A (en) Configuration file updating method and device, computer equipment and storage medium
CN108460116B (en) Search method, search device, computer equipment, storage medium and search system
CN116226560A (en) Short-link generation method and device
JP6233846B2 (en) Variable-length nonce generation
CN112685451B (en) Data query processing method, device, computer equipment and storage medium
CN112015818B (en) UUID (unified user identifier) generation method, device, equipment and medium for distributed graph database
CN102937982A (en) Method and system for creating collection contents
CN111985186B (en) Dictionary item conversion method, API gateway system, equipment and storage medium
CN113285933A (en) User access control method and device, electronic equipment and storage medium
CN103701844A (en) User information management method and system
CN113420241A (en) Page access method and device, electronic equipment and storage medium
US11138075B2 (en) Method, apparatus, and computer program product for generating searchable index for a backup of a virtual machine
CN108491448B (en) Data pushing method and device
CN113805968B (en) Function execution method and device of application program, computer equipment and storage medium
CN115296915B (en) Webpage data access method and device, equipment, medium and product thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination