Short link management method and device, equipment and storage medium

By generating random sequence numbers and identifying the user ID and timestamp to generate short links, and adjusting the storage level according to the access popularity, the efficiency reduction and conflict problems caused by the increase in the number of short links in the memory database are solved, and the generation and development of short links are improved. Query efficiency.

CN119226635APending Publication Date: 2024-12-31GUANGZHOU YIHU NETWORK TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411108645.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Due to the increase in the number of short links in the in-memory database, the generation efficiency and query efficiency of short links are reduced, and the probability of conflict increases, affecting the data access efficiency.

Method used

By receiving the client's business request information, a random sequence number is generated and the user ID and request timestamp are identified, short links are generated, and the storage level of the short link database is adjusted according to the popularity of access to improve query efficiency and avoid conflicts.

Benefits of technology

It reduces the probability of conflict of short links, improves generation efficiency, and improves the query efficiency of short links through storage level adjustment, avoids storage bottlenecks in short link databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226635A_ABST
    Figure CN119226635A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a short link management method and device, equipment and a storage medium, and the method comprises the steps: receiving a source link, a user ID and a request timestamp sent by a client, generating a serial number corresponding to the source link, carrying out the identification processing of the user ID and the request timestamp, and obtaining a first short chain identifier and a second short chain identifier; performing identifier combination on the serial number, the first short chain identifier and the second short chain identifier to generate a short link, storing the short link in a short chain database, and returning the short link to the client; when an access instruction of the short link sent by the client is received, the access heat of the short link is calculated according to the access record of the access instruction; and according to the access heat, carrying out storage level adjustment on the short link in the short link database, querying a source link corresponding to the short link in the adjusted short link database, and returning page information corresponding to the source link to the client. The conflict probability of the short links is reduced, and the generation efficiency and query efficiency of the short links are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a short link management method, apparatus, device and storage medium. Background Art

[0002] Short links, also known as Short URLs, are mainly used to shorten the length of web links to make them more concise and easy to share on social media and other platforms. This technology simplifies the access path of the original link by converting the original long link into a shorter character code, thereby improving readability and ease of sharing. For example, converting a URL https: / / mp.weixin.qq.com / s / PgJyQO8LEhx47IJqFjaV1w into a short link 9e6.cn / 1. Such a short link usually consists of several characters, which is easy to share and spread quickly on social media and other platforms.

[0003] In the related technology, the short links generated historically are stored in the memory database. As the business volume continues to increase, the number of short links in the memory database increases, which affects the query efficiency of the short links, further affects the access efficiency of the data, and correspondingly affects the accuracy of the short link duplication check, resulting in a greater probability of conflict between the subsequently generated short links and the historically generated short links, affecting the efficiency of short link generation. Summary of the invention

[0004] The embodiments of the present application provide a short link management method, device, equipment and storage medium, which solves the problem that the increasing number of short links in the memory database affects the generation efficiency and query efficiency of short links, and also leads to an increasing probability of short link conflicts, further affecting the access efficiency of data. The probability of short link conflicts is reduced, the generation efficiency of short links is improved, and the query efficiency of short links is improved by adjusting the storage level of the database.

[0005] In a first aspect, an embodiment of the present application provides a short link management method, including:

[0006] Receive service request information sent by a client, the service request information including a source link, a user ID and a request timestamp, randomly generate a serial number corresponding to the source link, and perform identification processing on the user ID and the request timestamp respectively to obtain a first short link identifier and a second short link identifier;

[0007] Performing an identification combination on the serial number, the first short link identifier, and the second short link identifier to generate a short link corresponding to the source link, storing the short link in a short link database, and returning the short link to the client so that the client can perform a short link access operation;

[0008] When receiving the access instruction of the short link sent by the client, calculating the access popularity of the short link according to the access record of the access instruction;

[0009] The storage level of the short links in the short link database is adjusted according to the access popularity, the source link corresponding to the short link is queried in the adjusted short link database, and the page information corresponding to the queried source link is returned to the client.

[0010] Optionally, the performing identification processing on the user ID and the request timestamp to obtain a first short link identifier and a second short link identifier includes:

[0011] Performing base-to-base conversion on the user ID to obtain a first short link identifier;

[0012] Perform timestamp interception on the request timestamp to obtain a timestamp to be converted, and perform base conversion on the timestamp to be converted to obtain a second short link identifier.

[0013] Optionally, the access record includes the number of visitors, the number of pastes and the average access time, and the access popularity of the short link is calculated according to the access record of the access instruction, including:

[0014] Determine a first access frequency of the short link within a preset time according to the number of visits, and determine a second access frequency of the short link within the preset time according to the number of pastes;

[0015] The first access frequency, the second access frequency and the average access duration are normalized, and the access popularity of the short link is calculated according to the normalization result and a preset weight value.

[0016] Optionally, the normalizing the first access frequency, the second access frequency, and the average access duration, and calculating the access popularity of the short link according to the normalization result and a preset weight value, includes:

[0017] respectively determining the level to which the first access frequency belongs, the level to which the second access frequency belongs, and the level to which the average access duration belongs;

[0018] The access heat value of the short link is calculated according to the mapping relationship between the preset level and the access heat weight value.

[0019] Optionally, adjusting the storage level of the short links in the short link database according to the access popularity includes:

[0020] The access heat is matched with the heat value corresponding to the storage level of each short link in the short link database to obtain the target storage level of the short link, and the current storage level of the short link in the short link database is adjusted to the target storage level.

[0021] Optionally, the short link database includes a cache database and a memory database, and adjusting the current storage level of the short links in the short link database to the target storage level includes:

[0022] querying whether the short link exists in the cache database, and if the short link exists in the cache database, adjusting the current storage level of the short link in the cache database to the target storage level;

[0023] In the case that the short link does not exist in the cache data, the short link is queried in the memory database, and the current storage level of the short link in the memory database is adjusted to the target storage level.

[0024] Optionally, after calculating the access popularity of the short link according to the access record of the access instruction, the method further includes:

[0025] The recycling time of the short link is determined according to the access popularity, and the short link is recycled according to the recycling time.

[0026] In a second aspect, an embodiment of the present application provides a short link management device, including:

[0027] An information receiving module, used to receive service request information sent by a client, wherein the service request information includes a source link, a user ID and a request timestamp;

[0028] An identification processing module, used to randomly generate a serial number corresponding to the source link, and to perform identification processing on the user ID and the request timestamp respectively to obtain a first short link identification and a second short link identification;

[0029] A short link generation module, used to combine the serial number, the first short link identifier and the second short link identifier to generate a short link corresponding to the source link;

[0030] A sending module, used for storing the short link in a short link database, and returning the short link to the client, so that the client can perform a short link access operation;

[0031] An access heat calculation module, used for calculating the access heat of the short link according to the access record of the access instruction when receiving the access instruction of the short link sent by the client;

[0032] A storage level adjustment module, used for adjusting the storage level of the short links in the short link database according to the access popularity;

[0033] The query module is used to query the source link corresponding to the short link in the adjusted short link database, and return the page information corresponding to the queried source link to the client.

[0034] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the short link management method described in the first aspect.

[0035] In a fourth aspect, an embodiment of the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the short link management method as described in the first aspect.

[0036] The embodiment of the present application receives the service request information sent by the client, the service request information includes the source link, the user ID and the request timestamp, randomly generates a serial number corresponding to the source link, and performs identification processing on the user ID and the request timestamp respectively to obtain the first short link identifier and the second short link identifier; the serial number, the first short link identifier and the second short link identifier are combined to generate a short link corresponding to the source link, the short link is stored in the short link database, and the short link is returned to the client so that the client can perform a short link access operation; in the case of receiving the access instruction of the short link sent by the client, the access heat of the short link is calculated according to the access record of the access instruction; according to the access heat, the storage level of the short link in the short link database is adjusted, the source link corresponding to the short link is queried in the adjusted short link database, and the page information corresponding to the queried source link is returned to the client. Short links can be generated based on randomly generated serial numbers, user IDs and timestamps, which can avoid short link conflicts and ensure the security of short links. By identifying the corresponding storage level for the short links in the short link database and adjusting the storage level accordingly as the access popularity changes, the storage bottleneck problem in the short link database can be avoided and the query efficiency of the short link can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flow chart of a short link management method provided by an embodiment of the present application;

[0038] Figure 2 It is a flow chart of a method for calculating access popularity provided by an embodiment of the present application;

[0039] Figure 3is a level classification table provided in an embodiment of the present application;

[0040] Figure 4 is a level-weight mapping table provided in an embodiment of the present application;

[0041] Figure 5 is a flow chart of a storage level adjustment method provided in an embodiment of the present application;

[0042] Figure 6 It is a structural diagram of a short link management device provided in an embodiment of the present application;

[0043] Figure 7 It is a structural diagram of a short link management device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0046] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0047] The following is a detailed description of the short link management method, device, equipment and medium provided in the embodiments of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0048] The short link management method provided in the embodiment of the present application can be applied to various scenarios such as website optimization, VPN service, IoT device management, online marketing, social media sharing, etc. Based on the above usage scenarios, it can be understood that the executor of this solution is a terminal device with a short link management function, such as a laptop, a tablet computer, and a mobile phone.

[0049] Figure 1 is a flow chart of a short link management method provided by an embodiment of the present application, such as Figure 1 As shown, including:

[0050] Step S101, receiving business request information sent by a client, the business request information including a source link, a user ID and a request timestamp, randomly generating a serial number corresponding to the source link, and performing identification processing on the user ID and the request timestamp respectively to obtain a first short link identifier and a second short link identifier.

[0051] The service request information is used to indicate the real-time service demand information sent by the client, and the service request information may be a request information for generating a short link. The request information for generating a short link may include data information required for generating a short link, and optionally, the data information may include a source link, a user ID, and a request timestamp. The source link refers to a connection relationship from one web page to another target, and the source link usually refers to an original, direct link that directly points to the location of the target resource. A short link is a concise and readable URL generated by packaging an originally lengthy URL. A short link is usually generated by shortening the original URL to make it easier to share and remember. The user ID is the account name used by the user when logging into the website, and is also the user's identification code on the website. The user ID may consist of numbers and letters. The request timestamp is a digital value that can accurately indicate the specific time when the service request is generated. The request timestamp may include year, month, day, hour, minute, second, etc. The serial number is a unique digital or letter identification code, which is usually used for identification and anti-counterfeiting of electronic products. Optionally, in order to avoid generating a long short link, the serial number is a digital identification of less than 3 digits. Identification processing refers to simplifying the data to be processed so that the processed identification data has a certain meaning. The first short chain identification is a user identification obtained by identifying the user ID. The second short chain identification is a time identification obtained by identifying the request timestamp. In one embodiment, after receiving the source link, user ID and request timestamp sent by the client, a serial number is randomly generated to identify the source link, and the user ID and request timestamp are identified respectively. Exemplarily, the first 3 digits of the user ID are extracted to obtain the first short chain identification, the quarter to which the request belongs is determined according to the request timestamp, and the identification information associated with the quarter is determined to be the second short chain identification.

[0052] Step S102: combine the serial number, the first short link identifier, and the second short link identifier to generate a short link corresponding to the source link, store the short link in a short link database, and return the short link to the client so that the client can perform a short link access operation.

[0053] The short link database is a database for storing short links separately. The short link database may include multiple sub-databases, each with a different storage level. Accordingly, when querying short links in the short link database, the query order is determined according to the storage level. Exemplarily, short links of the first priority are stored in the first sub-database, short links of the second priority are stored in the second sub-database, and so on. In one embodiment, a pre-set short link template is obtained, and the serial number, the first short link identifier, and the second short link identifier are respectively filled into the corresponding positions of the short link template to generate a short link corresponding to the source link. In another embodiment, the serial number, the first short link identifier, and the second short link identifier may be randomly combined to generate a short link corresponding to the source link. The generated short link is stored in the short link database, and the short link is sent to the client at the same time, so that the client can perform an access operation on the short link.

[0054] Step S103: when receiving the access instruction of the short link sent by the client, calculating the access popularity of the short link according to the access record of the access instruction.

[0055] Among them, the access record of the access instruction can be used to record the number of accesses and access time of the access instruction. In one embodiment, after receiving the access instruction of the short link sent to the client, the number of accesses of the access instruction within a preset time, that is, the access frequency, is determined according to the access record of the access instruction, and the access popularity of the short link is calculated according to the access frequency and the total number of visits.

[0056] Step S104: adjusting the storage level of the short links in the short link database according to the access popularity, querying the source link corresponding to the short link in the adjusted short link database, and returning the page information corresponding to the queried source link to the client.

[0057] In one embodiment, each short link in the short link database is marked with a corresponding storage level, and the storage level is adjusted accordingly according to the change in the access popularity corresponding to the short link, and the short link with high access popularity is adjusted to a higher storage level, and the short link with low access popularity is adjusted to a lower storage level. In another embodiment, the short links with low access popularity can also be deleted from the short link database. After adjusting the storage level of the short link in the short link database, the short links in the short link database can be sorted according to the adjusted storage level, and the source link corresponding to the short link can be queried in the short link database according to the adjusted order, and the page information corresponding to the source link is returned to the client.

[0058] The embodiment of the present application receives the service request information sent by the client, the service request information includes the source link, the user ID and the request timestamp, randomly generates a serial number corresponding to the source link, and performs identification processing on the user ID and the request timestamp respectively to obtain the first short link identifier and the second short link identifier; the serial number, the first short link identifier and the second short link identifier are combined to generate a short link corresponding to the source link, the short link is stored in the short link database, and the short link is returned to the client so that the client can perform a short link access operation; in the case of receiving the access instruction of the short link sent by the client, the access heat of the short link is calculated according to the access record of the access instruction; according to the access heat, the storage level of the short link in the short link database is adjusted, the source link corresponding to the short link is queried in the adjusted short link database, and the page information corresponding to the queried source link is returned to the client. Short links can be generated based on randomly generated serial numbers, user IDs and timestamps, which can avoid short link conflicts and ensure the security of short links. By identifying the corresponding storage level for the short links in the short link database and adjusting the storage level accordingly as the access popularity changes, the storage bottleneck problem in the short link database can be avoided and the query efficiency of the short link can be improved.

[0059] In one embodiment, the user ID and the request timestamp are tokenized to obtain a first short link identifier and a second short link identifier, including:

[0060] Performing base-to-base conversion on the user ID to obtain a first short link identifier;

[0061] Perform timestamp interception on the request timestamp to obtain a timestamp to be converted, and perform base conversion on the timestamp to be converted to obtain a second short link identifier.

[0062] Among them, base conversion refers to the process of converting a number from one base representation to another base representation. In computer science and mathematics, common bases are binary (base-2), octal (base-8), decimal (base-10) and hexadecimal (base-16). Optionally, the base conversion can also be converted to base 62. The base 62 encoding system uses a specific character set, including the numbers 0-9 and lowercase and uppercase letters az, AZ, a total of 62 different symbols. This encoding method allows larger numbers to be represented by shorter strings, which is very suitable for the generation of unique identifiers. For example, the user ID value 3791648100153353 can be converted to MIDBCsbw0DTr. In one embodiment, the user ID is converted to base 62 to obtain a first short chain identifier. The request timestamp is intercepted, such as intercepting to hours, minutes and seconds, then a timestamp to be converted containing only hours, minutes and seconds is obtained, and the timestamp to be converted is converted to base 62 to obtain a second short chain identifier. In another embodiment, in order to avoid the generated short link being too long, if the first short chain identifier and the second short chain identifier are too long, the first short chain identifier and the second short chain identifier may be truncated respectively so that the length of the second short chain identifier of the first short chain identifier satisfies the length of the corresponding position in the short link template.

[0063] In the above, the first short link identifier is obtained by performing base conversion on the user ID, the timestamp interception is performed on the request timestamp to obtain the timestamp to be converted, and the timestamp to be converted is converted to obtain the second short link identifier. The identification processing can be performed by base conversion, which ensures the uniqueness of the short link while avoiding the accurate restoration of the corresponding source link through the short link, thereby affecting the security of the source link.

[0064] Figure 2 is a flow chart of a method for calculating access popularity provided by an embodiment of the present application, such as Figure 2 As shown, including:

[0065] Step S201: determining a first access frequency of the short link within a preset time according to the number of visits, and determining a second access frequency of the short link within the preset time according to the number of pastes.

[0066] Optionally, the access record includes the number of visits, the number of pastes and the average access time. The number of visits can be used to indicate the total number of people who visit the short link. The average access time indicates the average time spent on the access page associated with the short link after each visit to the short link. In one embodiment, the number of visits in the past hour is determined, that is, the first access frequency is the number of visits per hour, and the number of pastes in the past hour is determined, that is, the second access frequency is the number of pastes per hour. The more the first access frequency, the greater the corresponding access popularity, and the more the second access frequency, the greater the access popularity.

[0067] Step S202: normalize the first access frequency, the second access frequency, and the average access duration, and calculate the access popularity of the short link according to the normalization result and a preset weight value.

