CN116501997B - Short link generation method, device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN116501997B
CN116501997B CN202310769665.8A CN202310769665A CN116501997B CN 116501997 B CN116501997 B CN 116501997B CN 202310769665 A CN202310769665 A CN 202310769665A CN 116501997 B CN116501997 B CN 116501997B
Authority
CN
China
Prior art keywords
value
target
link
short
identification
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.)
Active
Application number
CN202310769665.8A
Other languages
Chinese (zh)
Other versions
CN116501997A (en
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.)
Taiping Financial Technology Services Shanghai Co Ltd Shenzhen Branch
Original Assignee
Taiping Financial Technology Services Shanghai Co Ltd Shenzhen Branch
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 Taiping Financial Technology Services Shanghai Co Ltd Shenzhen Branch filed Critical Taiping Financial Technology Services Shanghai Co Ltd Shenzhen Branch
Priority to CN202310769665.8A priority Critical patent/CN116501997B/en
Publication of CN116501997A publication Critical patent/CN116501997A/en
Application granted granted Critical
Publication of CN116501997B publication Critical patent/CN116501997B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Devices For Checking Fares Or Tickets At Control Points (AREA)
  • Telephonic Communication Services (AREA)
  • Meter Arrangements (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a short link generation method, a short link generation device, electronic equipment and a storage medium. The method comprises the following steps: acquiring short code digits sent by a service system, determining interception digits according to the short code digits, wherein the numerical upper limit value determined by the interception digits is larger than the numerical upper limit value determined by the identification digits contained in the short code digits; acquiring a long-link identification value of a long link; intercepting the long-chain identification value according to the interception bit number to obtain a target identification value; and generating a target short link according to the target identification value. The technical scheme of the embodiment of the invention reduces the repetition rate of the short link and improves the uniqueness of the short link.

Description

Short link generation method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a short link generation method, a short link generation device, an electronic device, and a storage medium.
Background
With the rapid development of information technology, a common link pushing mode is realized through information sharing links. However, sharing long links has information security hidden trouble and the information transmission cost is higher. Therefore, it is necessary to convert the long link into the short link and transmit the short link.
At present, short links can be generated by directly intercepting long links.
However, when a large number of long links are directly intercepted to generate a short link, there may be a case where different long links generate the same short link.
Disclosure of Invention
The invention provides a short link generation method, a short link generation device, electronic equipment and a storage medium, which reduce the repetition rate of short links and improve the uniqueness of the short links.
According to an aspect of the present invention, there is provided a short link generation method, including:
acquiring short code digits sent by a service system, determining interception digits according to the short code digits, wherein the numerical upper limit value determined by the interception digits is larger than the numerical upper limit value determined by the identification digits contained in the short code digits;
acquiring a long-link identification value of a long link;
intercepting the long-chain identification value according to the interception bit number to obtain a target identification value;
and generating a target short link according to the target identification value.
According to another aspect of the present invention, there is provided a short link generation apparatus comprising:
the short code bit number acquisition module is used for acquiring the short code bit number sent by the service system, determining the interception bit number according to the short code bit number, wherein the numerical upper limit value determined by the interception bit number is larger than the numerical upper limit value determined by the identification bit number contained in the short code bit number;
The long link identification value acquisition module is used for acquiring long link identification values of long links;
the target identification value determining module is used for intercepting the long-chain link identification value according to the interception bit number to obtain a target identification value;
and the target short link generation module is used for generating a target short link according to the target identification value.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the short link generation method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the short link generation method according to any one of the embodiments of the present invention when executed.
According to another aspect of the present invention, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the short link generation method according to any of the embodiments of the present invention.
According to the technical scheme, the short code digit sent by the service system is obtained, the interception digit is determined according to the short code digit, the numerical upper limit value determined by the interception digit is larger than the numerical upper limit value determined by the identification digit contained in the short code digit, the long-link identification value of the long link is obtained, the target identification value is obtained by intercepting the long-link identification value according to the interception digit, and the target short link is generated according to the target identification value, so that the situation that different long links generate the same short link when a large number of long links are directly intercepted to generate the short link is solved, the repetition rate of the short link is reduced, and the uniqueness of the short link is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a short link generation method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a short link generation method according to a second embodiment of the present invention;
fig. 3 is an application scenario diagram of long link compression to short link according to the third embodiment of the present invention;
fig. 4 is an application scenario diagram of a long link conversion short link according to a third embodiment of the present invention;
FIG. 5 is a flow chart of a method for converting a long link into a short link according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a target short link format according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of a short link generating device according to a fourth embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device implementing a short link generation method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a short link generation method according to a first embodiment of the present invention. The present embodiment may be applied to a case of generating a short link according to a long link, and the method may be performed by a short link generating device, which may be implemented in hardware and/or software, and which may be configured in an electronic apparatus carrying a short link generating function.
Referring to the short link generation method shown in fig. 1, it includes:
s110, obtaining short code digits sent by the service system, determining interception digits according to the short code digits, wherein the numerical upper limit value determined by the interception digits is larger than the numerical upper limit value determined by the identification digits contained in the short code digits.
The business system may be a demander of the long link to the target short link. Long links suffer from lower transmission security and higher transmission costs during application. Therefore, the service system needs to convert the long link into the target short link through the device, and then send the target short link to the user side. After receiving the target short link, the user can access the target short link and jump to the long link of the service system.
The target short link may include a domain name and a target short code. The domain name may be a generic part in the target short link. The target short code may be an identification portion of the target short link that is distinguished from other short links. By way of example, the target short link may be "u.xx.com/x/a1b2c3d4", where "u.xx.com/x/" is the domain name, i.e. the generic part of the target short link; "a1b2c3d4" is a target short code, i.e., the target short link is distinguished from the identification portion of the other short links. The short code number of bits may be the number of bits of the target short code contained in the target short link. The number of short code digits can be set according to the requirements of the service system. The target short code may include only the target identification value, or may include the target identification value and other target values. The target identification value is generated by intercepting the long-chain link identification value.
The number of truncated bits may be used to determine the truncated portion of the long link identification value. The upper limit value of the value determined by the interception bit number may be the maximum value of the value obtained when the long link identification value is intercepted. The upper numerical limit value determined by the number of identification bits may be the maximum value of the numerical values obtained when generating the target identification value.
The upper limit value of the numerical value determined by the interception digit is larger than the upper limit value of the numerical value determined by the identification digit contained in the short digit, so that the numerical value range determined by the interception digit can cover the numerical value range determined by the identification digit. Thereby, on the basis of the identification number of bits, a maximization of the numerical range determined by the identification number of bits is achieved. In the process of generating the target short code, the uniqueness of the generated target short link is further ensured by utilizing the maximized numerical range.
S120, obtaining a long link identification value of the long link.
The long links may be sent by the business system to the present device. The long link identification value may be an identification value uniquely corresponding to the long link. A long link identification value may be generated by the present device. Alternatively, the long link identification value may be generated by a string algorithm. By way of example, the string algorithm may include a Hash 128 algorithm and the long-link identification value may be a 16-ary 32-bit string.
The process of generating the target short link is converted into the intercepting process of the long link identification value with normalization from the uncontrollable process of directly intercepting the long link by generating the long link identification value and intercepting the long link identification value. And the normalization of each long-chain link identification value is utilized, so that the controllability of short-chain links generated by intercepting the long-chain link identification values is ensured. Meanwhile, the target short link is generated by intercepting the long link identification value with uniqueness, so that the repetition rate of the short link is avoided, and the uniqueness of the short link is improved.
S130, intercepting the long-chain link identification value according to the interception bit number to obtain a target identification value.
Specifically, the long-chain link identification value can be intercepted according to the interception bit number, the intercepted numerical value is used as the numerical value of the target identification value, and the intercepted numerical value is converted according to the identification bit number to obtain the target identification value.
S140, generating a target short link according to the target identification value.
Alternatively, the target identification value may be directly used as the target short code, and the domain name and the target short code may be combined to generate the target short link.
Optionally, the service system may also send a service system identification value to the present device. The target identification value and the service system identification value may be combined to generate the target short code based on the above example. And combining the domain name and the target short code to generate a target short link.
According to the technical scheme, the short code number sent by the service system is obtained, the interception number is determined according to the short code number, the numerical upper limit value determined by the interception number is larger than the numerical upper limit value determined by the identification number contained in the short code number, the long-link identification value of the long link is obtained, the target identification value is obtained by intercepting the long-link identification value according to the interception number, and the target short link is generated according to the target identification value, so that the numerical range of the interception number covers the numerical range determined by the short code number, the maximization of the numerical range determined by the identification number is ensured, the problem that different long links generate the same short link when a large number of long links are directly intercepted to generate the short link is solved, the repetition rate of the short link is reduced, and the uniqueness of the short link is improved. Meanwhile, the long-chain link identification value with the unique corresponding relation with the long-chain link is intercepted, instead of directly intercepting the long-chain link, so that the safety of information transmission is ensured, the repetition rate of the short-chain link is further reduced, and the uniqueness of the short-chain link is improved.
In an alternative embodiment of the present invention, the generation of the target short link according to the target identification value is embodied as: taking a value in a preset random number range to obtain a target random value; and generating a target short link according to the target identification value and the target random value.
The preset random number range may be set and adjusted empirically by the skilled artisan. Alternatively, the preset random number range may be determined by a preset random number digit and a target short code. Illustratively, assuming that the preset random number is 2 digits, the target short code is 62 digits in system. The predetermined random number may range from 0 to 62 2 -1。
Specifically, a random number can be optionally selected in a preset random number range, and the random number is converted according to a preset random number digit number and a target short code system to obtain a target random value. And combining the target identification value and the target random value to generate a target short code. And combining the domain name and the target short code to generate a target short link.
According to the scheme, the target random value is introduced, the target random value is generated by taking the value in the range of the preset random number, the target short link is generated according to the target identification value and the target random value, the generation process of the target random value is increased on the basis of the target identification value, the complexity of the short link generation process is improved, and the safety of the short link and the uniqueness of the short link are further ensured.
In an alternative embodiment of the present invention, after generating the target short link, the method further includes: when the target short link is detected to be the same as the pre-generated history short link, re-taking the value within the range of the preset random number, and updating the target random value; and generating a target short link according to the target identification value and the updated target random value.
The historical short links may be short links generated prior to the generation of the target short links. The generation mode of the history short link and the target short link is the same, namely, the history short link is generated according to the history identification value and the history random value. For descriptions of the historical identification value and the historical random value, refer to specific descriptions of the target identification value and the target random value in the scheme, and are not described in detail herein.
After the target short link is generated, the target short link may be stored in a database or cache. If the historical short link which is the same as the target short link exists in the database, the target short link fails to be stored in the database or the cache. Thus, it is possible to detect whether the target short link has the same pre-generated history short link as the target short link in the database by failure of the target short link to be stored in the database. The target short link can be stored in the database or the cache, and the long link identification value and the long link can be stored in the database or the cache together. The database or the cache may be queried for the presence of the same historical short link as the target short link by querying the long link identification value, the long link, or the target short link.
Optionally, when the target short link is detected to be the same as the pre-generated historical short link, a value other than the target random value may be selected in a preset random number range, and the target random value may be updated. And combining the updated target random value and the target identification value to generate a target short code. And combining the domain name and the target short code to generate a target short link.
Alternatively, the database may be queried for a history short link having the same history identification value as the target identification value according to the target identification value of the target short link. And according to the difference set between each history random value contained in each history short link and the preset random number range, re-selecting the random number in the difference set, and updating the target random value. And combining the updated target random value and the target identification value to generate a target short code. And combining the domain name and the target short code to generate a target short link.
According to the scheme, when the target short link is detected to be the same as the pre-generated historical short link, the value is re-taken in the range of the preset random number, the target random value is updated, the target short link is generated according to the target identification value and the updated target random value, the situation that the target short link and the historical short link are repeated is avoided, fine adjustment updating is carried out on the target short link through updating the target random value, uniqueness of the short link and adjustment efficiency of the short link are considered, and the repetition rate of the short link is further reduced.
In an alternative embodiment of the present invention, intercepting the long link identifier value according to the number of interception bits to obtain a target identifier value includes: and intercepting the long-chain link identification value at a first interception position according to the interception bit number to obtain a target identification value. After generating the target short link, further comprising: when the target short link is detected to be the same as the pre-generated history short link, intercepting the target short link at a second intercepting position of the long link identification value according to intercepting digits, updating the target identification value, wherein the first intercepting position and the second intercepting position are different; and generating a target short link according to the updated target identification value and the target random value.
The first interception position and the second interception position are respectively different positions for intercepting the long-chain link identification value. The first interception location may be an interception location including a last digit of the long-link identification value; the second interception location may be a location other than the first interception location. Alternatively, the second clipping position may be a clipping position obtained by advancing the first clipping position by one bit. By adjusting the first interception position to the second interception position, the shift interception of the long-chain link identification value is realized.
Optionally, when the target short link is detected to be the same as the pre-generated historical short link, the intercepting position can be directly adjusted, the intercepting position is adjusted from the first intercepting position to the second intercepting position, and the target identification value is updated according to the re-intercepting numerical value. And combining the updated target identification value with the target random value to generate a target short code. And combining the domain name and the target short code to generate a target short link.
Alternatively, after updating the target random value, when it is still detected that the target short link is the same as the pre-generated history short link, the interception position is adjusted, and the target identification value is updated according to the re-intercepted value. And combining the updated target identification value with the target random value to generate a target short code. And combining the domain name and the target short code to generate a target short link.
According to the scheme, the first intercepting position and the second intercepting position are introduced, the target identifying value is obtained by intercepting the target short link at the first intercepting position of the long-chain link identifying value according to the intercepting bit number, after the target short link is generated, when the target short link is detected to be identical with the pre-generated history short link, the target identifying value is updated according to the intercepting bit number at the second intercepting position of the long-chain link identifying value, the target short link is generated according to the updated target identifying value and the target random value, and the adjustment of the intercepting position when the target short link is repeated is realized through the first intercepting position and the second intercepting position which are different in intercepting position, so that the repetition rate of the short link is further reduced.
Example two
Fig. 2 is a flowchart of a short link generation method according to a second embodiment of the present invention. The present embodiment, based on the above embodiment, embodies determining the truncated digits from the short code digits as: acquiring a first system corresponding to the short code bit number, and generating a numerical upper limit value corresponding to the identification bit number contained in the short code bit number; acquiring a second system; acquiring a target value which is larger than the upper limit value of the value corresponding to the short code bit number; and determining the number of interception bits according to the second system and the target value. "in the embodiment of the present invention, a part not described in detail is referred to the expression of other embodiments.
Referring to the short link generation method shown in fig. 2, it includes:
s210, acquiring a short code bit number sent by a service system, acquiring a first system corresponding to the short code bit number, and generating a numerical upper limit value corresponding to an identification bit number contained in the short code bit number; the upper value limit value determined by the interception digit is larger than the upper value limit value determined by the identification digit contained in the short code digit.
The first level may be set and adjusted empirically by the skilled person. The numerical upper limit value determined by the number of identification bits may be determined by a first system corresponding to the target short code. Exemplary, if the target short code is 62 digits and the identification digit is 6 digits, the upper limit value of the value determined by the identification digit is 62 6 -1 (i.e. 56,800,235,583).
Specifically, the number of short code digits required by the service system can be obtained, a first system set and adjusted by a technician according to experience is obtained, and a numerical upper limit value corresponding to the number of identification digits contained in the number of short code digits is generated according to the number of identification digits contained in the number of short code digits and the first system corresponding to the target short code.
S220, acquiring a second system.
The second bin may be a bin corresponding to the long link identification value. The first system is a system corresponding to the short code. The first and second system may be the same or different. Optionally, when the first system is different from the second system, a system conversion process is added in the process of generating the target identification value, so that the complexity of the short link generation process is further improved, and the information security of the short link is further improved.
Specifically, a second system corresponding to the long-link identification value is obtained.
S230, obtaining a target value which is larger than the upper limit value of the value corresponding to the identification bit number contained in the short code bit number.
The target value may be a value greater than a value upper limit value corresponding to the number of identification bits. Exemplary, the upper numerical limit value determined by the number of identification bits may be 62 6 -1, the target value may be 62 6
S240, determining the number of interception bits according to the second system and the target value.
Specifically, the number of bits can be exhausted, the value obtained by the power of the exhausted number of bits of the second system is calculated according to the exhausted number of bits and the second system, the value is compared with the target value, and if the value is greater than or equal to the target value, the exhausted number of bits is determined to be the intercepting number of bits; otherwise, the number of exhaustive bits is further adjusted until the target value is determined.
As an example, the target value may be 62 6 (i.e., 56,800,235,584), the second is 16. When the number of the exhaustive digits is 9, the number obtained by the power of the number of the exhaustive digits of the second system is 16 9 (i.e., 68,719,476,736). 16 9 Greater than 62 6 The number of truncated bits may be determined to be 9 bits.
S250, obtaining a long link identification value of the long link.
S260, intercepting the long-chain link identification value according to the intercepting bit number to obtain a target identification value.
S270, generating a target short link according to the target identification value.
According to the technical scheme, the first system and the second system are introduced, the first system corresponding to the short code bit number is obtained, the numerical upper limit value corresponding to the identification bit number contained in the short code bit number is generated, the second system is obtained, the target numerical value larger than the numerical upper limit value corresponding to the short code bit number is obtained, the interception bit number is determined according to the second system and the target numerical value, the second system corresponding to the first system corresponding to the short code bit number and the long-chain identification value is considered, the interception bit number is determined according to the first system and the second system, the determination of the interception bit number is realized, the maximization of the numerical range corresponding to the identification bit number contained in the short code bit number is ensured, and the uniqueness of the short link is improved. Meanwhile, the complexity of the short link generation process is further improved through different system conversion, and the information security of the short link is improved.
In an optional embodiment of the present invention, the long-link identifier value is intercepted according to the interception bit number, so as to obtain the target identifier value, which is specifically: intercepting the long-chain identification value according to the intercepting bit number to obtain an intercepting value; and adjusting the intercepted numerical value according to the numerical upper limit value determined by the identification bit number contained in the short code bit number to obtain the target identification value.
The truncated value may be a value obtained by actually truncating the long-link identification value.
Specifically, the long-link identification value can be intercepted according to the interception bit number, so as to obtain an interception value. And taking an absolute value after the truncated value is differenced from the upper limit value of the value determined by the identification bit number, and obtaining an adjusted truncated value. And generating a target identification value according to the adjusted interception value and the identification bit number.
According to the scheme, the long-chain link identification value is intercepted according to the interception bit number, the interception value is obtained, the target identification value is obtained by adjusting the interception value according to the upper limit value of the value determined by the identification bit number contained in the short code bit number, the interception value is adjusted by utilizing the upper limit value of the value determined by the identification bit number under the condition that the range of the value determined by the identification bit number is maximized, the condition that the target identification value cannot be generated due to value overflow is avoided, normal generation of the target identification value is ensured, normal generation of a target short link is further ensured, and fault tolerance of a short link generation process is improved.
In an alternative embodiment of the present invention, the truncated value is adjusted according to the upper limit value of the value determined by the identification bit number included in the short code bit number, so as to obtain the target identification value, which is specifically: when the intercepted value is smaller than or equal to the upper limit value of the value determined by the identification bit contained in the short code bit, determining the intercepted value as a target identification value; and when the intercepted value is larger than the numerical upper limit value determined by the identification bit number contained in the short code bit number, determining a difference value between the intercepted value and the numerical upper limit value determined by the identification bit number contained in the short code bit number as a target identification value.
Specifically, comparing the numerical upper limit value determined by the identification number with the intercepted numerical value, and if the intercepted numerical value is smaller than or equal to the numerical upper limit value determined by the identification number, directly determining the intercepted numerical value as a target identification value; and if the truncated numerical value is larger than the numerical upper limit value determined by the identification number, taking the difference value between the truncated number and the numerical upper limit value determined by the identification number as the target identification value.
According to the scheme, when the intercepted value is smaller than or equal to the numerical upper limit value determined by the identification bit number contained in the short code bit number, the intercepted value is determined to be the target identification value, when the intercepted value is larger than the numerical upper limit value determined by the identification bit number contained in the short code bit number, the difference value between the intercepted value and the numerical upper limit value determined by the identification bit number contained in the short code bit number is determined to be the target identification value, and the non-differential adjustment of the intercepted value is avoided, the pertinence adjustment is carried out on the intercepted value with the numerical overflow, the pertinence and the flexibility of the intercepted value adjustment are improved, and the fault tolerance of the short-link generation process is ensured.
Example III
Fig. 3 is an application scenario diagram of compression of long links into short links according to a third embodiment of the present invention. As shown in fig. 3, the long link has a long length, and there is a problem in that the information transmission cost is high. Meanwhile, the long link contains more information, and the problem of lower information security exists. And compressing the long links to generate short links. Compared with long links, short links have obviously shortened length and lower information transmission cost. And the short link contains less information, so that the information security is high.
Fig. 4 is an application scenario diagram of a long link conversion short link according to a third embodiment of the present invention. As shown in fig. 4, in the short-link generation process, the service system sends a short-link acquisition request to the short-link generation system by calling the long-link conversion short-link interface of the short-link generation system (i.e., the device). The short-link acquisition request comprises information such as a long link and a validity period of the long link sent by the service system. The short link generation system acquires a short link acquisition request sent by the service system, and extracts information such as long links, validity periods of the long links and the like in the short link acquisition request. The short link generation system converts the long link into a short link and stores the long link and the short link together in a database. And the short link generation system feeds back the converted short link to the service system. The service system acquires the short link and sends the short link to the user terminal. In the short link access process, the user side jumps to a short link conversion long link interface of the short link generation system through accessing the short link. And the short link generation system queries and acquires the long link in the database according to the short link accessed by the user terminal. And the short link generation system accesses the page corresponding to the service system according to the long link jump.
Fig. 5 is a flowchart of a long-link conversion short-link method according to a third embodiment of the present invention. Referring to fig. 5, the long-chain-to-short-chain conversion method includes:
and step 1, inquiring whether a long link exists in the cache.
Specifically, the service system may send a short-link acquisition request to the short-link generation system by calling a long-link conversion short-link interface provided by the short-link generation system. The short link acquisition request comprises information such as a long link, a validity period of the long link and the like. And the short link generation system receives a short link acquisition request sent by the service system and extracts information such as long links, validity periods of the long links and the like in the short link acquisition request. And the short link generation system calculates a long link identification value corresponding to the long link according to a character string algorithm (such as a Hash128 algorithm). The long link identification value may be an identification value that has a unique correspondence with the long link. Illustratively, the long link identification value may be a 32-bit string of 16-bits. And inquiring whether target short links and long links corresponding to the long link identification value exist in the cache according to the long link identification value. If so, comparing whether the long link inquired in the cache is consistent with the long link sent by the service system, and if so, directly feeding back the corresponding target short link to the service system; if not, query in the database.
And step 2, inquiring whether a long link exists in the database.
Specifically, whether the long link and the target short link which are the same as the long link identification value exist or not can be inquired in the database according to the long link identification value. If the long link is consistent with the long link sent by the service system, the corresponding target short link is directly fed back to the service system, the validity period of the long link sent by the service system is compared with the validity period of the long link stored in the database, and the longer validity period is used as the validity period of the long link, so that the validity period of the long link is updated. And if the target short links are inconsistent, the step of generating the target identification value of the target short links is executed, wherein the step of generating the target short links is indicated that the long links sent by the service system do not generate the target short links. And if the target short link does not exist, executing the step of generating the target identification value of the target short link.
And step 3, generating a target identification value of the target short link.
Fig. 6 is a schematic structural diagram of a target short link format according to a third embodiment of the present invention. As shown in fig. 6, the target short link includes a domain name and a target short code. Wherein the domain name is "u.xx.com/x/"; the target short code is "a1b2c3d4e5". The short code number is 10. The target short code includes a 6-bit target identification value, a 2-bit target random value, and a 2-bit service system identification value. Alternatively, the target short code may be 62 digits.
Specifically, the number of short code bits of the generated target short link can be determined according to the number of short code bits sent by the service system. And determining the identification bit number according to the short code bit number and the format of the target short code. And determining a numerical upper limit value corresponding to the identification digit according to the identification digit and the first system. And determining a target value according to the numerical upper limit value determined by the identification number. And determining the number of interception bits according to the second system and the target value. And intercepting the long-chain link identification value according to the interception bit number. According to the second system, an intercept value is determined. And comparing the intercepted value with the numerical upper limit value determined by the identification bit number, and when the intercepted value is smaller than or equal to the numerical upper limit value corresponding to the identification bit number, understanding that no numerical overflow exists in the intercepted value relative to the numerical upper limit value corresponding to the identification bit number, and directly converting the intercepted value into the target identification value according to the identification bit number. When the truncated number of bits is greater than the upper limit value of the number corresponding to the identification number of bits, it can be understood that the truncated number of bits overflows from the upper limit value of the number corresponding to the identification number of bits, the truncated number of bits and the upper limit value of the number corresponding to the identification number of bits are made a difference value, and the difference value is converted into the target identification value according to the identification number of bits.
Illustratively, the number of short code bits sent by the service system may be 10 bits, and the target short code format may be as shown in fig. 6. The number of identification bits is determined to be 6 bits. The first system corresponding to the target short code is 62 systems, and the upper limit value of the numerical value corresponding to the identification digit is 62 6 -1, target value 62 6 . The long link identification value may be a 32-bit string of 16 bits. The second system corresponding to the long link identification value is 16 systems. And calculating the second system of the power of the exhaustive digits, and determining the number of the exhaustive digits of the second system of which the power of the exhaustive digits is greater than the number of the exhaustive digits of the target value as the interception digit. For example, calculate 16 in turn 1 、16 2 、16 3 、16 4 、16 5 、16 6 、16 7 、16 8 And 16 9 Respectively with target values 62 6 Comparison, determination 16 9 >62 6 The number of truncated bits may be determined to be 9 bits. The long-chain link identification value can be intercepted at the end to obtain an intercepted value. The 9-bit truncated value can be converted into 10-system, and whether the truncated value is larger than the upper value limit 62 determined by the identification bit number or not is judged 6 1, if not, no numerical value overflows, and directly converting the intercepted numerical value into a 62-bit 6-bit target identification value; if so, there is a numerical overflow, andnumerical upper limit value 62 determined by subtracting the number of identification digits from the truncated value 6 -1, into a 62-bit 6-bit target identification value.
And 4, randomly generating a target random value.
Specifically, the target random value can be generated by taking a value in a preset random number range. As illustrated by way of example in fig. 6. The target random value may be a 2-bit 62-ary string. The preset random number may range from 0 to 62 2 -1. Random numbers are selected from the range of preset random numbers, and the random numbers are converted into 62-bit target random values. The target identification value, the target random value, and the service system identification value may be combined to generate a target short code. And combining the domain name and the target short code to generate a target short link. After the target short link is generated, the target short link, long link, and long link identification values may be stored in a database. If the database is not stored, it can be understood that the database has the same history short link as the target short link, and the target random value is updated by re-taking the value within the range of the preset random number. And combining the target identification value, the updated target random value and the service system identification value, and updating the target broken code. And combining the domain name and the target short code to update the target short link. The updated target short links are stored in the database again. If the data is not stored in the database, repeating the step of re-taking the value within the range of the preset random number to generate the target random value.
Optionally, before the target short link is stored in the database, performing sensitive word verification on the generated target short link, and if the verification is passed, storing the target short link in the database; and if the verification is not passed, repeating the step of re-taking the value within the preset random number range to generate the target random value. Optionally, the number of random generations of the target random value does not exceed a preset number of random generations. The preset random generation times can be set and adjusted by a technician according to experience. The preset number of random generation times may be 3 times, for example.
And 5, generating a target random value by the difference set.
The number of times of random generation of the target random value exceeds the preset number of times of random generation can be understood as that the repetition rate of the target random value in the preset random number range is higher. At this time, the target random value may be generated by making a difference set.
Specifically, the database may be queried for a history random value with a history short link of the target identification value by the target identification value. And calculating a difference set of a preset random number range and a history random value of a history short link with a target identification value. Wherein the difference set represents a range of target random values that are not combined with the target identification value to generate the target short code. And re-selecting the random number in the difference set, and updating the target random value. And combining the target identification value, the updated target random value and the service system identification value to update the target short code. And combining the domain name and the target short code to update the target short link.
And storing the updated target short links into a database. If the store fails, the step of determining the difference set is repeated. Optionally, the number of times the difference set generates the target random value does not exceed the preset difference set generation number. The preset difference set generation times can be set and adjusted by a technician according to experience. The preset difference set generation number may be 3, for example. If the difference set does not exist or the number of times of generating the difference set exceeds the preset number of times, executing the step of carrying out shift interception on the long-link identification value and regenerating the target identification value. Optionally, the number of times of generating the target identification value does not exceed the preset number of times of generating the identification. If the number of times of generating the preset identifier is exceeded, the target short link is failed to be generated, and the target short link cannot be generated.
If the target short link, long link and long link identification values are successfully stored in the database, the target short link, long link and long link identification values are stored in the cache, and the validity period of the long link can be added in the cache. Illustratively, the validity period of the long link may be 1 minute. If the short link generation system determines that the service system repeatedly sends the long link through the long link identification value, the short link generation system directly feeds back the target short link and the long link to the service system. The long link validity period may also be 3 days, for example. When the service system inquires the target short link, the target short link corresponding to the long link can be obtained by inquiring the long link identification value. Alternatively, the short link generation system may store the target short link and long link in the cache. When the user terminal accesses the short link, the long link can be queried in the cache through the target short link sent by the user terminal, and the long link can be accessed in a jumping way. Optionally, a validity period of the long link may be added. Illustratively, the validity period of the long link may be 3 days. The validity period of the long link in the database is larger than that of the long link in the cache. Illustratively, the validity period of a long link in the database may be 10 days; the validity period of a long link in the cache may be 3 days. When the validity period of the long link is exceeded, the cache or the database can delete and clean the long link, the long link identification value and the short link. By adding the validity period of the long link, the occupation of the storage space by the long link and the corresponding short link which are not commonly used is avoided, and meanwhile, the repetition rate of the short link can be reduced by periodically cleaning the short link.
And 6, accessing the long link through the target short link.
Specifically, when the user side accesses the target short link, the user side can jump to a short link conversion long link interface of the short link generation system. The short connection generation system can perform rationality analysis on the domain name and the target short code of the target short link, and if the domain name and the target short code are unreasonable, an error interface is returned. If the target short link is reasonable, inquiring in the cache according to the target short link, and if the target short link exists in the cache, acquiring the long link and jumping to access. And if the target short link does not exist in the cache, inquiring in the database. If the target short link does not exist in the database, returning an error interface; and if the target short link exists in the database, acquiring the long link and jumping to access.
According to the scheme, the long-link identification value is generated, the long-link identification value with uniqueness is utilized to query the cache and the database in sequence, and the process of querying the target short link through the long-link identification value is realized. When the target short link is not queried, the interception digit is determined, so that the maximization of the data range determined by the identification digit is ensured, and the uniqueness of the short link is improved. By intercepting the long-chain link identification value with uniqueness, a target identification value is generated, and the safety of the target identification value is improved. When the historical short links which are repeated with the target short links are detected, fine adjustment of the target short links is achieved by updating the target random values, adjustment efficiency of the target short links is improved, and the repetition rate of the target short links is reduced. When the random generation times of the target random value is larger than the preset random generation times, the target random value is updated in a difference set mode, so that the repetition rate of the target short link is further avoided. When the difference set generation times of the target random value is larger than the preset difference set generation times and when the target random value does not have the difference set, the target identification value is updated in a shift interception mode, so that the repetition rate of the target short link is further reduced. The target short link, the long link and the long link identification value are stored in the cache or the database, so that the inquiry of the target short link is facilitated, and the long link is accessed through the target short link, so that the subsequent use of the target short link is ensured.
Example IV
Fig. 7 is a schematic structural diagram of a short link generating device according to a fourth embodiment of the present invention. The embodiment is applicable to the case of generating a short link according to a long link, the apparatus may perform a short link generation method, the apparatus may be implemented in hardware and/or software, and the apparatus may be configured in an electronic device that carries a short link generation function.
Referring to fig. 7, the short link generation apparatus includes: a short code number acquisition module 710, a long link identification value acquisition module 720, a target identification value determination module 730, and a target short link generation module 740. Wherein,,
the short code number acquisition module 710 is configured to acquire a short code number sent by the service system, determine a truncated number according to the short code number, and determine a numerical upper limit value determined by the truncated number greater than a numerical upper limit value determined by an identification number included in the short code number;
a long link identification value obtaining module 720, configured to obtain a long link identification value of a long link;
the target identification value determining module 730 is configured to intercept the long-link identification value according to the interception bit number to obtain a target identification value;
the target short link generation module 740 is configured to generate a target short link according to the target identification value.
According to the technical scheme, the short code number sent by the service system is obtained, the interception number is determined according to the short code number, the numerical upper limit value determined by the interception number is larger than the numerical upper limit value determined by the identification number contained in the short code number, the long-link identification value of the long link is obtained, the target identification value is obtained by intercepting the long-link identification value according to the interception number, and the target short link is generated according to the target identification value, so that the numerical range of the interception number covers the numerical range determined by the short code number, the maximization of the numerical range determined by the identification number is ensured, the problem that different long links generate the same short link when a large number of long links are directly intercepted to generate the short link is solved, the repetition rate of the short link is reduced, and the uniqueness of the short link is improved. Meanwhile, the long-chain link identification value with the unique corresponding relation with the long-chain link is intercepted, instead of directly intercepting the long-chain link, so that the safety of information transmission is ensured, the repetition rate of the short-chain link is further reduced, and the uniqueness of the short-chain link is improved.
In an alternative embodiment of the present invention, the short code number acquisition module 710 includes: the first system acquisition unit is used for acquiring a first system corresponding to the short code bit number and generating a numerical upper limit value corresponding to the identification bit number contained in the short code bit number; a second system acquisition unit configured to acquire a second system; the target value acquisition unit is used for acquiring a target value which is larger than the upper limit value of the value corresponding to the identification bit number contained in the short code bit number; and the interception bit number determining unit is used for determining the interception bit number according to the second system and the target value.
In an alternative embodiment of the present invention, the target identification value determining module 730 includes: the interception value acquisition unit is used for intercepting the long-chain link identification value according to the interception bit number to obtain an interception value; and the target identification value determining unit is used for adjusting the intercepted value according to the numerical upper limit value determined by the identification bit number contained in the short code bit number to obtain the target identification value.
In an alternative embodiment of the present invention, the target identification value determining unit is specifically configured to: when the intercepted value is smaller than or equal to the upper limit value of the value determined by the identification bit contained in the short code bit, determining the intercepted value as a target identification value; and when the intercepted value is larger than the numerical upper limit value determined by the identification bit number contained in the short code bit number, determining a difference value between the intercepted value and the numerical upper limit value determined by the identification bit number contained in the short code bit number as a target identification value.
In an alternative embodiment of the present invention, the target short link generation module 740 includes: the target random value determining unit is used for taking a value in a preset random number range to obtain a target random value; and the first target short link generation unit is used for generating a target short link according to the target identification value and the target random value.
In an alternative embodiment of the present invention, after generating the target short link, the target short link generating module 740 further includes: the target random value updating unit is used for re-taking values in a preset random number range and updating the target random value when the target short link is detected to be the same as a pre-generated history short link; and the second target short link generation unit is used for generating a target short link according to the target identification value and the updated target random value.
In an alternative embodiment of the present invention, the target identification value determining module 730 includes: the target identification value determining unit is used for intercepting at a first interception position of the long-chain link identification value according to the interception bit number to obtain a target identification value; after the target short link is generated, the target identification value determining module 730 further includes: the target identification value updating unit is used for intercepting at a second interception position of the long-chain link identification value according to the interception bit number when the target short link is detected to be the same as the pre-generated history short link, and updating the target identification value, wherein the first interception position and the second interception position are different; and the third target short link generation unit is used for generating a target short link according to the updated target identification value and the target random value.
The short link generation device provided by the embodiment of the invention can execute the short link generation method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
In the technical scheme of the invention, the acquisition, storage, application and the like of the short code number, the long-chain link identification value, the first system, the second system and the like sent by the related service system all conform to the regulations of related laws and regulations and do not violate the popular public order.
Example five
Fig. 8 shows a schematic structural diagram of an electronic device 800 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 8, the electronic device 800 includes at least one processor 801, and a memory such as a Read Only Memory (ROM) 802, a Random Access Memory (RAM) 803, etc., communicatively connected to the at least one processor 801, wherein the memory stores a computer program executable by the at least one processor, and the processor 801 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 802 or the computer program loaded from the storage unit 808 into the Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
Various components in electronic device 800 are connected to I/O interface 805, including: an input unit 806 such as a keyboard, mouse, etc.; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, or the like. The communication unit 809 allows the electronic device 800 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The processor 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of processor 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 801 performs the various methods and processes described above, such as the short link generation method.
In some embodiments, the short link generation method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 800 via the ROM 802 and/or the communication unit 809. When a computer program is loaded into RAM 803 and executed by processor 801, one or more steps of the short link generation method described above may be performed. Alternatively, in other embodiments, the processor 801 may be configured to perform the short link generation method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS (Virtual Private Server ) service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (7)

1. A short link generation method, the method comprising:
acquiring short code digits sent by a service system, determining interception digits according to the short code digits, wherein the numerical upper limit value determined by the interception digits is larger than the numerical upper limit value determined by the identification digits contained in the short code digits, so as to ensure that the numerical range determined by the interception digits covers the numerical range determined by the identification digits;
acquiring a long-link identification value of a long link;
Intercepting the long-chain link identification value according to the intercepting bit number to obtain a target identification value;
generating a target short link according to the target identification value;
the numerical upper limit value determined by the interception bit number is the maximum value of the numerical values obtained when the long-chain identification value is intercepted; the numerical upper limit value determined by the identification number is the maximum value of the numerical values obtained when the target identification value is generated;
the method for intercepting the long-link identification value according to the interception bit number to obtain a target identification value comprises the following steps:
intercepting the long-chain link identification value according to the intercepting bit number to obtain an intercepting value;
adjusting the intercepted value according to the numerical upper limit value determined by the identification bit contained in the short code bit to obtain a target identification value;
the method for obtaining the target identification value comprises the following steps of:
when the intercepted value is smaller than or equal to the upper limit value of the value determined by the identification bit number contained in the short code bit number, determining the intercepted value as a target identification value;
when the intercepted value is larger than the numerical upper limit value determined by the identification bit number contained in the short code bit number, determining a difference value between the intercepted value and the numerical upper limit value determined by the identification bit number contained in the short code bit number as a target identification value;
Wherein the determining the interception bit number according to the short code bit number comprises:
acquiring a first system corresponding to the short code bit number, and generating a numerical upper limit value corresponding to the short code bit number;
acquiring a second system;
acquiring a target value which is larger than the value upper limit value corresponding to the short code bit number;
and determining the number of interception bits according to the second system and the target value.
2. The method of claim 1, wherein generating a target short link based on the target identification value comprises:
taking a value in a preset random number range to obtain a target random value;
and generating a target short link according to the target identification value and the target random value.
3. The method of claim 2, further comprising, after generating the target short link:
when the target short link is detected to be the same as a pre-generated historical short link, re-taking the value in a preset random number range, and updating a target random value;
and generating a target short link according to the target identification value and the updated target random value.
4. A method according to claim 2 or 3, wherein said intercepting the long link identification value according to the number of interception bits to obtain a target identification value comprises:
Intercepting at a first interception position of the long-chain link identification value according to the interception bit number to obtain a target identification value;
after generating the target short link, further comprising:
when the target short link is detected to be the same as a pre-generated history short link, intercepting the target short link at a second intercepting position of the long link identification value according to the intercepting bit number, and updating the target identification value, wherein the first intercepting position and the second intercepting position are different;
and generating a target short link according to the updated target identification value and the target random value.
5. A short link generation apparatus, the apparatus comprising:
the short code number acquisition module is used for acquiring the short code number sent by the service system, determining the interception number according to the short code number, wherein the numerical upper limit value determined by the interception number is larger than the numerical upper limit value determined by the identification number contained in the short code number, so as to ensure that the numerical range determined by the interception number covers the numerical range determined by the identification number;
the long link identification value acquisition module is used for acquiring long link identification values of long links;
the target identification value determining module is used for intercepting the long-chain link identification value according to the intercepting bit number to obtain a target identification value;
The target short link generation module is used for generating a target short link according to the target identification value;
the numerical upper limit value determined by the interception bit number is the maximum value of the numerical values obtained when the long-chain identification value is intercepted; the numerical upper limit value determined by the identification number is the maximum value of the numerical values obtained when the target identification value is generated;
wherein, the target identification value determining module comprises:
the interception value acquisition unit is used for intercepting the long-chain link identification value according to the interception bit number to obtain an interception value;
the target identification value determining unit is used for adjusting the intercepted value according to the numerical upper limit value determined by the identification bit number contained in the short code bit number to obtain a target identification value;
the target identification value determining unit is specifically configured to:
when the intercepted value is smaller than or equal to the upper limit value of the value determined by the identification bit number contained in the short code bit number, determining the intercepted value as a target identification value;
when the intercepted value is larger than the numerical upper limit value determined by the identification bit number contained in the short code bit number, determining a difference value between the intercepted value and the numerical upper limit value determined by the identification bit number contained in the short code bit number as a target identification value;
Wherein, the short code bit number acquisition module comprises:
the first system acquisition unit is used for acquiring a first system corresponding to the short code bit number and generating a numerical upper limit value corresponding to the short code bit number;
a second system acquisition unit configured to acquire a second system;
the target value acquisition unit is used for acquiring a target value which is larger than the value upper limit value corresponding to the short code bit number;
and the interception bit number determining unit is used for determining the interception bit number according to the second system and the target value.
6. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the short link generation method of any one of claims 1-4.
7. A computer readable storage medium storing computer instructions for causing a processor to implement the short link generation method of any one of claims 1-4 when executed.
CN202310769665.8A 2023-06-28 2023-06-28 Short link generation method, device, electronic equipment and storage medium Active CN116501997B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310769665.8A CN116501997B (en) 2023-06-28 2023-06-28 Short link generation method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310769665.8A CN116501997B (en) 2023-06-28 2023-06-28 Short link generation method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116501997A CN116501997A (en) 2023-07-28
CN116501997B true CN116501997B (en) 2023-09-26

Family

ID=87328775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310769665.8A Active CN116501997B (en) 2023-06-28 2023-06-28 Short link generation method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116501997B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116938871B (en) * 2023-09-18 2023-11-28 北京木屋时代科技有限公司 Domain name short code determining method and device, storage medium and electronic device

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101651515A (en) * 2008-08-15 2010-02-17 大唐移动通信设备有限公司 Method, system and device for adaptive modulation and coding
CN107729409A (en) * 2017-09-26 2018-02-23 中国银联股份有限公司 A kind of short chain delivers a child into method and device
CN111125569A (en) * 2019-12-25 2020-05-08 北京同邦卓益科技有限公司 Data identifier generation method and device, electronic equipment and medium
CN113505318A (en) * 2021-07-26 2021-10-15 全景智联(武汉)科技有限公司 Short link generation method, device, equipment and storage medium
CN114549068A (en) * 2022-02-15 2022-05-27 北京沃东天骏信息技术有限公司 Short link generation method, equipment, device and computer readable storage medium
CN114595665A (en) * 2022-01-22 2022-06-07 吴礼明 Method for constructing binary extremely-short code word character and word coding set
CN115098807A (en) * 2022-06-25 2022-09-23 平安银行股份有限公司 Short link generation method and related equipment thereof
WO2022242678A1 (en) * 2021-05-19 2022-11-24 北京沃东天骏信息技术有限公司 Short link generation method and apparatus, device, and storage medium
CN115640471A (en) * 2022-10-12 2023-01-24 平安消费金融有限公司 Short link generation method and device, computer equipment and storage medium
CN115914408A (en) * 2022-11-07 2023-04-04 阿里健康科技(中国)有限公司 Data analysis method and management method of short link information, and electronic device
CN116028734A (en) * 2023-02-24 2023-04-28 阿维塔科技(重庆)有限公司 Short link generation method, device, equipment and computer readable storage medium
CN116226560A (en) * 2023-03-31 2023-06-06 深圳市星卡科技股份有限公司 Short-link generation method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5394598B2 (en) * 2011-11-25 2014-01-22 パナソニック株式会社 Medical image compression apparatus, medical image compression method, and prediction knowledge database creation apparatus

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101651515A (en) * 2008-08-15 2010-02-17 大唐移动通信设备有限公司 Method, system and device for adaptive modulation and coding
CN107729409A (en) * 2017-09-26 2018-02-23 中国银联股份有限公司 A kind of short chain delivers a child into method and device
CN111125569A (en) * 2019-12-25 2020-05-08 北京同邦卓益科技有限公司 Data identifier generation method and device, electronic equipment and medium
WO2022242678A1 (en) * 2021-05-19 2022-11-24 北京沃东天骏信息技术有限公司 Short link generation method and apparatus, device, and storage medium
CN113505318A (en) * 2021-07-26 2021-10-15 全景智联(武汉)科技有限公司 Short link generation method, device, equipment and storage medium
CN114595665A (en) * 2022-01-22 2022-06-07 吴礼明 Method for constructing binary extremely-short code word character and word coding set
CN114549068A (en) * 2022-02-15 2022-05-27 北京沃东天骏信息技术有限公司 Short link generation method, equipment, device and computer readable storage medium
CN115098807A (en) * 2022-06-25 2022-09-23 平安银行股份有限公司 Short link generation method and related equipment thereof
CN115640471A (en) * 2022-10-12 2023-01-24 平安消费金融有限公司 Short link generation method and device, computer equipment and storage medium
CN115914408A (en) * 2022-11-07 2023-04-04 阿里健康科技(中国)有限公司 Data analysis method and management method of short link information, and electronic device
CN116028734A (en) * 2023-02-24 2023-04-28 阿维塔科技(重庆)有限公司 Short link generation method, device, equipment and computer readable storage medium
CN116226560A (en) * 2023-03-31 2023-06-06 深圳市星卡科技股份有限公司 Short-link generation method and device

Also Published As

Publication number Publication date
CN116501997A (en) 2023-07-28

Similar Documents

Publication Publication Date Title
CN110535970B (en) Evidence storing and processing method, device, equipment and medium of judicial chain
CN116501997B (en) Short link generation method, device, electronic equipment and storage medium
CN110602214A (en) Evidence storing and processing method, device, equipment and medium of judicial chain
CN112199412B (en) Payment bill processing method based on block chain and block chain bill processing system
CN110598058A (en) Evidence storing and processing method, device, equipment and medium of judicial chain
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN111310242B (en) Method and device for generating device fingerprint, storage medium and electronic device
CN113761565A (en) Data desensitization method and apparatus
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN116561179A (en) Data query method, device, equipment and program product
CN113935069B (en) Data verification method, device and equipment based on block chain and storage medium
CN115103024A (en) Serial number generation method and device, electronic equipment and storage medium
CN112434231A (en) Data processing method and device and electronic equipment
CN116341023B (en) Block chain-based service address verification method, device, equipment and storage medium
CN116366358A (en) Message verification method and device, electronic equipment and storage medium
CN116305277A (en) Data processing method, device, medium and electronic equipment
CN117061502A (en) File transmission method, device, equipment and storage medium
CN113379542A (en) Query method, device, medium and electronic equipment for block chain transaction
CN116405533A (en) Request sending method, request sending device, electronic equipment and storage medium
CN117527400A (en) Login authentication method and device, electronic equipment and storage medium
CN117056901A (en) Data processing method, device, electronic equipment and storage medium
CN116450674A (en) Data query method, device, electronic equipment and computer readable medium
CN118054966A (en) Data encryption method, device, equipment and medium based on symmetric key
CN117041182A (en) Main server node selection method, device, equipment and medium of distributed component
CN117951401A (en) Short address generation method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant