CN113254813B - Short link generation method, device, server and computer readable medium - Google Patents

Short link generation method, device, server and computer readable medium Download PDF

Info

Publication number
CN113254813B
CN113254813B CN202010089967.7A CN202010089967A CN113254813B CN 113254813 B CN113254813 B CN 113254813B CN 202010089967 A CN202010089967 A CN 202010089967A CN 113254813 B CN113254813 B CN 113254813B
Authority
CN
China
Prior art keywords
link address
client
short link
shopping cart
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010089967.7A
Other languages
Chinese (zh)
Other versions
CN113254813A (en
Inventor
徐斌
房文龙
韩笑跃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Multipoint Shenzhen Digital Technology Co ltd
Original Assignee
Multipoint Shenzhen Digital Technology 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 Multipoint Shenzhen Digital Technology Co ltd filed Critical Multipoint Shenzhen Digital Technology Co ltd
Priority to CN202010089967.7A priority Critical patent/CN113254813B/en
Publication of CN113254813A publication Critical patent/CN113254813A/en
Application granted granted Critical
Publication of CN113254813B publication Critical patent/CN113254813B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/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
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3276Short range or proximity payments by means of M-devices using a pictured code, e.g. barcode or QR-code, being read by the M-device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the disclosure discloses a short link generation method, a short link generation device, a server and a computer readable medium. One embodiment of the method comprises the following steps: acquiring shopping cart data of a client; generating an original link address of payment based on the shopping cart data; determining whether to open short link degradation; generating a short link address based on the original link address in response to not opening; and responding to the opening, and directly returning to the original link address of the client. According to the embodiment, the payment two-dimension code is optimized, the time for identifying the two-dimension code by the mobile phone of the user is reduced, the user accounts are checked out more safely, quickly and stably, and the user experience is improved.

Description

Short link generation method, device, server and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a short link generation method, apparatus, server, and computer readable medium.
Background
In the existing technical schemes for converting long link into short link, most of the technical schemes are that an original link address URL character string is output into a code with a fixed length through a hash discrete operation mode, and when the short link needs to be analyzed, a server can find the original link address URL mapped with the short link to redirect the address. In the existing mode, the number of the converted short links is in direct proportion to the possibility of hash collision, and as the length of the short links is between 4 and 7 characters, the value range of the hash function is too small, the possibility of collision is gradually increased, and then the same short link generated by the scheme can correspond to a plurality of different original URLs, so that access errors occur when a user accesses the short links, non-uniqueness and instability are caused, and the user experience is reduced.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a short link generation method, apparatus, server and computer readable medium to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a short link generation method, for obtaining shopping cart data of a client; generating an original link address of payment based on the shopping cart data; determining whether to open short link degradation; generating a short link address based on the original link address in response to not opening; and responding to the opening, and directly returning to the original link address of the client.
In a second aspect, some embodiments of the present disclosure provide an apparatus for short link generation, including: an acquisition unit configured to acquire shopping cart data of a client; an original address generation unit configured to generate an original link address of payment based on the shopping cart data; a determining unit configured to determine whether to open short link degradation; a short link generation unit configured to generate a short link address based on the original link address in response to not turning on the short link degradation; and the return unit is configured to return the original link address paid by the client directly in response to opening the short link degradation.
In a third aspect, some embodiments of the present disclosure provide a server comprising: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors cause the one or more processors to implement a method as in the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program when executed by a processor implements a method as in the first aspect.
One of the above embodiments of the present disclosure has the following advantageous effects: the original link address of payment is generated through the data of the client shopping cart, and the short link address is generated according to the original link address, so that the optimization of the two-dimension code of payment is realized, the time for identifying the two-dimension code by a user mobile phone is reduced, the user checkout is safer, faster and more stable, and the user experience is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is an architecture diagram of an exemplary system in which some embodiments of the present disclosure may be applied;
FIG. 2 is a flow chart of some embodiments of a short link generation method according to the present disclosure;
FIG. 3 is a flow chart of the generation of an original link address according to some embodiments of the present disclosure;
FIG. 4 is a block diagram of short link addresses in accordance with some embodiments of the present disclosure;
fig. 5 is a flow chart for client checkout according to some embodiments of the present disclosure.
Fig. 6 is a flow diagram for short link address verification according to some embodiments of the present disclosure.
Fig. 7 is a flow chart of one particular embodiment of a short link verification method according to the present disclosure.
FIG. 8 is a schematic structural view of some embodiments of a short link generation apparatus according to the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of an application scenario of a short link generation method according to some embodiments of the present application.
As shown in fig. 1, it includes a client 101 and a server 103, which interact through a network 102. The user may self-service swipe items on the client 101, generate shopping cart data from the client 101, and when the user clicks a checkout button on the client 101, the client 101 sends the shopping cart data to the server 103 via the network 102. The server 103 generates an original link address for payment from the shopping cart data and may store the original link address in a database, such as a remote dictionary service (Redis) database. After that, the server 103 determines whether the degradation service is started, and if not, the server 103 generates a short link address, for example, a short link address, according to the shopping cart identification id, the client identification id, and the timestamp in the shopping cart data: "https:// xxx. Com/qr/v_bRKA_a1c3". The short link address generation process is generated by the server according to a specific conversion manner, which will be described in detail below; the server 103 returns the short link address to the client 101, the client 101 can generate a simplified two-dimensional code according to the short link address, the expiration time is set to be 15 minutes, a user checks out the account through the simplified two-dimensional code, and if the user does not scan and pay for the simplified two-dimensional code within 15 minutes, the simplified two-dimensional code is invalid; if the server 103 starts the degradation service, the server 103 directly returns the original link address of the payment to the client 101, and the client 101 generates the two-dimensional code according to the original link address, so that when the mobile phone configuration of the user is not high enough, the user can be prevented from settling accounts through the two-dimensional code, the expiration time can be set to be 15 minutes, and if the user does not scan the two-dimensional code within 15 minutes, the two-dimensional code can be invalid. The entire interaction process between the client 101 and the server 103 is also substantially the entire process of user checkout, and see fig. 5.
The client 101 may be a self-service cashing device, or may be various electronic devices with information processing capability, including but not limited to a smart phone, a tablet computer, an electronic book reader, a laptop portable computer, a desktop computer, and the like. It should be noted that the short link generation method provided by the embodiment of the present disclosure may be performed by the server 103. The server may be hardware or software. When the server is hardware, the server may be implemented as a distributed server cluster formed by a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
It should be understood that the number of clients and servers in fig. 1 is merely illustrative. There may be any number of clients and servers, as desired for an implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a short link generation method according to the present disclosure is shown. The short link generation method comprises the following steps:
in step 201, shopping cart data of a client is obtained.
In some embodiments, the execution entity of the short link generation method (e.g., the server shown in FIG. 1) may obtain shopping cart data for the client after the user scans the item barcode. The shopping cart data comprises shopping cart identification id, article quantity, price, client data, store data, time stamp formed by time division and second, and the like. The shopping cart identification id may be, for example, an identification of this shopping list. The client data may be, as an example, an identification id of the self-service cashier device. The store data may be, by way of example, an identification id of the physical store. The timestamp may be time information consisting of time-divided seconds, which may be this shopping cart checkout time as an example: nine points for thirty minutes.
Step 202, generating an original link address for payment based on the shopping cart data.
In some embodiments, based on the shopping cart data obtained in step 201, the executing entity (e.g., the server shown in fig. 1) may generate the original link address for the payment based on the shopping cart data. The original link address is a link address for generating a two-dimensional code when checkout, and may be, as an example: https? dmshowshare=false & dmshowcard=false & redirect type=smartcut & redirect version=3_8_0 & cartid=a1c3 & storid=12 & price=56.66 & from=galxy & cartdeviceid=17 & t=brka.
In some optional implementations of some embodiments, the client data, the store data, and the timestamp are spliced into the original link address; storing the original link address according to a corresponding form of a keyword-numerical key-value attribute of a database, wherein the keyword key stores a client identifier in the client data, and the numerical value stores the original link address.
For example, referring to fig. 3, the original link generation flow: the acquired shopping cart id, i.e. the cartId, the store id, i.e. the store id, the settlement amount price, the client data, i.e. the cartDeviceId, the timestamp t, may all be spliced into the original link address. The original links are saved into a database (such as Redis), the client identifier, namely 17, is saved by using an attribute key, the original link address corresponding to the client identifier 17, namely' https:// xxx.com/smartcyart. HtmldmShowShare=false & dmShowCart=false & redirect type=smartart & redirect version=3_8_0 & cartId=a1c 3& stoneid=12 & price=56.66 & from=glaxy & cartDeviceid=17 & t=bRKA is saved by using a numerical value.
Step 203, it is determined whether to turn on short link downgrading.
In some embodiments, the execution body of the short link generation method determines whether to initiate short link degradation. Short link downgrade is to provide one or more control modes to control whether short link addresses are generated, which can be realized by hardware or software, for example, can be controlled by a control switch.
In some optional implementations of some embodiments, the execution body determining whether to initiate short link downgrading includes: setting a short link degradation switch; determining whether the database is available; generating the short link address in response to the database being available with the short link downgrade switch in an off state; and responding to the unavailability of the database, opening the short link degradation switch, and directly returning the original link address paid by the client. The short link downgrade switch is a switch for controlling whether to start the short link downgrade service, and the downgrade switch can be implemented by a program or hardware as an example. Determining whether a database is available may be by: for example, if the database has a large number of query timeouts or if the corresponding data is not queried, then it is determined that the database is not available. Short link downgrading schemes may include both automatic downgrading and manual downgrading. Automatic degradation mode: when the URL of the original link address is stored abnormally, the process of generating the short link address is not performed, and the URL of the original link address is automatically returned to the client directly, so that the user can pay for the normal checkout. And manual degradation can be realized through a short link degradation switch: under normal conditions, the short link downgrade switch is in a closed state, and because the short link address is generated and depends on the Redis database, once the Redis database has a problem, the short link address storage fails, and at the moment, the downgrade switch needs to be manually opened, the short link address is not generated, and the short link address is directly returned to the original link address URL of the client. The presence of short link downgrading schemes ensures high availability of services.
And step 204, responding to the opening, and directly returning to the original link address of the client.
In some embodiments, the executing entity may directly return the original link address "https:// xxx.com/smartcut.htmldmshowshare=false & dmshowcare=false & redirect type=smartcut & redirect version=3_8_0 & cartid=a1c 3& stoneid=12 & price=56.66 & from=galxy & cartdeviceid=17 & t=brka" to the client after determining that the short link downgrade is turned on.
Step 205, in response to not turning on, generating a short link address based on the shopping cart data.
In some embodiments, the executing entity generates a short link address based on the shopping cart data in response to not opening the short link downgrade, and as an example, the short link address may be generated according to the following specific translation manner.
In some optional implementations of some embodiments, generating the short link address based on the shopping cart data includes: acquiring a value of a client identifier, a value of a time stamp and a value of a shopping cart identifier from the shopping cart data; setting an unordered character string s1, wherein the character string s1 consists of 62 unordered characters 1-9, a-Z and A-Z; setting a character string s2 to store the converted data; processing the value of the timestamp: adding a 1-bit number 1 in front of it; based on the parsed value of the client identifier and the processed value of the timestamp, the following conversion steps are performed: dividing the value by 62 to obtain quotient and remainder; sequentially indexing the character string s1 from the 0 th position based on the remainder to obtain characters at corresponding positions, and sequentially storing the characters into a character string s 2; determining if the quotient is greater than 62; continuing the converting step in response to the quotient being greater than 62; sequentially indexing the character string s1 from the 0 th position based on the quotient to obtain characters of the corresponding position in response to the quotient being less than 62, storing the characters to the end of the character string s2, and inverting the value of the character string s2 to obtain final conversion data; and generating the short link address based on the final conversion data, wherein the short link address is composed of the client identifier of 62 bits, the time stamp of 62 bits with length of four bits and the first four bits of the shopping cart identifier.
As an example, the short link address generation procedure is generated by the server according to a specific conversion scheme, which is as follows:
the device identification id is obtained as 100, the acquisition time stamp is 9 points and 30 minutes, the character string s1 is set as 'efAb 102cdC FDEHIvwxJKLqrMBaNO59PQstRSnoT6XYZ78 UWWghijklmpuzG', and the following conversion is performed based on the data with the obtained device id of 100: dividing 100 by 62 quotient to be 1, taking remainder to obtain 38, taking the character with the 38 th subscript as n from the s1 character string according to the remainder 38, wherein the subscript of the s1 character string starts from 0, and adding the character into the previously defined character string s2, wherein s2=n; then, judging whether the quotient 1 is greater than 62 and if the quotient is less than 62, sequentially indexing s1 from the 0 th position according to the quotient 1 to extract the character f at the 1 st position, adding f into s2 to obtain s2=nf, and inverting the lower character string s2 to obtain fn, wherein the value of the converted equipment identification id is obtained.
The acquired time stamp is processed as follows: the time stamp is expressed in time minutes and seconds: 093000, a1 or 1093000 is added before the value of the time stamp. The purpose of the addition of 1 is that the number of 4 digits obtained by 62-ary conversion from 0.0 minutes and 0 seconds to 23.59 minutes and 59 seconds is constant. Based on the processed time stamp 1093000, the following 62-ary conversion is performed: 1093000 taking the quotient 17629 and the remainder 2 from 62, firstly sequentially indexing s1 from the 0 th position according to the remainder 2, taking the character at the 2 nd position from the s1 character string as A, and storing the character A into s2, namely s2=A; when the quotient 17629 is greater than 62, continuing to divide the quotient 176229 by 62 to obtain quotient 284 and remainder 21, sequentially indexing s1 from the 0 th position according to the remainder 21, taking the character K at the 21 st position from the s1 character string, and sequentially storing the character K into s2, namely s2=ak; when quotient 284 is still greater than 62, continuing to convert, dividing quotient 284 by 62 to obtain quotient 4 and remainder to obtain 36, sequentially indexing s1 from the 0 th position according to remainder 36, taking character R at the 36 th position from the s1 character string, and sequentially storing character R into s2, namely s2=AKR; wherein quotient 4 is smaller than 62, s1 is sequentially indexed from the 0 th position according to quotient, character 1 of the 4 th position is taken from the s1 character string, the character 1 is sequentially stored in s2, that is, s2=akr1, and then the lower character string s2 is inverted to obtain 1RKA, and at this time, the converted timestamp is obtained in s 2.
Directly acquiring the front four digits of the analyzed shopping cart identification id as a1c3, and generating a short link according to the device identification id and the timestamp converted in the specific manner, see the format structure of the short link in fig. 4, wherein the generated short link ishttps://xxx.com/ qr/fn_1RKA_a1c3
In some optional implementations of some embodiments, the short link address generating method further includes: analyzing the front four bits of the client identifier, the timestamp and the shopping cart identifier based on the short link address; based on the analyzed client identifier, finding out the corresponding original link address in the database, and verifying the short link address; determining whether the verification is passed; redirecting to said original link address in response to said verification passing; and returning the short link address error information to the client in response to the verification failure.
As an example, as shown in fig. 7, the code of the short link is cbFCA1a4C, the short link service intercepts the code first and then the four bits 1a4C are the first four bits of the shopping cart id, the 5 th to 8 th bits of the bFCA are the time stamp, and the remaining C is the client id; converting the client identification id from a 62 system to a 10 system, and then finding an original link address URL from a Redis database through the converted client identification id; if the URL can be found, checking whether the time stamp in the short link address is consistent with the first four bits of the shopping cart identification id according to the original link address URL; if the verification is passed, the short link service redirects the original link address URL requested by the time; if the original link address URL cannot be found or the verification is not passed, the short link is indicated to have an error or is expired, and the short link service returns error information to the client.
In some optional implementations of some embodiments, the verifying the short link address based on the parsed client identifier finding the corresponding original link address in the database includes: reversing the client identification from 62 to 10; finding out the corresponding original link address from the database based on the returned client identifier; comparing whether the time stamp in the short link address and the first four bits of the shopping cart identifier are consistent with the time stamp in the original link and the first four bits of the shopping cart identifier.
As an example, the 62-ary client identifier s2=c, the out-of-order string s1= "efA b02cdC fdehivwxjklqrmbono 59 pqsttst 6XYZ78 uvwghijklmpuzzg. The inversion process is as follows:
1. the length length=1 of the string s2 is calculated from the first bit c of s2, and the position c in the string s1 is 7, i.e., the variable index=7 is given.
2. The variable sum, sum=434, is given according to the fixed formula index (7) ×62, to the power 0=434, where the power 0 is calculated by subtracting bit 1 from length, i.e. (1-1) =0.
3. Based on the client identifier 434, the key value is found in the key-value attribute of the database, so that the original link address stored in the corresponding value can be found, and then the timestamp in the short link address is compared with the timestamp in the original link stored in the value and the shopping cart identifier to determine whether the timestamps are consistent. Thereby completing the short link address verification process.
As shown in fig. 8, an apparatus for short link generation of some embodiments includes: an acquisition unit configured to acquire shopping cart data of a client; an original address generation unit configured to generate an original link address of payment based on the shopping cart data; a determining unit configured to determine whether to open short link degradation; a short link generation unit configured to generate a short link address based on the original link address in response to not turning on the short link degradation; and the return unit is configured to return the original link address paid by the client directly in response to opening the short link degradation.
Referring now to FIG. 9, a schematic diagram of a server (e.g., the server of FIG. 1) 900 suitable for use in implementing some embodiments of the present disclosure is shown. The server 900 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 901 that may perform various appropriate actions and processes in accordance with programs stored in a Read Only Memory (ROM) 902 or programs loaded from a storage device 908 into a Random Access Memory (RAM) 903. In the RAM903, various programs and data necessary for the operation of the server 900 are also stored. The processing device 901, the ROM902, and the RAM903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
In general, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 907 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; and a communication device 909. Communication means 909 may allow server 900 to communicate wirelessly or by wire with other devices to exchange data. While fig. 9 shows a server 900 having various devices, it is to be understood that not all illustrated devices are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 9 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communication device 909, or installed from storage device 908, or installed from ROM 602. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing device 901.
It should be noted that the computer readable medium of some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, 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 some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the server; or may exist alone without being assembled into the server. The computer-readable medium carries one or more programs that, when executed by a server, cause the server to: acquiring shopping cart data of a client; generating an original link address of payment based on the shopping cart data; determining whether to open short link degradation; generating a short link address based on the original link address in response to not opening; and responding to the opening, and directly returning to the original link address of the client.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts 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 disclosure. In this regard, 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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 some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes an acquisition unit, an original address generation unit, a determination unit, a short link generation unit, and a return unit. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (6)

1. A short link generation method comprising:
obtaining shopping cart data of a client, wherein the shopping cart data comprises: shopping cart identification, client data, store data, time stamps consisting of time-seconds;
generating an original link address for payment based on the shopping cart data;
determining whether to open short link degradation;
responding to the opening, and directly returning to the original link address of the client;
generating a short link address based on the shopping cart data in response to not being turned on;
wherein the generating the original link address for payment based on the shopping cart data comprises:
splicing the client data, the store data and the time stamp into the original link address;
storing the original link address according to a corresponding form of a keyword-numerical key-value attribute of a database, wherein the keyword key stores a client identifier in the client data, and the numerical value stores the original link address;
wherein the method further comprises:
analyzing the first four bits of the client identifier, the timestamp and the shopping cart identifier based on the short link address;
based on the analyzed client identifier, finding out the corresponding original link address in the database, and verifying the short link address;
determining whether the verification is passed;
redirecting to the original link address in response to the verification passing;
responding to the verification failure, and returning information of the short link address error to the client;
wherein the generating a short link address based on the shopping cart data comprises:
analyzing the value of the client identifier, the value of the timestamp and the value of the shopping cart identifier from the shopping cart data;
setting an unordered character string s1, wherein the character string s1 consists of 62 unordered characters 1-9, a-Z and A-Z;
setting a character string s2 for storing the converted data; processing the value of the timestamp: adding a 1-bit number 1 in front of it;
based on the parsed value of the client identifier and the processed value of the timestamp, the following conversion steps are performed: dividing the value by 62 to obtain a quotient and remainder; sequentially indexing the character string s1 from the 0 th position based on the remainder to obtain characters at corresponding positions, and sequentially storing the characters into a character string s 2; determining if the quotient is greater than 62; continuing to perform the converting step in response to the quotient being greater than 62;
sequentially indexing the character string s1 from the 0 th position based on the quotient to acquire characters of corresponding positions in response to the quotient being smaller than 62, storing the characters to the end of the character string s2, and inverting the value of the character string s2 to acquire final conversion data;
and generating the short link address based on the final conversion data, wherein the short link address is composed of the client identifier in 62 bits, the timestamp in 62 bits with the length of four bits and the first four bits of the shopping cart identifier.
2. The method of claim 1, wherein the verifying the short link address based on the parsed client identification finding the corresponding original link address in the database comprises:
reversing the client identification from a 62 scale back to a 10 scale;
finding out the corresponding original link address from the database based on the inverted client identification;
comparing whether the timestamp in the short link address and the first four bits of the shopping cart identifier are consistent with the timestamp in the original link and the first four bits of the shopping cart identifier.
3. The method of claim 1, wherein the determining whether to initiate short link degradation comprises:
setting a short link degradation switch;
determining whether the database is available;
generating the short link address in response to the database being available with the short link downgrade switch in an off state;
and in response to unavailability of the database, turning on the short link downgrade switch, directly returning to the original link address paid by the client.
4. An apparatus for short link generation, comprising:
an acquisition unit configured to acquire shopping cart data of a client, wherein the shopping cart data includes: shopping cart identification, client data, store data, time stamps consisting of time-seconds;
an original address generation unit configured to generate an original link address of a payment based on the shopping cart data;
a determining unit configured to determine whether to open short link degradation;
a short link generation unit configured to generate a short link address based on the original link address in response to not opening the short link degradation;
a return unit configured to return directly to the original link address paid by the client in response to opening the short link degradation;
wherein the original address generation unit is further configured to: splicing the client data, the store data and the time stamp into the original link address; storing the original link address according to a corresponding form of a keyword-numerical key-value attribute of a database, wherein the keyword key stores a client identifier in the client data, and the numerical value stores the original link address;
wherein, still include: analyzing the first four bits of the client identifier, the timestamp and the shopping cart identifier based on the short link address; based on the analyzed client identifier, finding out the corresponding original link address in the database, and verifying the short link address; determining whether the verification is passed; redirecting to the original link address in response to the verification passing; responding to the verification failure, and returning information of the short link address error to the client;
wherein the short link generation unit is further configured to: analyzing the value of the client identifier, the value of the timestamp and the value of the shopping cart identifier from the shopping cart data; setting an unordered character string s1, wherein the character string s1 consists of 62 unordered characters 1-9, a-Z and A-Z; setting a character string s2 for storing the converted data; processing the value of the timestamp: adding a 1-bit number 1 in front of it; based on the parsed value of the client identifier and the processed value of the timestamp, the following conversion steps are performed: dividing the value by 62 to obtain a quotient and remainder; sequentially indexing the character string s1 from the 0 th position based on the remainder to obtain characters at corresponding positions, and sequentially storing the characters into a character string s 2; determining if the quotient is greater than 62; continuing to perform the converting step in response to the quotient being greater than 62; sequentially indexing the character string s1 from the 0 th position based on the quotient to acquire characters of corresponding positions in response to the quotient being smaller than 62, storing the characters to the end of the character string s2, and inverting the value of the character string s2 to acquire final conversion data; and generating the short link address based on the final conversion data, wherein the short link address is composed of the client identifier in 62 bits, the timestamp in 62 bits with the length of four bits and the first four bits of the shopping cart identifier.
5. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-3.
6. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-3.
CN202010089967.7A 2020-02-13 2020-02-13 Short link generation method, device, server and computer readable medium Active CN113254813B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010089967.7A CN113254813B (en) 2020-02-13 2020-02-13 Short link generation method, device, server and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010089967.7A CN113254813B (en) 2020-02-13 2020-02-13 Short link generation method, device, server and computer readable medium

Publications (2)

Publication Number Publication Date
CN113254813A CN113254813A (en) 2021-08-13
CN113254813B true CN113254813B (en) 2023-07-18

Family

ID=77220067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010089967.7A Active CN113254813B (en) 2020-02-13 2020-02-13 Short link generation method, device, server and computer readable medium

Country Status (1)

Country Link
CN (1) CN113254813B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113761406B (en) * 2021-09-03 2024-06-04 丰巢网络技术有限公司 Intelligent cabinet two-dimension code short-chain generation method and device, medium and electronic equipment
CN115002079B (en) * 2022-05-27 2023-05-26 中国平安财产保险股份有限公司 Short address generation method, device, equipment and storage medium
CN116701792B (en) * 2023-08-03 2023-11-24 阿里健康科技(中国)有限公司 Access method, device, equipment and storage medium of target interface

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102810089A (en) * 2011-05-30 2012-12-05 盛乐信息技术(上海)有限公司 Short link system based on content and implementation method thereof
CN106210161A (en) * 2016-06-24 2016-12-07 中国银联股份有限公司 A kind of short chain delivers a child into method and system
CN106412140A (en) * 2015-08-03 2017-02-15 沈阳东软睿道教育服务有限公司 Short link address generating method and system thereof
CN106933871A (en) * 2015-12-30 2017-07-07 阿里巴巴集团控股有限公司 Short linking processing method, device and short linked server
CN110619097A (en) * 2019-09-12 2019-12-27 北京达佳互联信息技术有限公司 Two-dimensional code generation method and device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3016050A1 (en) * 2014-10-29 2016-05-04 SNS Bank N.V. System and method for handling a payment link
CN106933854B (en) * 2015-12-30 2020-06-30 阿里巴巴集团控股有限公司 Short link processing method and device and server
CN107729409A (en) * 2017-09-26 2018-02-23 中国银联股份有限公司 A kind of short chain delivers a child into method and device
CN109582395B (en) * 2019-01-10 2022-05-17 北京三快在线科技有限公司 Applet running method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102810089A (en) * 2011-05-30 2012-12-05 盛乐信息技术(上海)有限公司 Short link system based on content and implementation method thereof
CN106412140A (en) * 2015-08-03 2017-02-15 沈阳东软睿道教育服务有限公司 Short link address generating method and system thereof
CN106933871A (en) * 2015-12-30 2017-07-07 阿里巴巴集团控股有限公司 Short linking processing method, device and short linked server
CN106210161A (en) * 2016-06-24 2016-12-07 中国银联股份有限公司 A kind of short chain delivers a child into method and system
CN110619097A (en) * 2019-09-12 2019-12-27 北京达佳互联信息技术有限公司 Two-dimensional code generation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113254813A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
CN113254813B (en) Short link generation method, device, server and computer readable medium
US10860398B2 (en) Adapting legacy endpoints to modern APIs
CN108846753B (en) Method and apparatus for processing data
US8381098B2 (en) Webpage request handling
CN113010405A (en) Application program testing method and device
CN113590974A (en) Recommendation page configuration method and device, electronic equipment and computer readable medium
CN114297278A (en) Method, system and device for quickly writing batch data
US9998559B2 (en) Preemptive caching of data
CN110377273B (en) Data processing method, device, medium and electronic equipment
CN116561013A (en) Testing method and device based on target service framework, electronic equipment and medium
CN110968497A (en) Tree-shaped interceptor-based request verification method, device, medium and electronic equipment
CN115309657A (en) Method, device, medium and program product for providing test case
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN112783903B (en) Method and device for generating update log
CN113448960A (en) Method and device for importing form file
CN111767486A (en) Method, device, electronic equipment and computer readable medium for displaying page
CN115374320B (en) Text matching method and device, electronic equipment and computer medium
CN108920589A (en) Browsing kidnaps recognition methods, device, server and storage medium
CN116108132B (en) Method and device for auditing text of short message
CN112084183A (en) Data verification method and device, electronic equipment and computer readable medium
CN117688236A (en) Method and device for pushing article description information, electronic equipment and computer medium
CN115375262A (en) Data generation method, apparatus, device, computer readable medium and program product
CN114741314A (en) Test case generation method and device, electronic equipment and storage medium
CN118069758A (en) Distributed database data changing method and device, electronic equipment and medium
CN112764652A (en) Data storage method, device, equipment and medium based on workflow engine

Legal Events

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