[0068] The longer the average access time is, the greater the access popularity is. In one embodiment, since the first access frequency, the second access frequency and the average access time have different influences on the access popularity, the first access frequency, the second access frequency and the average access time are normalized to determine a unified judgment standard for the access popularity, and the unified judgment standard can be represented by a numerical value, so as to calculate the access popularity of the short link based on the numerical value and the preset weight value.

[0069] In the above, the first access frequency of the short link within the preset time is determined according to the number of visits, and the second access frequency of the short link within the preset time is determined according to the number of pastes; the first access frequency, the second access frequency and the average access time are normalized, and the access heat of the short link is calculated according to the normalization result and the preset weight value. The influence of multiple factors on the access heat can be comprehensively considered, thereby improving the accuracy of calculating the access heat.

[0070] In one embodiment, the normalizing the first access frequency, the second access frequency, and the average access duration, and calculating the access popularity of the short link according to the normalization result and a preset weight value, includes:

[0071] respectively determining the level to which the first access frequency belongs, the level to which the second access frequency belongs, and the level to which the average access duration belongs;

[0072] The access heat value of the short link is calculated according to the mapping relationship between the preset level and the access heat weight value.

[0073] Among them, the first access frequency, the second access frequency and the average access time are respectively determined to be normalized, and the weight values ​​corresponding to the respective levels are determined, and the heat value of the short link is determined by calculating the total weight value. Figure 3 It is a level classification table provided in an embodiment of the present application. If the first access frequency is 300 people / hour, the level of the first access frequency is determined to be the second level according to the level classification table. If the second access frequency is 50 times / hour, the level of the second access frequency is determined to be the first level according to the level classification table. If the average access time is 2 minutes, the level of the average access time is determined to be the second level according to the level classification table. Figure 4 is a level-weight mapping table provided in an embodiment of the present application, such as Figure 4As shown, the weight value corresponding to the second level to which the first access frequency belongs is 30, the weight value corresponding to the first level to which the second access frequency belongs is 50, and the weight value corresponding to the second level to which the average access duration belongs is 30, so the access heat value of the short connection is calculated to be 110.

[0074] In the above, by respectively determining the level to which the first access frequency belongs, the level to which the second access frequency belongs, and the level to which the average access time belongs; the method of calculating the access heat value of the short link according to the mapping relationship between the pre-set level and the access heat weight value can convert different types of data into a unified level judgment standard, thereby further improving the accuracy of calculating the access heat.

[0075] Figure 5 is a flow chart of a storage level adjustment method provided by an embodiment of the present application, such as Figure 5 As shown, including:

[0076] Step S501, receiving business request information sent by the client, the business request information including a source link, a user ID and a request timestamp, randomly generating a serial number corresponding to the source link, and performing identification processing on the user ID and the request timestamp respectively to obtain a first short link identifier and a second short link identifier.

[0077] Step S502: combine the serial number, the first short link identifier, and the second short link identifier to generate a short link corresponding to the source link, store the short link in a short link database, and return the short link to the client so that the client can perform a short link access operation.

[0078] Step S503: when receiving the access instruction of the short link sent by the client, calculating the access popularity of the short link according to the access record of the access instruction.

[0079] Step S504: Match the access heat with the heat value corresponding to the storage level of each short link in the short link database to obtain the target storage level of the short link, and adjust the current storage level of the short link in the short link database to the target storage level.

[0080] In one embodiment, the short link database stores each short link and the current heat value and storage level of each short link. After obtaining the access heat value representing the access heat, check whether there is a target heat value matching the access heat value in the database. If so, determine that the target storage level of the short link is the same as the storage level corresponding to the target heat value. If not, determine the target storage level corresponding to the target heat value based on a pre-set mapping relationship between heat value and storage level, and adjust the current storage level of the short link in the short link database to the target storage level.

[0081] Step S505: query the adjusted short link database for the source link corresponding to the short link, and return the page information corresponding to the queried source link to the client.

[0082] As mentioned above, by matching the access popularity with the heat index corresponding to each storage level in the short link database to obtain the target storage level of the short link, the current storage level of the short link in the short link database is adjusted to the target storage level. The storage level of the short link can be adjusted based on the change in access popularity, which is beneficial to improving the query efficiency of subsequent short links.

[0083] In one embodiment, the short link database includes a cache database and a memory database, and adjusting the current storage level of the short links in the short link database to the target storage level includes:

[0084] querying whether the short link exists in the cache database, and if the short link exists in the cache database, adjusting the current storage level of the short link in the cache database to the target storage level;

