CN113254813A - 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
CN113254813A
CN113254813A CN202010089967.7A CN202010089967A CN113254813A CN 113254813 A CN113254813 A CN 113254813A CN 202010089967 A CN202010089967 A CN 202010089967A CN 113254813 A CN113254813 A CN 113254813A
Authority
CN
China
Prior art keywords
link address
client
short link
shopping cart
short
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.)
Granted
Application number
CN202010089967.7A
Other languages
Chinese (zh)
Other versions
CN113254813B (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

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/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)
  • Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • Accounting & Taxation (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Information Transfer Between Computers (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (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: acquiring shopping cart data of a client; generating an original link address for payment based on the shopping cart data; determining whether short link degradation is turned on; responding to the starting, and generating a short link address based on the original link address; and responding to the opening, and directly returning to the original link address of the client. According to the embodiment, the payment two-dimensional code is optimized, the time for identifying the two-dimensional code by the mobile phone of the user is shortened, the payment of the user is safer, quicker and more stable, and the user experience is improved.

Description

Short link generation method, device, server and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a short link generation method, a short link generation device, a server and a computer readable medium.
Background
Most of the available technical schemes for long-chain connection to short-chain connection on the market output original link address URL character strings into fixed-length codes in a Hash hash discrete operation mode, and when short-chain connection needs to be analyzed, a server finds the original link address URL mapped with the short-chain connection and redirects the address. In the existing mode, the number of short links of the conversion is in direct proportion to the possibility of the occurrence 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, and the possibility of the occurrence of collision is gradually increased, 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, the uniqueness and instability are caused, and the user experience is reduced.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary 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, which obtains shopping cart data of a client; generating an original link address for payment based on the shopping cart data; determining whether short link degradation is turned on; responding to the starting, and generating a short link address based on the original link address; 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 generating unit configured to generate an original link address for payment based on the shopping cart data; a determination unit configured to determine whether short link degradation is turned on; 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 directly return the original link address paid by the client in response to the short link degradation being started.
In a third aspect, some embodiments of the present disclosure provide a server, including: one or more processors; 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 the method of the first aspect.
In a fourth aspect, some embodiments of the disclosure provide a computer readable medium having a computer program stored thereon, wherein the program when executed by a processor implements the method of the first aspect.
One of the above-described various embodiments of the present disclosure has the following advantageous effects: the original link address of payment is generated through data of the client shopping cart, and the short link address is generated according to the original link address, so that optimization of the two-dimensional code for payment is realized, the time for a user to identify the two-dimensional code by a mobile phone is reduced, the user checkout is safer, quicker and more stable, and the user experience is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is an architectural diagram of an exemplary system in which some embodiments of the present disclosure may be applied;
fig. 2 is a flow diagram of some embodiments of a short link generation method according to the present disclosure;
FIG. 3 is a flow diagram of the generation of an original link address according to some embodiments of the present disclosure;
FIG. 4 is a block diagram of a short link address in accordance with some embodiments of the present disclosure;
FIG. 5 is a flow diagram for client checkout according to some embodiments of the present disclosure.
Fig. 6 is a flow diagram for short chain ground address verification according to some embodiments of the present disclosure.
FIG. 7 is a flow diagram of one embodiment of a short link verification method according to the present disclosure.
FIG. 8 is a schematic structural diagram of some embodiments of a short link generation device 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 is to be understood that the 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 for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
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 can scan the code items on the client 101 by himself, shopping cart data is generated by the client 101, and after the user clicks a checkout button on the client 101, the client 101 sends the shopping cart data to the server 103 through the network 102. Server 103 generates an original linked address for the payment from the shopping cart data and may store the original linked address in a database, such as a remote dictionary service (Redis) database. Then, the server 103 determines whether the downgrade service is turned on, and if not, the server 103 generates a short link address, such as a short link address, according to the shopping cart identifier id, the client identifier id, and the timestamp in the shopping cart data: "https:// xxx. com/qr/v _ bRKA _ a1c 3". The short-chain address generation process is generated by the server according to a specific conversion mode, which will be described in detail in the following; the server 103 returns the short-chain grounding address to the client 101, the client 101 can generate a simplified two-dimensional code according to the short-chain grounding address, expiration time is set to be 15 minutes, for example, a user performs code scanning checkout through the simplified two-dimensional code, and if the user does not scan and pay the simplified two-dimensional code within 15 minutes, the simplified two-dimensional code is invalid; if the server 103 starts the downgrade 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 it can be prevented that the user still can check out by scanning the two-dimensional code when the mobile phone configuration is not high enough, and the expiration time can also be set to 15 minutes, for example, if the user does not scan and pay the two-dimensional code within 15 minutes, the two-dimensional code will also fail. The whole interaction process of the client 101 and the server 103 is also substantially the whole process of the user checkout, and particularly, see fig. 5.
The client 101 may be a self-service cash register, or may be various electronic devices with information processing capability, including but not limited to a smart phone, a tablet computer, an e-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 executed by the server 103. The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules, for example, to provide distributed services, or as a single piece of software or software module. And 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 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 chain joint generation method comprises the following steps:
step 201, shopping cart data of a client is obtained.
In some embodiments, the executing agent of the short link generation method (e.g., the server shown in fig. 1) may obtain the shopping cart data of the client after the user scans the item barcode. The shopping cart data comprises a shopping cart identification id, item quantity, price, client data, store data, a time stamp formed by time, minute and second and the like. The shopping cart identification id may be, as an example, an identification of the shopping list at this time. The client data may be, as an example, an identification id of the self-service checkout device. Store data may be, as an example, an identification id of a brick-and-mortar store. The timestamp may be time information consisting of time in minutes and seconds, and may be, as an example, the checkout time of this shopping cart: nine and 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 agent (e.g., the server shown in FIG. 1) may generate an original link address for payment based on the shopping cart data. The original link address is a link address used for generating a two-dimensional code during checkout, and may be, as an example: https:// xxx.com/smartcall.html? dmShowShare & dmShowCart & redirectType & smartguard & redirectVersion & 3_8_0& cartId & a1c3& storeId & price & 56.66& from & gapxy & cartDeviceId & 17& t bRKA.
In some optional implementations of some embodiments, the client data, the store data, and the timestamp are assembled into the original link address; and storing the original link address according to a corresponding form of a key-value attribute of a database, wherein the key stores a client identifier in the client data, and the value stores the original link address.
By way of example, referring to fig. 3, the original link generation flow: the obtained shopping cart id, i.e. cartId, store id, i.e. storeId, the settlement amount price, the client data, i.e. cartDeviceId, and the timestamp t can be assembled into the original link address. The original link is saved in a database (for example, Redis), the client identifier cartDeviceId, that is, 17, is saved by using an attribute key, and the original link address corresponding to the client identifier 17, that is, "https:// xxx.com/smartcall. htmldshow ═ false & dmShowCart ═ false & redirectType ═ smart & redirectVersion ═ 3_8_0& cartId ═ a1c3& storeId ═ 12& price ═ 56.66& gamma & cartDeviceId ═ 17& t ═ bRKA", is saved by using a value.
Step 203, determine whether to initiate short link degradation.
In some embodiments, the executing body of the short link generation method determines whether to turn on short link downgrading. The short link downgrade is to provide one or more control ways to control whether the short link address is generated, and the control can be realized by hardware or software, for example, by controlling a switch.
In some optional implementations of some embodiments, the performing the subject determining whether to turn on short link degradation comprises: setting a short link degradation switch; determining whether the database is available; responding to the database availability, if the short link degradation switch is in a closed state, generating the short link address; and responding to the unavailable database, opening the short link downgrade 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 a short link downgrade service, and for example, the downgrade switch may be implemented by a program or a hardware. Determining whether a database is available may be by: such as whether the database has a large number of queries timed out or whether the corresponding data is not queried, and if so, determining that the database is not available. Short link destaging schemes may include both automatic destaging and manual destaging. Automatic degradation mode: when the original link address URL is stored abnormally, the short-chain grounding address process is not generated any more, and the original link address URL is automatically and directly returned to the client, so that the user can pay normally. And manual degradation can be realized through a short-link degradation switch: under normal conditions, the short link degradation switch is in a closed state, and as the generated short link address depends on a Redis database, once the Redis database has a problem, the short link address storage fails, and at the moment, the degradation switch needs to be manually opened, so that the short link address is not generated any more, and the short link address is directly returned to the original link address URL of the client. The presence of a short link degradation scheme guarantees high availability of services.
And step 204, responding to the starting, and directly returning to the original link address of the client.
In some embodiments, the execution entity may directly return the original link address "https:// xxx.com/smarttarget. htmldshow share ═ face & dmShowCart ═ face & redirectType ═ smartfocus & redirectVersion & 3_8_0& cartId ═ a1c3& storeId ═ 12& price ═ 56.66& frgaxy & cartDeviceId & -bRKA" to the client after determining that short link degradation is turned on.
In response to not being turned on, a short link address is generated based on the shopping cart data, step 205.
In some embodiments, the executing agent generates the short-link address based on the shopping cart data in response to not turning on the short-link demotion, and may generate the short-link address according to a specific conversion manner as follows, for example.
In some optional implementations of some embodiments, the generating a short link address based on the shopping cart data includes: acquiring a value of a client identifier, a value of a timestamp and a value of a shopping cart identifier from the shopping cart data; setting a disordered character string s1, wherein the character string s1 consists of 62 disordered 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 digit 1 in front of the chip; 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 a 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 whether the quotient is greater than 62; in response to said quotient being greater than 62, continuing said converting step; in response to the quotient being less than 62, sequentially indexing the string s1 starting from the 0 th position based on the quotient to obtain a character at the corresponding position, depositing the character at the end of the string s2, and inverting the value of the 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 with a 62-system number, the timestamp with a 62-system number with a length of four bits, and the first four bits of the shopping cart identifier.
As an example, the short-chain address generation process is generated by the server according to a specific conversion mode, which is as follows:
acquiring a device identification id of 100, acquiring a timestamp of 9 points and 30 points, setting a character string s1 as 'efAb 102cdC34 FDEHvwxJKLqrMBaNO 59 PQstrSNno T6XYZ78 UVWghijklmplmpuyzG', and converting the acquired data with the device id of 100 as follows: dividing 100 by 62 to obtain a remainder, taking the quotient of 1, obtaining 38, taking the character with the 38 th subscript from an s1 character string according to the remainder 38 as n, wherein the subscript of the s1 character string starts from 0, and adding the character into the previously defined character string s2, wherein s2 is equal to n; and then judging whether the quotient 1 is larger than 62, if the quotient is smaller than 62, sequentially indexing s1 from the 0 th position according to the quotient 1 to take out the character at the 1 st position, namely f, adding f into s2 to obtain s2 as nf, and then reversing the lower character string s2 to obtain fn, wherein the obtained result is the value of the converted equipment identification id.
The acquired time stamp is processed as follows: the time stamp is expressed as minutes and seconds: 093000, add 1 to the value of the time stamp, 1093000. The purpose of adding 1 is that 4-bit numbers are obtained after carrying out 62-ary conversion from 0 hour 0 minute 0 second to 23 hours 59 minutes 59 seconds, and the fixed number of bits is not changed. Based on the processed timestamp 1093000, the following 62-ary conversion is performed: 1093000, taking 62 as a quotient 17629 and a remainder as 2, 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 string as A, and storing the character A into s2, namely, s2 is A; when the quotient 17629 is greater than 62, further dividing the quotient 17629 by 62 to obtain a quotient of 284 and a remainder of 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 the quotient 284 is still larger than 62, the conversion is continued, the quotient 284 is divided by 62 to obtain a quotient 4 and a remainder to obtain a remainder 36, s1 is sequentially indexed from the 0 th position according to the remainder 36, the character R at the 36 th position is taken from the s1 character string, and the character R is sequentially stored in s2, namely s2 is AKR; wherein the quotient 4 is less than 62, s1 is sequentially indexed from the 0 th position according to the quotient, the character 1 at the 4 th position is taken from the s1 character string, the character 1 is sequentially stored into s2, namely s2 is AKR1, then the lower character string s2 is inverted to obtain 1RKA, and then the converted timestamp is obtained in s 2.
The former four digits of the analyzed shopping cart identifier id are directly obtained as a1c3, then the device identifier id and the timestamp converted according to the above specific mode are referred to the format structure of the short link in fig. 4, and the generated short link is just the short linkhttps://xxx.com/ qr/fn_1RKA_a1c3
In some optional implementations of some embodiments, the short-chain ground address generation method further includes: analyzing the client identifier, the timestamp and the first four digits of the shopping cart identifier based on the short link address; finding the corresponding original link address in the database based on the analyzed client identifier, and verifying the short link address; determining whether the verification passes; responding to the verification passing, and then redirecting to the original link address; and returning the short link address error information to the client in response to the failure of the verification.
As an example, as shown in fig. 7, the code of the short link is cbFCA1a4C, the short link service intercepts four bits after the code, 1a4C is the first four bits of the shopping cart identifier id, the last 5 to 8 bits of the bFCA are the timestamp, and the rest c is the client identifier 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, whether the timestamp in the short link address is consistent with the first four digits of the shopping cart identification id or not can be verified 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 request; if the original link address URL cannot be found or the verification fails, the short link is wrong or is expired, and the short link service returns error information to the client.
In some optional implementation manners of some embodiments, the finding, based on the analyzed client identifier, the corresponding original link address in the database, and verifying the short link address includes: the client identification is inverted from the 62 system to the 10 system; finding the corresponding original link address from the database based on the reversed client identifier; and comparing whether the first four digits of the timestamp and the shopping cart identifier in the short link address are consistent with the first four digits of the timestamp and the shopping cart identifier in the original link.
As an example, the client id s2 ═ c in 62, the out-of-order string s1 ═ efA1b02cdC34 fdehivwxklqrmbano 59 pqstrrsnot 6XYZ78 uvwghijklmpumpuyzg ". The inversion process is as follows:
1. the length of the string s2, length 1, is calculated from the first bit c of s2, and the position of c in the string s1 is 7, and the variable index is given by length 7.
2. The power 0 of the fixed formula index (7) × 62 is 434, where the power 0 is calculated by subtracting the 1 st digit from the length, i.e., (1-1) ═ 0, and 434 is given to the variable sum, i.e., sum is 434.
3. Based on the client id 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 two are consistent. Thereby completing the short-chain address verification process.
As shown in fig. 8, a short link generation device of some embodiments includes: an acquisition unit configured to acquire shopping cart data of a client; an original address generating unit configured to generate an original link address for payment based on the shopping cart data; a determination unit configured to determine whether short link degradation is turned on; 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 directly return the original link address paid by the client in response to the short link degradation being started.
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., central processing unit, graphics processor, etc.) 901 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program 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 apparatus 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 bus 904.
Generally, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 907 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; and a communication device 909. The communication means 909 may allow the server 900 to perform wireless or wired communication with other apparatuses to exchange data. While fig. 9 illustrates a server 900 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 9 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams 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 illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through communications device 909, or installed from storage device 908, or installed from ROM 602. The computer program, when executed by the processing apparatus 901, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
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. 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 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 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, a computer readable signal medium may include a propagated data signal with computer readable program code 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. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications 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 network.
The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by a server, cause the server to: acquiring shopping cart data of a client; generating an original link address for payment based on the shopping cart data; determining whether short link degradation is turned on; responding to the starting, and generating a short link address based on the original link address; and responding to the opening, and directly returning to the original link address of the client.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
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 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 software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be 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 elements do not in some way constitute a limitation on the elements themselves.
The functions described herein above 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: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology 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-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A short link generation method, comprising:
acquiring shopping cart data of a client;
generating an original link address for payment based on the shopping cart data;
determining whether short link degradation is turned on;
responding to the starting, and directly returning to the original link address of the client;
in response to not being turned on, a short link address is generated based on the shopping cart data.
2. The method of claim 1, wherein the shopping cart data comprises: a shopping cart identification, client data, store data, a time stamp consisting of time minutes and seconds.
3. The method of claim 2, wherein the generating an original link address for payment based on the shopping cart data comprises:
assembling the client data, the store data and the timestamp into the original link address;
and storing the original link address according to a corresponding form of a key-value attribute of a database, wherein the key stores a client identifier in the client data, and the value stores the original link address.
4. The method of claim 3, 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 a disordered character string s1, wherein the character string s1 consists of 62 disordered 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 digit 1 in front of the chip;
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 a remainder; sequentially indexing the character string s1 starting from the 0 th position based on the remainder to obtain characters of corresponding positions, and sequentially storing the characters into a character string s 2; determining whether the quotient is greater than 62; in response to the quotient being greater than 62, continuing to perform the converting step;
in response to the quotient being less than 62, sequentially indexing the string s1 starting from the 0 th position based on the quotient to obtain a character at a corresponding position, depositing the character at the end of the string s2, and inverting the value of the 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 in 62 system, the timestamp in 62 system with four bits in length and the first four bits of the shopping cart identifier.
5. The method of claim 4, wherein the method further comprises:
analyzing the first four digits of the client identifier, the timestamp and the shopping cart identifier based on the short link address;
the corresponding original link address is found in the database based on the analyzed client terminal identification, and the short link address is verified;
determining whether the verification passes;
in response to the verification passing, redirecting to the original link address;
and in response to the verification failing, returning the short-link address error information to the client.
6. The method of claim 5, wherein the validating the short link address based on the parsed client identifier finding the corresponding original link address in the database comprises:
reversing the client identification from 62 to 10;
finding the corresponding original link address from the database based on the reversed client identification;
and comparing whether the time stamp in the short link address and the first four digits of the shopping cart identifier are consistent with the time stamp in the original link address and the first four digits of the shopping cart identifier.
7. 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;
in response to the database being available, the short link downgrade switch being in an off state, generating the short link address;
and in response to the database being unavailable, opening the short link downgrade switch and directly returning the original link address paid to the client.
8. A short link generation device, comprising:
an acquisition unit configured to acquire shopping cart data of a client;
an original address generation unit configured to generate an original link address for payment based on the shopping cart data;
a determination unit configured to determine whether short link degradation is turned on;
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 downgrade;
a return unit configured to directly return to the original link address paid by the client in response to the short link downgrade being turned on.
9. 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, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
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 true CN113254813A (en) 2021-08-13
CN113254813B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113761406A (en) * 2021-09-03 2021-12-07 深圳市丰巢网络技术有限公司 Intelligent cabinet two-dimensional code short-chain generation method, device, medium and electronic equipment
CN115002079A (en) * 2022-05-27 2022-09-02 中国平安财产保险股份有限公司 Short address generation method, device, equipment and storage medium
CN116701792A (en) * 2023-08-03 2023-09-05 阿里健康科技(中国)有限公司 Access method, device, equipment and storage medium of target interface

Citations (9)

* 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
EP3016050A1 (en) * 2014-10-29 2016-05-04 SNS Bank N.V. System and method for handling a payment link
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
CN107729409A (en) * 2017-09-26 2018-02-23 中国银联股份有限公司 A kind of short chain delivers a child into method and device
US20180307773A1 (en) * 2015-12-30 2018-10-25 Alibaba Group Holding Limited Short link processing to improve service efficiency
CN109582395A (en) * 2019-01-10 2019-04-05 北京三快在线科技有限公司 Small routine operation method, device, electronic equipment and storage medium
CN110619097A (en) * 2019-09-12 2019-12-27 北京达佳互联信息技术有限公司 Two-dimensional code generation method and device, electronic equipment and storage medium

Patent Citations (10)

* 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
EP3016050A1 (en) * 2014-10-29 2016-05-04 SNS Bank N.V. System and method for handling a payment link
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
US20180307773A1 (en) * 2015-12-30 2018-10-25 Alibaba Group Holding Limited Short link processing to improve service efficiency
US20180307774A1 (en) * 2015-12-30 2018-10-25 Alibaba Group Holding Limited Method and device for processing short link, and short link server
CN106210161A (en) * 2016-06-24 2016-12-07 中国银联股份有限公司 A kind of short chain delivers a child into method and system
CN107729409A (en) * 2017-09-26 2018-02-23 中国银联股份有限公司 A kind of short chain delivers a child into method and device
CN109582395A (en) * 2019-01-10 2019-04-05 北京三快在线科技有限公司 Small routine operation method, device, electronic equipment and storage medium
CN110619097A (en) * 2019-09-12 2019-12-27 北京达佳互联信息技术有限公司 Two-dimensional code generation method and device, electronic equipment and storage medium

Cited By (6)

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

Also Published As

Publication number Publication date
CN113254813B (en) 2023-07-18

Similar Documents

Publication Publication Date Title
CN113254813A (en) Short link generation method, device, server and computer readable medium
CN108846753B (en) Method and apparatus for processing data
US9633321B2 (en) Systems and methods for facilitating call request aggregation over a network
CN111198751A (en) Service processing method and device
CN113590974B (en) Recommendation page configuration method and device, electronic equipment and computer readable medium
CN113760674A (en) Information generation method and device, electronic equipment and computer readable medium
US11368297B2 (en) Method and apparatus for updating digital certificate
CN111984606A (en) Data query method, device, terminal equipment and storage medium
CN114297278A (en) Method, system and device for quickly writing batch data
CN112988311A (en) On-line experimental method based on WEB server
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN111651338B (en) System and method for acquiring log formatting time
CN112783903B (en) Method and device for generating update log
CN113850685A (en) Method, apparatus, server and medium for real-time tally
CN108898446B (en) Method and apparatus for outputting information
CN113760929A (en) Data synchronization method and device, electronic equipment and computer readable medium
CN113590986A (en) Page link configuration method and device, electronic equipment and computer readable medium
CN112929453A (en) Method and device for sharing session data
CN112084183A (en) Data verification method and device, electronic equipment and computer readable medium
CN113242306B (en) Block chain consensus method and device
CN111784429B (en) Information pushing method and device
CN108984189B (en) Module parsing method and device
CN114741314A (en) Test case generation method and device, electronic equipment and storage medium
CN115134208A (en) Message conversion method and device, electronic equipment and storage medium
CN113472565A (en) Method, device, equipment and computer readable medium for expanding server function

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