CN115098807A - Short link generation method and related equipment thereof - Google Patents

Short link generation method and related equipment thereof Download PDF

Info

Publication number
CN115098807A
CN115098807A CN202210731916.9A CN202210731916A CN115098807A CN 115098807 A CN115098807 A CN 115098807A CN 202210731916 A CN202210731916 A CN 202210731916A CN 115098807 A CN115098807 A CN 115098807A
Authority
CN
China
Prior art keywords
short
link
short chain
chain
long
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210731916.9A
Other languages
Chinese (zh)
Inventor
胡金凡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202210731916.9A priority Critical patent/CN115098807A/en
Publication of CN115098807A publication Critical patent/CN115098807A/en
Pending legal-status Critical Current

Links

Images

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/9558Details of hyperlinks; Management of linked annotations
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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

Abstract

The application relates to a short link generation method and related equipment, wherein the method comprises the following steps: acquiring an input long link and corresponding mechanism parameters; generating a first short chain corresponding to the mechanism parameters according to a preset short chain generation table; the first short chain is increased in an increasing mode to obtain a second short chain corresponding to the long link; converting the second short chain to obtain a third short chain in a target system form, and storing the third short chain and the long chain together into a short chain mapping table in a database; and generating short links corresponding to the long links based on the short link mapping table. According to the method and the device, the first short chain corresponding to the mechanism parameters is generated through the input long chain connection and the mechanism parameters corresponding to the long chain connection, the first short chain is increased progressively to obtain the second short chain, then the second short chain is converted to obtain the third short chain, and finally the short chain is generated based on the short chain mapping table.

Description

Short link generation method and related equipment thereof
Technical Field
The application relates to the technical field of computers, in particular to a short link generation method and related equipment.
Background
With the development of the internet, online operation activities become more and more abundant. For example, the activity page is realized by H5 technology (i.e. 5 th generation HTML), and finally, the http address link of the activity is shared by posters, friend circles and the like, so that the online activity is distributed and reached. At present, the most used method is shortcut entries such as two-dimensional codes, but the display density of the two-dimensional codes is determined by the original content. When the active http link address is too long, the defect that the two-dimensional code is too dense and cannot be scanned may occur. Based on the pain points, an http short link generation technical scheme appears, and the scheme can convert an original long link of an activity into a short http link, so that the sharing is facilitated.
However, most http short-chain generation technologies currently used in the industry are in the form of six random numbers and letters. The length requirements of partial scenes are not particularly sensitive, the service requirements can be met based on the technology, but the method has the problems of overlong links, repeated links, poor safety, inconvenience in maintenance and the like under certain scenes.
Disclosure of Invention
In view of this, the present application provides a short link generation method and related devices, which can further simplify the address length corresponding to the long link, improve the conversion and access efficiency of the long link, improve the validity and security of the long link, and facilitate maintenance.
According to an aspect of the present application, there is provided a short link generation method, including: acquiring a currently input long chain connection and mechanism parameters corresponding to the long chain connection; generating a first short chain corresponding to the mechanism parameter according to a short chain generation table preset in a database; increasing the first short chain incrementally to obtain a second short chain corresponding to the long link; carrying out scale conversion on the second short chain to obtain a third short chain in a target scale form, and storing the third short chain and the long link together to a short chain mapping table in a database; and generating a short link corresponding to the long link based on the short link mapping table.
Further, generating a first short chain corresponding to the mechanism parameter according to a short chain generation table preset in a database, including: acquiring the validity period of the long link and the domain name parameter corresponding to the long link; configuring the short chain generation table according to the valid period of the long link, the domain name parameter corresponding to the long chain connection and the mechanism parameter corresponding to the long chain connection; and generating a first short chain corresponding to the mechanism parameter according to the short chain generation table.
Further, the first short chain and the second short chain are numerical values in a decimal form, and the step-up of the first short chain is performed to obtain the second short chain corresponding to the long link, including: monitoring the input of the long link; and under the condition that the newly added long link is input, increasing the first short link according to a preset step length to obtain a second short link corresponding to the long link.
Further, the simultaneously input multiple long links exist, and when a newly added long link is input, the first short link is increased according to a preset step length to obtain a second short link corresponding to the long link, including: acquiring a plurality of processes respectively corresponding to the plurality of long links; selecting a process with the highest priority from the plurality of processes; and increasing the first short chain according to a preset step length based on the process with the highest priority to obtain a second short chain corresponding to the long link.
Further, the increasing the first short chain to obtain a second short chain corresponding to the long link further includes: acquiring the generation state of the second short chain; and under the condition that the generation state of the second short chain is failed, stopping the system conversion of the process corresponding to the second short chain, and returning abnormal information to an input end.
Further, the third short chain includes 4-digit letters and/or numbers in a 62-ary system, and the binary conversion is performed on the second short chain to obtain the third short chain in a target binary form, including: acquiring a conversion threshold value of the third short chain; under the condition that the third short chain does not exceed the conversion threshold, directly carrying out binary conversion on the second short chain to obtain a third short chain in a target binary form; and in the case that the third short chain exceeds the conversion threshold, updating the first short chain again to obtain the third short chain in the target binary form.
Further, the short link generation method further includes: inputting the short link; querying a long link corresponding to the third short link in the short link mapping table, wherein the third short link is associated with the mechanism parameter; redirecting to the long link through a jump interface.
According to still another aspect of the present application, there is provided a short link generation apparatus including: the long link acquisition module is used for acquiring a currently input long link and mechanism parameters corresponding to the long link; the first short chain generation module is used for generating a first short chain corresponding to the mechanism parameter according to a short chain generation table preset in a database; the second short chain generation module is used for increasing the first short chain to obtain a second short chain corresponding to the long link; the third short chain generation module is used for carrying out system conversion on the second short chain to obtain a third short chain in a target system form, and storing the third short chain and the long link together to a short chain mapping table in a database; and the short link generating module is used for generating a short link corresponding to the long link based on the short link mapping table.
According to yet another aspect of the present application, a computer-readable medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the short link generation method.
According to yet another aspect of the present application, there is provided an electronic device including: one or more processors; a storage device to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the short link generation method.
The method comprises the steps of obtaining a currently input long link and mechanism parameters corresponding to the long link, generating a first short link corresponding to the mechanism parameters according to a short link generation table preset in a database, increasing the first short link to obtain a second short link corresponding to the long link, carrying out binary conversion on the second short link to obtain a third short link in a target binary form, storing the third short link and the long link to a short link mapping table in the database, and generating a short link corresponding to the long link based on the short link mapping table.
Drawings
The technical solution and other advantages of the present application will become apparent from the detailed description of the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 shows a flowchart of a short link generation method according to an embodiment of the present application.
Fig. 2 shows a schematic diagram of short-chain switching of an embodiment of the present application.
Fig. 3 shows a schematic diagram of short-chain hopping of an embodiment of the present application.
Fig. 4 shows a schematic diagram of a short chain platform of an embodiment of the present application.
Fig. 5 shows a block diagram of a short link generation apparatus of an embodiment of the present application.
Fig. 6 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," and the like are used in the orientations and positional relationships indicated in the drawings for convenience in describing the present application and for simplicity in description, and are not intended to indicate or imply that the referenced devices or elements must have a particular orientation, be constructed in a particular orientation, and be operated in a particular manner, and are not to be construed as limiting the present application. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the described features. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
In the description of the present application, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; may be mechanically connected, may be electrically connected or may be in communication with each other; either directly or indirectly through intervening media, either internally or in any other suitable relationship. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
The following disclosure provides many different embodiments or examples for implementing different features of the application. In order to simplify the disclosure of the present application, specific example components and arrangements are described below. Of course, they are merely examples and are not intended to limit the present application. Moreover, the present application may repeat reference numerals and/or letters in the various examples, such repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. In addition, examples of various specific processes and materials are provided herein, but one of ordinary skill in the art may recognize applications of other processes and/or use of other materials. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present application.
The present application generally provides a short link generation method, comprising: acquiring a currently input long chain connection and mechanism parameters corresponding to the long chain connection; generating a first short chain corresponding to the mechanism parameter according to a short chain generation table preset in a database; increasing the first short chain progressively to obtain a second short chain corresponding to the long link; carrying out scale conversion on the second short chain to obtain a third short chain in a target scale form, and storing the third short chain and the long link together to a short chain mapping table in a database; and generating a short link corresponding to the long link based on the short link mapping table.
The method comprises the steps of obtaining a currently input long link and mechanism parameters corresponding to the long link, generating a first short link corresponding to the mechanism parameters according to a short link generation table preset in a database, increasing the first short link to obtain a second short link corresponding to the long link, carrying out binary conversion on the second short link to obtain a third short link in a target binary form, storing the third short link and the long link to a short link mapping table in the database, and generating a short link corresponding to the long link based on the short link mapping table.
Fig. 1 shows a flowchart of a short link generation method according to an embodiment of the present application.
As shown in fig. 1, a short link generation method according to an embodiment of the present application may include:
step S1: acquiring a currently input long chain connection and mechanism parameters corresponding to the long chain connection;
the long link may be an http link website, which is also called a Uniform Resource Locator (URL). The URL is a representation method for specifying the location of information on the internet, by which a target resource on the network can be found.
For example, the institution parameter may be an institution name. For example, bank a and bank B are two different banking institutions. After visiting the official websites of the two, respectively, two different long links can be obtained, which correspond to the two banking institutions, respectively. Of course, the institution parameter may also be other parameters such as the address of the institution, the product name, etc., and the specific meaning of the institution parameter is not limited in this application.
Step S2: generating a first short chain corresponding to the mechanism parameter according to a short chain generation table preset in a database;
the short-chain generation table of the present application may be preset. The short chain generation table may include the institution parameters, and domain name parameters and valid periods of long links corresponding to each institution. The first short chain has a correlation with the mechanism parameter. For example, the first short chain generated may be in different numerical intervals for different institutions. It is understood that the mapping relationship between the mechanism parameter and the first short chain is not limited in the present application.
Further, generating a first short chain corresponding to the mechanism parameter according to a short chain generation table preset in a database, including:
step S21: acquiring the valid period of the long link and the domain name parameter corresponding to the long link;
for example, bank a may be referred to as bankwf for short, and the domain name parameter corresponding to the bank may be bankwf. In the application, the domain name parameter can also be set by self-definition. The short link may include the domain name parameter, i.e., the domain name parameter may be assembled in the short link of the present application.
Step S22: configuring the short chain generation table according to the valid period of the long link, the domain name parameter corresponding to the long chain connection and the mechanism parameter corresponding to the long chain connection;
in practical applications, the long links may belong to different organizations, and each organization has different domain name parameters. Additionally, the associated activities of the mechanism may have a time limit, with the activities closing after an age is exceeded. When the long link expires, the expired long link and the corresponding short link may be removed from the short link generation table, so as to reduce the query burden of the database.
Illustratively, for the same organization, the domain name parameters are the same, and at this time, if the long link is permanently valid, the short link and the long link may be in a one-to-one mapping relationship; if the long link deadline is valid, multiple short links may correspond to the same long link. Under the condition that mechanisms are different, domain name parameters can be different, at the moment, because the first short chain of the application corresponds to the mechanism parameters, long chain joints corresponding to different mechanisms can be the same, short chain joints of different mechanisms can also be the same, and the long chain joints and the short chain joints do not influence each other. Through fusing mechanism's parameter in the generation process of short chain, this application can reduce the repetition of short chain, promotes the security of short chain, makes things convenient for the maintenance of short chain.
Step S23: and generating a first short chain corresponding to the mechanism parameter according to the short chain generation table.
Wherein, the generated first short chain can be stored in the short chain mapping table. The first short chains have a mapping relationship with the mechanism parameters, and each mechanism may correspond to one first short chain (short _ num).
Step S3: increasing the first short chain progressively to obtain a second short chain corresponding to the long link;
wherein the first short chain may be incrementally increased by optimistic lock control. The optimistic lock considers that no other thread modifies the data when the optimistic lock uses the data, and only judges whether other threads update the data before the optimistic lock updates the data. If the data is not updated, the current thread can successfully write the data modified by the current thread. Due to the fact that the self-increment of the first short chain is relatively simple, unnecessary locking expenditure can be avoided by adopting an optimistic lock, and the generation efficiency of the short chain is improved.
Wherein the first short chain and the second short chain are numerical values in decimal form. The first short chain may be an initial decimal value at the beginning of the increment, and the second short chain may be a decimal value incremented by a preset step size. The second short chain corresponds to the long link currently being entered.
Further, the increasing the first short chain to obtain a second short chain corresponding to the long link includes:
step S31: monitoring the input of the long link;
step S32: and under the condition that the newly added long link is input, increasing the first short chain according to a preset step length to obtain a second short chain corresponding to the long link.
In one example, the preset step size may be 1. The first short chain is short chain data in an initial state, and may be configured as 1. When a newly input long chain joint input is monitored, the first short chain starts to be increased by 1, and a value 2 obtained after the increase is the second short chain corresponding to the newly input long chain joint. Namely, the second short chain is in one-to-one correspondence with the newly input long chain. Thus, whenever a long chain input with a new input is heard, the first short chain starts incrementing until the first short chain overflows.
Further, there are a plurality of the long links input at the same time. Under the condition that the newly added long link is input, the first short link is increased according to a preset step length to obtain a second short link corresponding to the long link, and the method comprises the following steps:
step S321: acquiring a plurality of processes respectively corresponding to the plurality of long links;
step S322: selecting a process with the highest priority from the plurality of processes;
step S323: and increasing the first short chain according to a preset step length based on the process with the highest priority to obtain a second short chain corresponding to the long link.
In the present application, when multiple processes modify the first short chain simultaneously, one and only one process can successfully modify the first short chain. At this time, a process with the highest priority may be selected from the plurality of processes. Specifically, the process with the highest priority may be randomly selected, or the process with the highest priority may be selected according to the mechanism parameter. There are various ways how to select the process with the highest priority, and the application is not limited thereto.
Further, the increasing the first short chain to obtain a second short chain corresponding to the long link further includes:
step S33: acquiring the generation state of the second short chain;
step S34: and under the condition that the generation state of the second short chain is failed, stopping the system conversion of the process corresponding to the second short chain, and returning abnormal information to an input end.
Specifically, after the process with the highest priority successfully modifies the first short chain, the decimal second short chain is converted into a 62-system third short chain, and the third short chain and the corresponding long chain are connected together and stored in a short chain mapping table and returned to the calling party. When the generation state of the second short chain is failed, subsequent binary conversion is not performed, and the process which fails to modify directly returns error information (namely, an abnormal code).
Illustratively, the exception code may be defined as follows according to table 1:
TABLE 1 Exception code definitions
Figure BDA0003714061900000081
For example, in the case of a request timeout, the exception code returned may be 900104. It is to be understood that the definition of the exception code in the present application may be adjusted according to actual situations, and the list of the exception code in table 1 is exemplary rather than exhaustive, and the definition of the exception code in the present application is not limited.
Step S4: carrying out scale conversion on the second short chain to obtain a third short chain in a target scale form, and storing the third short chain and the long link together to a short chain mapping table in a database;
wherein the third short chain comprises a 62-ary 4-bit string, and the 4-bit string may be letters and/or numbers. For example, the 62-ary character sequence may be:
eqHnWrkaIzxTJ5YQfi1GUd3MKsyOXo09RwpDVNglLECmv824tjB6uPcbF7hAZS。
specifically, a 62-ary character string may consist of 62 letters or numbers, a-Z, A-Z, 0-9. The carry rule in 62 is that whenever 62 goes 1, the display rule can be set to carry left. Since the third short chain of the present application is 4-position, there may be (26+26+10) in total 4 14776336 combinations can satisfy most use scenarios.
For example, eeeq at 62 may correspond to eeh at 10, eeh at 62 may correspond to eeen at 10, eeen at 62 may correspond to 3 at 10. Since the second short chain is a decimal value, the decimal value can be subjected to binary conversion to obtain a 62-ary third short chain. Thus, a mapping relationship is established between the third short chain and the long link.
Further, performing a binary conversion on the second short chain to obtain a third short chain in a target binary form, including:
step S41: acquiring a conversion threshold value of the third short chain;
step S42: under the condition that the third short chain does not exceed the conversion threshold, directly carrying out binary conversion on the second short chain to obtain a third short chain in a target binary form;
step S43: and in the case that the third short chain exceeds the conversion threshold, updating the first short chain again to obtain the third short chain in the target binary form.
For example, since the third short chain in this application is a 4-bit value in 62, the maximum value is ZZZZZZ (14776335) in 62. That is, the switching threshold of the third short link may be 14776335. When the converted third short chain reaches 14776336 and exceeds the conversion threshold, the third short chain overflows, and the generated third short chain is a 5-bit short chain, and the third short chain needs to be monitored. At this point, the first short chain may be reset, for example to 1 or another constant, and then steps 3 and 4 may be repeated to generate a new third short chain. And when the third short chain overflows, the overflow information can be returned to remind the user.
After the third short chain in the target scale form is obtained, the third short chain may be stored to a short chain mapping table in a database together with the long link. It should be noted that the short-chain mapping table may further store the domain name parameter, the time duration of the long link, and the like. Short-chain data which is queried and converted can be cached in a database so as to improve query efficiency.
Fig. 2 shows a schematic diagram of short chain switching of an embodiment of the present application.
As shown in fig. 2, when a long link needs to be converted into a short link, a long link interface may be called first, and then it is determined whether an IP corresponding to the long link is in a preset white list. If the IP corresponding to the long link is positioned in the white list, the long link can be converted into the short link, and the corresponding relation between the long link and the short link is stored in a short link mapping table; if the IP corresponding to the long link is positioned outside the white list, the corresponding error code can be returned. After the corresponding relation between the long link and the short link is stored in the short link mapping table, an access log of the long link to the short link interface can be recorded, and then the generated short link is returned.
Step S5: and generating a short link corresponding to the long link based on the short link mapping table.
The short link may include a third short link in a 62-ary form, and may further include a transport protocol such as http and https, and the domain name parameter. In the present application, the distinction between http and https may be sensitive. It is understood that the application is not limited to how the third short chain is further encapsulated to obtain the short link.
Further, the short link generation method further includes:
step S6: inputting the short link;
the short link can be input on a short-chain platform, and the short-chain platform can be a cloud-end platform or application software.
Further, the short-chain platform performs long-short link conversion and recording, meanwhile, the short-chain platform queries and jumps to the corresponding long link through short-chain access, and the short-chain platform can be realized based on a SpringBoot framework. The Spring boot is a scaffold, is constructed on the basis of a Spring framework, provides an automatic configuration function based on a quick construction concept, can simplify the initial construction and development process of new Spring application, can realize functions of instant use after opening a box, starting dependence, automatic configuration, health check and the like, and is simple and convenient.
Step S7: querying a long link corresponding to the third short link in the short link mapping table, wherein the third short link is associated with the mechanism parameter;
specifically, the 4-bit short chain of the application can jump to the corresponding long link by querying the database, and the long link of the corresponding mechanism corresponding to the 4-bit short chain in the short chain mapping table is queried by distinguishing the mechanism through a main (i.e. host) in a request (i.e. request) header of the short chain platform, and then the long link is jumped to the long link.
It should be noted that, in the present application, short links including st in paths may be set to access the jump interface of the short-link platform through http and https at the same time. If the short chain of the https type does not contain the st path, exception information 404 is directly returned.
In one example, a reverse proxy Nginx configuration may be employed to access short-chain hops. Specifically, the following configuration may be added to the applied Nginx:
location/st{
proxy _ pass http:// application F5 Server ip: port;
proxy_set_header Host$host;
proxy_set_header X-Real-IP$remote_addr;
proxy_set_header X-Forwarded-For$proxy_add_x_forwarded_for;
}
among them, the Nginx (same pronunciation engine x) is a lightweight Web server/reverse proxy server and email (IMAP/POP3) proxy server, which can be used to implement short-chain jump. And the Nginx is adopted to realize short-chain skipping, so that the efficiency of short-chain skipping can be further improved.
Step S8: redirecting to the long link through a jump interface.
Fig. 3 shows a schematic diagram of short-chain hopping of an embodiment of the present application.
As shown in fig. 3, when a short link is required to jump or access a corresponding long link, the short link may be called to obtain a long link interface, and then whether an IP corresponding to the short link is in a preset white list is determined. If the IP corresponding to the short chain is positioned in the white list, the corresponding long chain link can be inquired according to the short chain in the database; and if the IP corresponding to the short chain is positioned outside the white list, returning a corresponding error code. Then, under the condition that the corresponding long link can be inquired, recording an access log of a short-chain acquisition long-link interface, and then returning the long link; and returning a corresponding error code under the condition that the corresponding long link cannot be inquired.
Therefore, the 4-bit short chain generation scheme can provide high-availability long-chain-to-short-chain service, is more simplified and efficient, and facilitates processing of on-line links of operation activities and the like by service operators. The design standard of the scheme is based on the principles of short chain, simple length, high safety, easiness in maintenance, high generation speed and the like. The technical scheme can be used for realizing platform implementation to build a set of short-chain service platform and meet service requirements from scenes such as generation, maintenance, use, data statistics and the like.
Fig. 4 shows a schematic diagram of a short chain platform of an embodiment of the present application.
As shown in fig. 4, the short-chain platform of the present application may be a cloud platform, and may be implemented based on a proprietary network vpc (virtual Private cloud) mode. The private network VPC can be divided into two basic network areas, a quarantine Zone (DMZ) and a Server Farm (SF).
The DMZ network area is an area isolated between an intranet and the internet, and is usually configured with a web server or a front-end proxy server, which can provide services to the internet by opening a firewall. The SF network region may be a region where intranet applications and core applications are deployed.
Referring to fig. 4, the short-chain platform may further include a Load Balance (i.e., Load Balance) F5, which is capable of balancing a Load (a work task) and distributing the Load to a plurality of operation units for execution, such as a Web server, an FTP server, an enterprise critical application server, and other critical task servers, so as to collectively complete the work task.
In fig. 4, bank a and bank B may be two different banking institutions. The internet access address of bank A can be https:// application.qsbank.cc or http:// a.qsbank.cc, and the internet access address of bank B can be http:// xykappa 1.bankwf.com or https:// xykappa 1.bankwf.com. Two databases corresponding to the same organization can respectively store corresponding internet access addresses.
Further, an apply () method may be used to call a domain name parameter in the internet access address of different mechanisms, bound through 443 ports and 80 ports. The bound data may be sent to load balancing F5 for separate processing. And then the short-chain jump is realized through a reverse proxy Nginx. During the jumping process, the network application (i.e., net application) can also be processed through the nginnx, and the data flow between the network application and the nginnx is balanced through the 80 ports and the 443 ports in cooperation.
For example, when the operator receives the latest operation activity, the operator arranges the long-chain grounding address corresponding to the activity link and logs on the short-chain platform. Then, the activity operator inputs basic information such as a long-chain address and an effective period in corresponding short-chain management on the short-chain platform to create short-chain link information to be used. Then, after the operator takes the short link, the availability of the access verification link is locally performed, and if the verification is normal, the short link is applied to a carrier for activity promotion, such as a two-dimensional code, a poster and the like. When the activity is finished, the validity period of the link can be controlled through the short-chain platform, and the link is set to be invalid.
This application can let activity operation personnel adopt the long chain to change the short chain according to the operation demand of oneself through being based on the short chain of quadbit connects and generates the short chain that the quadbit is available for the creation of activity operation carriers such as two-dimensional code, poster has simplified the activity address length that the long chain connects, can put in on more links carriers. On the basis of meeting the active operation, the effectiveness and the safety of the long link are ensured. Meanwhile, according to the scheme, data statistics and monitoring of active link access can be performed, and all the configuration and maintenance of the active links realized through the scheme can be performed on a visualization platform, so that statistics of various dimensions, such as success rate, failure rate, transmission time and the like, can be performed. By the scheme, the requirement of converting the active long link address into the short link address can be quickly realized, the link can be quickly and flexibly configured, the execution efficiency of service requirements can be improved, and the response rate of service operation is further improved.
Fig. 5 shows a block diagram of a short link generation apparatus of an embodiment of the present application.
As shown in fig. 5, the short link generation device 50 of the embodiment of the present application may include:
a long link obtaining module 51, configured to obtain a currently input long link and a mechanism parameter corresponding to the long link;
a first short-chain generation module 52, configured to generate a first short chain corresponding to the mechanism parameter according to a short-chain generation table preset in the database;
a second short chain generation module 53, configured to increment the first short chain to obtain a second short chain corresponding to the long link;
a third short chain generation module 54, configured to perform binary conversion on the second short chain to obtain a third short chain in a target binary form, and store the third short chain and the long link together in a short chain mapping table in a database;
and a short link generating module 55, configured to generate a short link corresponding to the long link based on the short link mapping table.
Furthermore, the present application provides a computer-readable medium, on which a computer program is stored, which computer program, when being executed by a processor, realizes the short link generation method.
Further, the present application also provides an electronic device, including: one or more processors; a storage device to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the short link generation method.
Fig. 6 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 6, the electronic device may be used to implement the service code-based test method. In particular, the electronic device may comprise a computer system. It should be noted that the electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the use range of the embodiment of the present application.
As shown in fig. 6, the computer system includes a Central Processing Unit (CPU)1801, which can perform various appropriate actions and processes, such as executing the method described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 1802 or a program loaded from a storage portion 1808 into a Random Access Memory (RAM) 1803. In the RAM 1803, various programs and data necessary for system operation are also stored. The CPU 1801, ROM 1802, and RAM 1803 are connected to each other via a bus 1804. An Input/Output (I/O) interface 1805 is also connected to bus 1804.
The following components are connected to the I/O interface 1805: an input portion 1806 including a keyboard, a mouse, and the like; an output section 1807 including a Display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 1808 including a hard disk and the like; and a communication section 1809 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1809 performs communication processing via a network such as the internet. A driver 1810 is also connected to the I/O interface 1805 as needed. A removable medium 1811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1810 as necessary, so that a computer program read out therefrom is mounted in the storage portion 1808 as necessary.
In particular, according to embodiments of the present application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 1809, and/or installed from the removable media 1811. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 1801.
It should be noted that the computer readable media shown in the embodiments of the present application may be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having 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), a 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. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The service code-based test method and the related devices provided by the embodiment of the present application are introduced in detail, and a specific example is applied in the description to explain the principle and the implementation of the present application, and the description of the embodiment is only used to help understand the technical scheme and the core idea of the present application; those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications or substitutions do not depart from the spirit and scope of the present disclosure as defined by the appended claims.

Claims (10)

1. A method of short-chain generation, the method comprising:
acquiring a currently input long chain connection and mechanism parameters corresponding to the long chain connection;
generating a first short chain corresponding to the mechanism parameter according to a short chain generation table preset in a database;
increasing the first short chain incrementally to obtain a second short chain corresponding to the long link;
carrying out scale conversion on the second short chain to obtain a third short chain in a target scale form, and storing the third short chain and the long link together to a short chain mapping table in a database;
and generating a short link corresponding to the long link based on the short link mapping table.
2. The short link generation method according to claim 1, wherein generating a first short link corresponding to the mechanism parameter according to a short link generation table preset in a database includes:
acquiring the valid period of the long link and the domain name parameter corresponding to the long link;
configuring the short chain generation table according to the valid period of the long link, the domain name parameter corresponding to the long chain connection and the mechanism parameter corresponding to the long chain connection;
and generating a first short chain corresponding to the mechanism parameter according to the short chain generation table.
3. The short link generation method of claim 1, wherein the first short link and the second short link are numerical values in decimal form, and incrementing the first short link to obtain a second short link corresponding to the long link comprises:
monitoring the input of the long link;
and under the condition that the newly added long link is input, increasing the first short link according to a preset step length to obtain a second short link corresponding to the long link.
4. The method of claim 3, wherein a plurality of the long links are input simultaneously, and when the newly added long link is input, the first short link is increased according to a preset step size to obtain a second short link corresponding to the long link, the method comprising:
acquiring a plurality of processes respectively corresponding to the plurality of long links;
selecting a process with the highest priority from the plurality of processes;
and increasing the first short chain according to a preset step length based on the process with the highest priority to obtain a second short chain corresponding to the long link.
5. The method of claim 4, wherein incrementing the first short chain to obtain a second short chain corresponding to the long link, further comprises:
acquiring the generation state of the second short chain;
and under the condition that the generation state of the second short chain is failed, stopping the system conversion of the process corresponding to the second short chain, and returning abnormal information to an input end.
6. The short link generation method of claim 1, wherein the third short link comprises 4-digit letters and/or numbers in 62-system, and performing a system conversion on the second short link to obtain the third short link in a target system form comprises:
acquiring a conversion threshold value of the third short chain;
under the condition that the third short chain does not exceed the conversion threshold, directly carrying out binary conversion on the second short chain to obtain a third short chain in a target binary form;
and in the case that the third short chain exceeds the conversion threshold, updating the first short chain again to obtain the third short chain in the target binary form.
7. The short link generation method of claim 1, further comprising:
inputting the short link;
querying a long link corresponding to the third short link in the short link mapping table, wherein the third short link is associated with the mechanism parameter;
redirecting to the long link through a jump interface.
8. A short link generation apparatus, comprising:
the long link acquisition module is used for acquiring a currently input long link and mechanism parameters corresponding to the long link;
the first short chain generation module is used for generating a first short chain corresponding to the mechanism parameter according to a short chain generation table preset in a database;
the second short chain generation module is used for increasing the first short chain to obtain a second short chain corresponding to the long link;
the third short chain generation module is used for carrying out system conversion on the second short chain to obtain a third short chain in a target system form, and storing the third short chain and the long link together to a short chain mapping table in a database;
and the short link generating module is used for generating a short link corresponding to the long link based on the short link mapping table.
9. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the short link generation method according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the short link generation method of any one of claims 1 to 7.
CN202210731916.9A 2022-06-25 2022-06-25 Short link generation method and related equipment thereof Pending CN115098807A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210731916.9A CN115098807A (en) 2022-06-25 2022-06-25 Short link generation method and related equipment thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210731916.9A CN115098807A (en) 2022-06-25 2022-06-25 Short link generation method and related equipment thereof

Publications (1)

Publication Number Publication Date
CN115098807A true CN115098807A (en) 2022-09-23

Family

ID=83292468

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210731916.9A Pending CN115098807A (en) 2022-06-25 2022-06-25 Short link generation method and related equipment thereof

Country Status (1)

Country Link
CN (1) CN115098807A (en)

Cited By (1)

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

Cited By (2)

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

Similar Documents

Publication Publication Date Title
US10754631B2 (en) Tenant upgrade analytics
US20220100553A1 (en) Systems and methods for tuning containers in a high availability environment
US7409440B1 (en) User defined data items
CN104333567B (en) It is the web cachings serviced using safety
CN104067276B (en) Client-side minimum is downloaded and the page navigation feature of simulation
US20080021696A1 (en) System and method of providing a fast path link for an identified set of data
US11546380B2 (en) System and method for creation and implementation of data processing workflows using a distributed computational graph
CN107534691A (en) The long-range removing of DNS caches
US11363068B2 (en) Method and system for providing a complete traceability of changes incurred in a security policy
US9223672B1 (en) Method and system for providing error repair status data to an application user
CN109117252A (en) Method, system and the container cluster management system of task processing based on container
CN109981745A (en) A kind of journal file processing method and server
CN115098807A (en) Short link generation method and related equipment thereof
JP2022547490A (en) System and method for mobile digital currency futures exchange
US10324766B1 (en) Task profile collection
CN111800511B (en) Synchronous login state processing method, system, equipment and readable storage medium
CN108112268A (en) Management and the relevant load balancer of automatic expanded set
CN113704765A (en) Operating system identification method and device based on artificial intelligence and electronic equipment
KR20210000041A (en) Method and apparatus for analyzing log data in real time
US11210156B1 (en) Intelligent distributed tracing
CN109672563B (en) Gateway configuration method and device and API gateway
CN113590358A (en) Service concurrency control method and device based on RPA
US10838950B2 (en) Dynamic review cadence for intellectual capital
US20190087902A1 (en) Occupational telemedicine
Dunn et al. What Your {CDN} Won't Tell You: Optimizing a News Website for Speed and Stability

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