[0085] In the case that the short link does not exist in the cache data, the short link is queried in the memory database, and the current storage level of the short link in the memory database is adjusted to the target storage level.

[0086] Optionally, the short link database includes a cache database and a memory database. Among them, the cache database refers to the use of a high-speed cache mechanism in the database system to store and access frequently used data to improve data reading speed and system performance. The memory database is a database system that stores data in the computer memory, and has the characteristics of high-speed reading and writing, low latency, and strong real-time performance. In one embodiment, the cache database is queried to see whether there is a short link. If there is a short link in the cache database, it proves that the short link is a frequently accessed high-heat short link, and the current storage level of the short link in the cache database is adjusted to the target storage level. If there is no short link in the cache data, it proves that the short link is a low-heat short link that is not frequently accessed. In order to avoid occupying the storage space of the cache database, the short link is stored in the memory database. Therefore, the short link can be queried in the memory database, and the current storage level of the short link in the memory database is adjusted to the target storage level.

[0087] In the above, query whether the short link exists in the cache database. If the short link exists in the cache database, adjust the current storage level of the short link in the cache database to the target storage level; if the short link does not exist in the cache data, query the short link in the memory database, and adjust the current storage level of the short link in the memory database to the target storage level. The ability to adjust the storage level of the short link based on changes in access popularity is conducive to improving the query efficiency of subsequent short links. The access speed of the short link service can be significantly improved by storing frequently accessed short links in the cache database, ensuring that users can obtain the link content in a short time. Through a reasonable data caching strategy, excessive expansion of the memory database is avoided.

[0088] In one embodiment, after calculating the access popularity of the short link according to the access record of the access instruction, the method further includes:

[0089] The recycling time of the short link is determined according to the access popularity, and the short link is recycled according to the recycling time.

[0090] Exemplarily, the recovery time of the short link is adjusted in real time according to the access heat. If the access heat increases, the recovery time of the short link is increased accordingly. For example, for every 50 increase in the access heat value, the recovery time is increased by 1 minute. After the recovery time of the short link is adjusted, it is determined whether the short link recovery condition is met based on the generation time of the short link and the adjusted recovery time. If the short link recovery condition is met, the short link in the cache database is recovered. In one embodiment, the short link with a lower storage level corresponding to the short link in the cache database can also be recovered. It can be understood that as the access heat value of each short link in the memory database increases, the short link that meets the adjustment condition is transferred to the cache database.

[0091] As described above, the recycling time of the short link is determined according to the access popularity, and the short link is recycled according to the recycling time, which can prevent the cache database from quickly reaching the capacity bottleneck due to excessive data volume.

[0092] Figure 6 is a schematic diagram of the structure of a short link management device provided in an embodiment of the present application, such as Figure 6 Said, including:

[0093] The information receiving module 61 is used to receive the service request information sent by the client, wherein the service request information includes a source link, a user ID and a request timestamp;

[0094] The identification processing module 62 is used to randomly generate a serial number corresponding to the source link, and to perform identification processing on the user ID and the request timestamp to obtain a first short link identification and a second short link identification;

[0095] A short link generation module 63, configured to combine the serial number, the first short link identifier and the second short link identifier to generate a short link corresponding to the source link;

[0096] A sending module 64, used for storing the short link in a short link database, and returning the short link to the client, so that the client can perform a short link access operation;

[0097] The access heat calculation module 65 is used to calculate the access heat of the short link according to the access record of the access instruction when receiving the access instruction of the short link sent by the client;

[0098] A storage level adjustment module 66, configured to adjust the storage level of the short links in the short link database according to the access popularity;

[0099] The query module 67 is used to query the source link corresponding to the short link in the adjusted short link database, and return the page information corresponding to the queried source link to the client.

[0100] The embodiment of the present application receives the service request information sent by the client, the service request information includes the source link, the user ID and the request timestamp, randomly generates a serial number corresponding to the source link, and performs identification processing on the user ID and the request timestamp respectively to obtain the first short link identifier and the second short link identifier; the serial number, the first short link identifier and the second short link identifier are combined to generate a short link corresponding to the source link, the short link is stored in the short link database, and the short link is returned to the client so that the client can perform a short link access operation; in the case of receiving the access instruction of the short link sent by the client, the access heat of the short link is calculated according to the access record of the access instruction; according to the access heat, the storage level of the short link in the short link database is adjusted, the source link corresponding to the short link is queried in the adjusted short link database, and the page information corresponding to the queried source link is returned to the client. Short links can be generated based on randomly generated serial numbers, user IDs and timestamps, which can avoid short link conflicts and ensure the security of short links. By identifying the corresponding storage level for the short links in the short link database and adjusting the storage level accordingly as the access popularity changes, the storage bottleneck problem in the short link database can be avoided and the query efficiency of the short link can be improved.

[0101] In a possible embodiment, the identification processing module 62 is used to:

[0102] Performing base-to-base conversion on the user ID to obtain a first short link identifier;

[0103] Perform timestamp interception on the request timestamp to obtain a timestamp to be converted, and perform base conversion on the timestamp to be converted to obtain a second short link identifier.

[0104] In a possible embodiment, the access record includes the number of visits, the number of pastes and the average access time, and the access heat calculation module 65 is used to:

[0105] Determine a first access frequency of the short link within a preset time according to the number of visits, and determine a second access frequency of the short link within the preset time according to the number of pastes;

[0106] The first access frequency, the second access frequency and the average access duration are normalized, and the access popularity of the short link is calculated according to the normalization result and a preset weight value.

[0107] In a possible embodiment, the access heat calculation module 65 is used to:

[0108] respectively determining the level to which the first access frequency belongs, the level to which the second access frequency belongs, and the level to which the average access duration belongs;

[0109] The access heat value of the short link is calculated according to the mapping relationship between the preset level and the access heat weight value.

[0110] In a possible embodiment, the storage level adjustment module 66 is used to:

[0111] The access heat is matched with the heat index corresponding to each storage level in the short link database to obtain the target storage level of the short link, and the current storage level of the short link in the short link database is adjusted to the target storage level.

[0112] In a possible embodiment, the short link database includes a cache database and a memory database, and the query module 67 is used to:

[0113] querying whether the short link exists in the cache database, and if the short link exists in the cache database, adjusting the current storage level of the short link in the cache database to the target storage level;

[0114] In the case that the short link does not exist in the cache data, the short link is queried in the memory database, and the current storage level of the short link in the memory database is adjusted to the target storage level.

[0115] In a possible embodiment, the short link management device further includes a recovery device, and the recovery device is used to:

[0116] The recycling time of the short link is determined according to the access popularity, and the short link is recycled according to the recycling time.

[0117] An embodiment of the present application also provides an electronic device, and the short link management device can integrate a short link management device provided in an embodiment of the present application. Figure 7 Schematic diagram of a short link management device provided by an embodiment of the present application. Figure 7 The short link management device includes: an input device 73, an output device 74, a memory 72 and one or more processors 71; the memory 72 is used to store one or more programs; when one or more programs are executed by one or more processors 71, the one or more processors 71 implement the short link management method provided in the above embodiment. The input device 73, the output device 74, the memory 72 and the processor 71 can be connected by a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0118] The memory 72, as a computing device readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the short link management method provided in any embodiment of the present application. The memory 72 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory 72 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 72 may further include a memory remotely arranged relative to the processor 71, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0119] The input device 73 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 74 may include a display device such as a display screen.

[0120] The processor 71 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 72, that is, implements the above-mentioned short link management method.

[0121] The short link management apparatus, device and computer provided above can be used to execute the short link management method provided in any of the above embodiments, and have corresponding functions and beneficial effects.

[0122] The embodiment of the present application further provides a storage medium storing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to execute the short link management method provided in the above embodiment. The short link management method includes:

[0123] Receive service request information sent by a client, the service request information including a source link, a user ID and a request timestamp, randomly generate a serial number corresponding to the source link, and perform identification processing on the user ID and the request timestamp respectively to obtain a first short link identifier and a second short link identifier;

[0124] Performing an identification combination on the serial number, the first short link identifier, and the second short link identifier to generate a short link corresponding to the source link, storing the short link in a short link database, and returning the short link to the client so that the client can perform a short link access operation;

[0125] When receiving the access instruction of the short link sent by the client, calculating the access popularity of the short link according to the access record of the access instruction;

[0126] The storage level of the short links in the short link database is adjusted according to the access popularity, the source link corresponding to the short link is queried in the adjusted short link database, and the page information corresponding to the queried source link is returned to the client.

[0127] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.

[0128] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application is not limited to the short link management method described above, and the computer executable instructions can also execute related operations in the short link management method provided in any embodiment of the present application.

[0129] The short link management apparatus, device and storage medium provided in the above embodiments can execute the short link management method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the short link management method provided in any embodiment of the present application.

[0130] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A short link management method, characterized in that: include: Receive service request information sent by a client, the service request information including a source link, a user ID and a request timestamp, randomly generate a serial number corresponding to the source link, and perform identification processing on the user ID and the request timestamp respectively to obtain a first short link identifier and a second short link identifier; Performing an identification combination on the serial number, the first short link identifier, and the second short link identifier to generate a short link corresponding to the source link, storing the short link in a short link database, and returning the short link to the client so that the client can perform a short link access operation; When receiving the access instruction of the short link sent by the client, calculating the access popularity of the short link according to the access record of the access instruction; The storage level of the short links in the short link database is adjusted according to the access popularity, the source link corresponding to the short link is queried in the adjusted short link database, and the page information corresponding to the queried source link is returned to the client.

2. The short link management method according to claim 1, characterized in that: The identification processing of the user ID and the request timestamp to obtain the first short link identifier and the second short link identifier includes: Performing base-to-base conversion on the user ID to obtain a first short link identifier; Perform timestamp interception on the request timestamp to obtain a timestamp to be converted, and perform base conversion on the timestamp to be converted to obtain a second short link identifier.

3. The short link management method according to claim 1, characterized in that: The access record includes the number of visitors, the number of pastes and the average access time. The access heat of the short link is calculated according to the access record of the access instruction, including: Determine a first access frequency of the short link within a preset time according to the number of visits, and determine a second access frequency of the short link within the preset time according to the number of pastes; The first access frequency, the second access frequency and the average access duration are normalized, and the access popularity of the short link is calculated according to the normalization result and a preset weight value.

4. The short link management method according to claim 3, characterized in that: The normalizing the first access frequency, the second access frequency, and the average access duration, and calculating the access popularity of the short link according to the normalization result and a preset weight value, includes: respectively determining the level to which the first access frequency belongs, the level to which the second access frequency belongs, and the level to which the average access duration belongs; The access heat value of the short link is calculated according to the mapping relationship between the preset level and the access heat weight value.

5. The short link management method according to claim 1, characterized in that: The step of adjusting the storage level of the short links in the short link database according to the access popularity includes: The access heat is matched with the heat value corresponding to the storage level of each short link in the short link database to obtain the target storage level of the short link, and the current storage level of the short link in the short link database is adjusted to the target storage level.

6. The short link management method according to claim 5, characterized in that: The short link database includes a cache database and a memory database, and the step of adjusting the current storage level of the short links in the short link database to the target storage level includes: querying whether the short link exists in the cache database, and if the short link exists in the cache database, adjusting the current storage level of the short link in the cache database to the target storage level; In the case that the short link does not exist in the cache data, the short link is queried in the memory database, and the current storage level of the short link in the memory database is adjusted to the target storage level.

7. The short link management method according to claim 6, characterized in that: After calculating the access popularity of the short link according to the access record of the access instruction, the method further includes: The recycling time of the short link is determined according to the access popularity, and the short link is recycled according to the recycling time.

8. A short link management device, characterized in that: include: An information receiving module, used to receive service request information sent by a client, wherein the service request information includes a source link, a user ID and a request timestamp; An identification processing module, used to randomly generate a serial number corresponding to the source link, and to perform identification processing on the user ID and the request timestamp respectively to obtain a first short link identification and a second short link identification; A short link generation module, used to combine the serial number, the first short link identifier and the second short link identifier to generate a short link corresponding to the source link; A sending module, used for storing the short link in a short link database, and returning the short link to the client, so that the client can perform a short link access operation; An access heat calculation module, used for calculating the access heat of the short link according to the access record of the access instruction when receiving the access instruction of the short link sent by the client; A storage level adjustment module, used for adjusting the storage level of the short links in the short link database according to the access popularity; The query module is used to query the source link corresponding to the short link in the adjusted short link database, and return the page information corresponding to the queried source link to the client.

9. An electronic device, comprising: one or more processors; A storage device, used to store one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the short link management method as described in any one of claims 1-7.

10. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the short link management method according to any one of claims 1 to 7 when executed by a computer processor.

Citation Information

Patent Citations

  • Information processing method and device and memory medium

    CN107612692A

  • Short link storage method and device

    CN113449214A

  • Cache management method and storage device

    CN115129230A

  • Data analysis method and management method of short link information, and electronic equipment

    CN115914408A

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

    CN117473176A