A method and system for providing an order number

By combining Redis server and client, and using the mapping between user ID and sub-database identifiers, order numbers are distributed across different sub-databases, solving the problem of slow database access speed when a large number of users request order numbers simultaneously, and achieving efficient and secure order number provision.

CN114911983BActive Publication Date: 2025-12-16CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110183280.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-10
Publication Date
2025-12-16
Estimated Expiration
2041-02-10

AI Technical Summary

Technical Problem

When a large number of users request order numbers simultaneously, existing technologies often result in slow database access speeds or even inability to connect to the database, leading to low efficiency in order number provision.

Method used

By using a combination of Redis server and client, order numbers are distributed to different sub-databases through the mapping relationship between user ID and sub-database identifier. The Redis client reads the order numbers from the target sub-database and stores and reads the order numbers through the sorted set Zset data structure.

Benefits of technology

It improved database performance and access speed, enhanced the efficiency and security of serving various users, met the latency requirements of different business types, and reduced database pressure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911983B_ABST
    Figure CN114911983B_ABST
Patent Text Reader

Abstract

The application provides a method for providing an order number. In the technical scheme, a Redis server receives a first order number request message sent by a first user client, the first order number request message comprising an ID of the first user; the Redis server determines a target sub-database identifier corresponding to the first user ID according to a mapping relationship between the user ID and the sub-database identifier; the Redis server sends a second order number request message to a target Redis client, the second order number request message comprising the target sub-database identifier; the Redis server receives a target order number read by the target Redis client from a sub-database indicated by the target sub-database identifier; and the Redis server sends the target order number to the first user client after receiving the target order number. The technical scheme can improve the performance of the database and improve the access speed of the database.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet communication, and in particular to a method and system for providing an order number. BACKGROUND

[0002] With the rapid development of Internet technology, more and more users purchase services through the Internet. For example, in the telecommunication, finance or e-commerce industries, more and more users submit orders through the Internet to purchase corresponding services.

[0003] In order to better manage the order information of users, a service providing system, such as a telecommunication service, a finance service or an e-commerce service providing system, usually provides a unique order number for each order of each user to identify the order.

[0004] In the prior art, the service providing system pre-generates a large number of order numbers and stores these order numbers in a same order number table in a database. When the service providing system receives an order request message of a user, an available order number is obtained from the order number table as an order number of an order requested by the order request message. The available order number can be understood as an order number in the order number table that has not been used.

[0005] The method for providing an order number by the above service providing system has the following problems: when a large number of users simultaneously request orders, i.e., the service providing system needs to simultaneously provide order numbers for a large number of users, the speed of the service providing system accessing the database is very slow, or even the service providing system cannot connect to the database, thereby resulting in a low efficiency of providing order numbers. SUMMARY

[0006] The present application provides a method and system for providing an order number, which can improve the performance of a database, improve the access speed of the database, and thereby improve the efficiency and performance of each user service.

[0007] In a first aspect, the application provides a method for providing an order number. The method comprises: a Redis server receiving a first order number request message sent by a first user client, the first order number request message comprising a first identity number (ID) of the first user; the Redis server determining a target sub-database ID corresponding to the first user ID according to a mapping relationship between the user ID and the sub-database ID; the Redis server determining a target Redis client corresponding to the target sub-database ID according to a mapping relationship between the sub-database ID and the Redis client; the Redis server sending a second order number request message to the target Redis client, the second order number request message comprising the target sub-database ID; the target Redis client receiving the target sub-database ID; the target Redis client reading a target order number from a sub-database indicated by the target sub-database ID; the target Redis client sending the target order number to the Redis server; and the Redis server sending the target order number to the first user client after receiving the target order number.

[0008] In the method, the order numbers corresponding to different user IDs are respectively preset in different sub-databases, so that when the user requests an order number, the Redis can read the order number for the user from the corresponding sub-database based on the user ID. Compared with the prior art in which the order numbers of all users are read from one database, when multiple users read order numbers at the same time, the reading pressure is distributed to multiple sub-databases, thereby improving the performance and access speed of the database, and thus the efficiency and performance of services for each user can be improved. In addition, different users can only access the corresponding sub-database, thereby improving the security performance of order number access.

[0009] In combination with the first aspect, in a first possible implementation, the first order number request message further comprises a first service type identifier, and correspondingly, the second order number request message further comprises the first service type identifier; the target Redis client reads the target order number from the sub-database indicated by the target sub-database ID, comprising: the target Redis client determines a sub-data table corresponding to the first service type identifier in the sub-database indicated by the target sub-database ID; and the target Redis client reads the target order number from the sub-data table.

[0010] In this implementation, different sub-data tables are allocated for different services, and the order number is read from the sub-data table corresponding to the service type, so that when multiple services request order numbers at the same time, the reading efficiency of the order numbers of different services can be improved, thereby meeting the delay requirement of the service type on the order number.

[0011] With reference to the first possible implementation, in a second possible implementation, the order numbers stored in the sub-data table are a plurality of order numbers sorted in ascending order.

[0012] With reference to the second possible implementation, in a third possible implementation, the order numbers stored in the sub-data table are stored in a Zset data structure, and a primary key of the Zset data structure is a business type.

[0013] In this implementation, Redis generates order numbers sorted in ascending order as Values of a ZSet data structure in Redis, and stores the order numbers in the ZSet data structure, so that the first order number of the Values of the ZSet data structure can be directly read as the minimum order number, thereby improving service efficiency.

[0014] In a second aspect, the present application provides a system for providing an order number, which can include various devices for implementing the method in the first aspect.

[0015] For example, the system can include a Redis server and a Redis client.

[0016] The remote dictionary service Redis server is configured to receive a first order number request message sent by a first user client, the first order number request message including a first identity number ID of the first user; the Redis server is further configured to determine a target sub-database identifier corresponding to the first user ID according to a mapping relationship between a user ID and a sub-database identifier; the Redis server is further configured to determine a target Redis client corresponding to the target sub-database identifier according to a mapping relationship between a sub-database identifier and a Redis client; the Redis server is further configured to send a second order number request message to the target Redis client, the second order number request message including the target sub-database identifier; the target Redis client is configured to receive the target sub-database identifier; the target Redis client is further configured to read a target order number from a sub-database indicated by the target sub-database identifier; the target Redis client is further configured to send the target order number to the Redis server; and the Redis server is further configured to send the target order number to the first user client after receiving the target order number.

[0017] With reference to the second aspect, in a first possible implementation manner, the first order number request message further comprises a first service type identifier, and correspondingly, the second order number request message further comprises the first service type identifier; the target Redis client is specifically configured to: determine a sub-data table corresponding to the first service type identifier in a sub-database indicated by the target sub-database identifier; and read the target order number from the sub-data table.

[0018] With reference to the first possible implementation manner, in a second possible implementation manner, the order numbers stored in the sub-data table are a plurality of order numbers sorted in ascending order.

[0019] With reference to the second possible implementation manner, in a third possible implementation manner, the order numbers stored in the sub-data table are stored in a Zset data structure, and a primary key of the Zset data structure is a service type.

[0020] In a third aspect, the present application provides a system for providing an order number, comprising: a memory and a processor; the memory is configured to store program instructions; and the processor is configured to invoke the program instructions in the memory to execute the method in the first aspect or any possible implementation manner thereof.

[0021] In a fourth aspect, the present application provides a chip, comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, and the at least one processor is configured to run a computer program or instructions to execute the method in the first aspect or any possible implementation manner thereof.

[0022] In a fifth aspect, the present application provides a computer readable medium storing program codes for execution by a device, the program codes comprising codes for executing the method in the first aspect or any possible implementation manner thereof.

[0023] In a sixth aspect, the present application provides a computer program product comprising instructions which, when the computer program product is run on a computer, cause the computer to execute the method in the first aspect or any possible implementation manner thereof.

[0024] In a seventh aspect, the present application provides a computing device, comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, the communication interface is configured to communicate with a target system, and the at least one processor is configured to run a computer program or instructions to execute the method in the first aspect or any possible implementation manner thereof. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1A flow chart of a method for providing an order number according to an embodiment of the application;

[0026] Figure 2 A flow chart of a method for providing an order number according to another embodiment of the application;

[0027] Figure 3 A structural diagram of a system for providing an order number according to an embodiment of the application;

[0028] Figure 4 A structural diagram of a system for providing an order number according to another embodiment of the application. DETAILED DESCRIPTION

[0029] In order to improve the performance of a database and the access speed of the database, the application provides a method and a system for providing an order number. In the method, a remote dictionary server (Redis) server receives a first order number request message sent by a first user client, the first order number request message comprising a first identity document (ID) of the first user; the Redis server determines a target sub-database identifier corresponding to the first user ID according to a mapping relationship between the user ID and the sub-database identifier; the Redis server sends a second order number request message to a target Redis client, the second order number request message comprising the target sub-database identifier; the Redis server receives a target order number read from a sub-database indicated by the target sub-database identifier by the target Redis client; after receiving the target order number, the Redis server sends the target order number to the first user client.

[0030] The various methods and systems provided by the application will be described below in conjunction with the accompanying drawings.

[0031] Figure 1 A flow chart of a method for providing an order number according to an embodiment of the application. As shown in FIG. 1, the method can comprise S101, S102, S103, S104, S105, S106, S107 and S108. Figure 1

[0032] S101, the Redis server receives a first order number request message sent by a first user client, the first order number request message comprising an ID of the first user.

[0033] ​In this step, Redis is a memory cache database developed by an Italian, Redis is a key-value storage system that supports rich data types such as strings, lists, sets, ordered sets (Zset), and dictionaries (hash).

[0034] Optionally, Redis can select the sentinel mode of Redis to improve the stability of the order number service. The sentinel mode is a special mode. First, Redis provides the command of the sentinel, and the sentinel is an independent process. As a process, it will run independently. The principle is that the sentinel sends a command and waits for the Redis server to respond, thereby monitoring multiple Redis instances running.

[0035] Optionally, Redis supports horizontal expansion and can be configured in a cluster, that is, multiple Redis servers are used to provide order number services, and all order number services are thread-safe methods.

[0036] The first user client is a client of a user who purchases different types of services through the Internet. The services can be take-out services of a take-out platform, order, return, and payment services of a shopping platform, purchase album services of a music platform, query and card handling services of a telecommunications platform, or other services. Further, after the user purchases the corresponding service according to his own needs, in order to manage the order information of the user, a unique order number needs to be provided for each order of each user to identify the order.

[0037] In an embodiment, when the first user client generates a target order, the first user client first sends a first order number request message to the Redis server, and then the Redis server receives the first order number request message sent by the first user client, and the first order number request message includes the ID of the first user. The identity number, also known as the serial number or account number, is a relatively unique code for identifying a user, which is equivalent to an "identity card".

[0038] S102, the Redis server determines the target sub-database identifier corresponding to the first user ID according to the mapping relationship between the user ID and the sub-database identifier.

[0039] In this step, the mapping relationship between the user ID and the sub-database is pre-set. When the number of order numbers required by a user is large, the user ID can correspond to a sub-database alone, and when the number of order numbers required by a user is small, the user ID corresponds to a sub-database together with the rest of the user IDs. The number of the rest of the users is determined by the number of order numbers of the user, and can be one or multiple.

[0040] In actual application, the sub-database can be a database (db) of a Redis database.

[0041] In an embodiment, when the Redis server receives a first order number request message sent by a first user client and including a first user ID of the first user, the target sub-database identifier corresponding to the first user ID can be determined through the pre-set mapping relationship.

[0042] S103, the Redis server determines the target Redis client corresponding to the target sub-database identifier according to the mapping relationship between the sub-database identifier and the Redis client.

[0043] In this step, the mapping relationship between the sub-database identifier and the Redis client is pre-set. When the number of order numbers required by a user is large, the sub-database identifier can correspond to a Redis client alone, and when the number of order numbers required by a user is small, the sub-database identifier can correspond to a Redis client together with the rest of the sub-database identifiers. The number of the rest of the sub-databases is determined by the number of order numbers, and can be one or multiple.

[0044] In an embodiment, after the Redis server determines the target sub-database identifier, the target Redis client corresponding to the target sub-database identifier can be determined through the pre-set mapping relationship between the sub-database identifier and the Redis client.

[0045] S104, the Redis server sends a second order number request message to the target Redis client, and the second order number request message includes the target sub-database identifier.

[0046] In an embodiment, after the Redis server determines the target Redis client corresponding to the target sub-database identifier, the Redis server sends a second order number request message to the target Redis client, and the second order request message includes the target sub-database identifier obtained in step S102.

[0047] S105, the target Redis client receives the target sub-database identifier.

[0048] S106, the target Redis client reads the target order number from the sub-database indicated by the target sub-database identifier.

[0049] In this step, the order number is generated in advance, and the number of generated order numbers is generated in advance according to the current stress condition of the user and the reference to the previous historical experience. After generation, the order number is stored in each sub-database, and the number of order numbers in each sub-database can be the same or different. When obtaining the order number, it is necessary to judge whether the number of order numbers in each sub-database meets the user's requirement. If all the preset order numbers in a certain sub-database are read, a new batch of order numbers can be generated to provide services for the user.

[0050] Further, the format of the order number of each user is set by the user himself.

[0051] As an example, the technical personnel pre-set the format of the order number as 19 digits, and the specific format can be: 12 digits of current time information, 2 digits of user identifier and 5 digits of sequence identifier. The database generates an order number 2101071348350100003, wherein 210107134835 is the current time information, which contains time information accurate to seconds, such as 21 years 01 month 07 day 13 hours 48 minutes 35 seconds, 01 is the user identifier, and 00001 is the sequence identifier.

[0052] It should be noted that the time information, user identifier and sequence identifier of the order number are all positive integers.

[0053] As another example, the technical personnel pre-set the format of the order number as 2 English letters plus 12 digits, and the database generates an order number jd191020091421, wherein jd is the identifier of the user, and 201020091421 is the current time information, which contains time information accurate to seconds, such as 201020091421 contains time information of 20 years 10 months 20 days 09 hours 14 minutes 21 seconds.

[0054] It should be noted that the time information of the order number is a positive integer.

[0055] In the embodiment, the target Redis client can first determine the position of the target sub-database according to the target sub-database identifier, and read the target order number according to the position of the target sub-database.

[0056] Further, after the target Redis client reads the target order number, the target Redis client deletes the target order number to save database space.

[0057] S107, the target Redis client sends the target order number to the Redis server.

[0058] S108, after receiving the target order number, the Redis server sends the target order number to the first user client.

[0059] In this step, after receiving the target order number sent by the target Redis client, the Redis server sends the target order number to the first user who requests the order number, completing the order number provision of the target user.

[0060] Figure 2 The flow chart of the method for providing an order number according to another embodiment of the application is shown. As shown in the figure, the method can include S201, S202, S203, S204, S205, S206 and S207. Figure 2

[0061] S201, the Redis server receives a first order number request message sent by a first user client, the first order number request message including an ID of the first user and a first service type identifier.

[0062] In this step, the method for the Redis server to receive the first order number request message sent by the first user client is the same as in S101, which will not be repeated here. The request message includes not only the ID of the first user, but also the first service type identifier.

[0063] As an example, the service type identifier sent by the user is a 1-digit number. For example, for an online shopping system, 1 can represent ordering, 2 can represent payment, 3 can represent refund, 4 can represent return, and 5 can represent ordering.

[0064] As another example, the service type identifier sent by the user is a 1-English letter. For example, for a telecommunications system, a can represent query, b can represent card replacement, and c can represent payment.

[0065] Optionally, the service type can support user configuration of personalized services, and the user can select which service type to configure in the sub-database.

[0066] S202, the Redis server determines the target sub-database identifier corresponding to the first user ID according to the mapping relationship between the user ID and the sub-database identifier.

[0067] In this step, the method for the Redis server to determine the target sub-database identifier corresponding to the first user ID according to the mapping relationship between the user ID and the sub-database identifier is the same as in S102, which will not be repeated here.

[0068] S203, the Redis server determines the target Redis client corresponding to the target sub-database identifier according to the mapping relationship between the sub-database identifier and the Redis client.​

[0069] In this step, the Redis server determines the target Redis client corresponding to the target sub-database identifier according to the mapping relationship between the sub-database identifier and the Redis client, and the method is the same as in S103, which will not be repeated here.

[0070] Optionally, when the number of users increases to cause insufficient Redis clients, the Redis client can be increased, that is, the Redis client supports horizontal expansion.

[0071] S204, the Redis server sends a second order number request message to the target Redis client, and the second order number request message includes the target sub-database identifier and the first business type identifier.

[0072] In this step, the method of the Redis server sending a second order number request message to the target Redis client is the same as in S104, which will not be repeated here. The second order number request message includes not only the target sub-database identifier, but also the first business type identifier.

[0073] S205, the target Redis client receives the target sub-database identifier and the first business type identifier.

[0074] In this step, the method of the target Redis client receiving the target sub-database identifier and the first business type identifier is the same as the target Redis client receiving the target sub-database identifier in S103, which will not be repeated here.

[0075] S206, after the target Redis client finds the sub-database indicated by the target sub-database identifier, the target Redis client reads the target order number from the sub-data table indicated by the first business type identifier.

[0076] In this step, one sub-database includes multiple sub-data tables, and different sub-data tables correspond to different business types. The number of sub-data tables in each sub-database can be the same or different, and the business types corresponding to the sub-data tables in different sub-databases can be the same or different.

[0077] As an example, sub-database 1 contains 3 sub-data tables, table 1 corresponds to the business type of ordering, table 2 corresponds to the business type of payment, and table 3 corresponds to the business type of return. Sub-database 2 contains 3 sub-data tables, table 1 corresponds to the business type of ordering, table 2 corresponds to the business type of payment, and table 3 corresponds to the business type of return.

[0078] As another example, the sub-database 1 contains 3 sub-data tables, table 1 corresponds to the business type of ordering, table 2 corresponds to the business type of payment, and table 3 corresponds to the business type of refund. The sub-database 2 contains 3 sub-data tables, table 1 corresponds to the business type of inquiry, table 2 corresponds to the business type of card replacement, and table 3 corresponds to the business type of payment.

[0079] As another example, the sub-database 1 contains 3 sub-data tables, table 1 corresponds to the business type of ordering, table 2 corresponds to the business type of payment, and table 3 corresponds to the business type of refund. The sub-database 2 contains 2 sub-data tables, table 1 corresponds to the business type of ordering, and table 2 corresponds to the business type of payment.

[0080] The order numbers stored in each sub-data table are stored in a Zset data structure, where the key of the Zset data structure is the business type, and the value is a plurality of order numbers sorted in ascending order.

[0081] As an example, the sub-data table 1 corresponds to the business type of payment, and the key of the sub-data table 1 is payment, and the value is 100 order numbers sorted in ascending order stored in a Zset data structure. The type of the order number is determined by the user.

[0082] After the target Redis client finds the sub-database indicated by the target sub-database identifier, the target Redis client reads the smallest order number stored in the Zset data structure from the sub-data table indicated by the first business type identifier as the target order number.

[0083] S207, after the Redis server receives the target order number, the Redis server sends the target order number to the first user client.

[0084] In this step, the method of sending the target order number to the first user client is the same as in S108, which will not be repeated here.

[0085] Figure 3 The structure diagram of the system for providing an order number according to an embodiment of the present application is shown. Figure 3 The system shown can be used to execute the method described in any one of the preceding embodiments. As shown in Figure 3 As shown, the database query system 300 of the present embodiment can include a Redis server 301 and a Redis client 302.

[0086] In an example, the system 300 can be used to execute Figure 1The method described above. For example, the Redis server 301 can be configured to perform S101, the Redis server 301 can be configured to perform S102, the Redis server 301 can be configured to perform S103, the Redis server 301 can be configured to perform S104, the Redis client 302 can be configured to perform S105, the Redis client 302 can be configured to perform S106, the Redis client 302 can be configured to perform S107, and the Redis server 301 can be configured to perform S108.

[0087] In an example, the system 300 can be configured to perform Figure 2 The method described above. For example, the Redis server 301 can be configured to perform S201, the Redis server 301 can be configured to perform S202, the Redis server 301 can be configured to perform S203, the Redis server 301 can be configured to perform S204, the Redis client 302 can be configured to perform S205, the Redis client 302 can be configured to perform S206, and the Redis server 301 can be configured to perform S207.

[0088] Figure 4 A structural diagram of a system for providing an order number according to another embodiment of the present application is shown. Figure 4 The system shown can be configured to perform the method described in any one of the preceding embodiments.

[0089] As shown in Figure 4 The system 400 of the present embodiment includes a memory 401, a processor 402, a communication interface 403, and a bus 404. The memory 401, the processor 402, and the communication interface 403 are communicatively connected to each other through the bus 404.

[0090] The memory 401 can be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 401 can store a program, and when the program stored in the memory 401 is executed by the processor 402, the processor 402 is configured to perform Figure 1 or Figure 2 any method shown in the figures.

[0091] The processor 402 can be a general purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits, for executing programs to implement the method for providing an order number of the embodiments of the present application.

[0092] The processor 402 can also be an integrated circuit chip having a processing capability of signals. In the implementation process, each step of the method for providing an order number of the embodiments of the present application can be completed by the integrated logic circuit of hardware in the processor 402 or the instruction in the form of software.

[0093] The processor 402 described above can also be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the embodiments of the present application can be implemented or executed. The general purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0094] The steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware code processing for execution, or executed by a combination of hardware and software modules in the code processing. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register, or other mature storage medium in the art. The storage medium is located in the storage 401, and the processor 402 reads the information in the storage 401, and combines the hardware to complete the functions required by the units included in the system for providing an order number of the present application, for example, the steps / functions of the embodiments shown in FIG. 2 can be executed. Figure 1 or Figure 2 The steps / functions of the embodiments shown in FIG. 2 can be executed.

[0095] The communication interface 403 can use, but not limited to, a transceiver such as a transceiver device to realize the communication between the system 400 and other devices or communication networks.

[0096] The bus 404 can include a path for transmitting information between the components (for example, the storage 401, the processor 402, the communication interface 403) of the system 400.

[0097] It should be understood that the system 400 shown in the embodiments of the present application can be an electronic device, or can also be a chip configured in the electronic device.

[0098] It should be appreciated that the processor in the embodiments of the present application can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0099] It should also be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM) and direct rambus RAM (DR RAM).

[0100] The above-described embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, the above-described embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are wholly or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server, or data center to another via wired (for example, infrared, wireless, microwave, etc.) or wireless means. The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, or the like, which includes one or more available medium collections. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state disk.

[0101] It should be understood that the term "and / or" herein merely describes an association relationship of associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after it, but it can also represent an "and / or" relationship. The specific meaning can be understood according to the context before and after it.

[0102] In this application, "at least one" means one or more, and "multiple" means two or more. "At least one of the following" or the like means any combination of the items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.

[0103] It should be understood that in various embodiments of the present application, the size of the sequence number of the above-described processes does not mean the order of execution, and the execution order of the processes should be determined according to their functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0104] Those skilled in the art can clearly understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0105] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

[0106] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0107] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0108] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit.

[0109] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.

[0110] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for providing an order number, characterized in that, include: The remote dictionary service Redis server receives a first order number request message sent by the first user client. The first order number request message includes the first user's first identity identification number (ID). The Redis server determines the target sub-database identifier corresponding to the first user ID based on the mapping relationship between the user ID and the sub-database identifier. The mapping relationship between the user ID and the sub-database is determined based on the number of order numbers required by the user. When the number of order numbers required by the user meets a preset threshold, the user ID corresponds to a sub-database on its own. When the number of order numbers required by the user does not meet the preset threshold, the user ID corresponds to a sub-database together with at least one other user ID. The Redis server determines the target Redis client corresponding to the target sub-database identifier based on the mapping relationship between the sub-database identifier and the Redis client; The Redis server sends a second order number request message to the target Redis client, the second order number request message including the target sub-database identifier; The target Redis client receives the target sub-database identifier; The target Redis client reads the target order number from the sub-database indicated by the target sub-database identifier; The target Redis client sends the target order number to the Redis server; After receiving the target order number, the Redis server sends the target order number to the first user client; wherein, the number of target order numbers is generated based on the user's current stress level and the user's historical experience, and is stored in each sub-database after generation; The first order number request message also includes a first business type identifier, and correspondingly, the second order number request message also includes the first business type identifier; The target Redis client reads the target order number from the sub-database indicated by the target sub-database identifier, including: The target Redis client determines the sub-data table in the sub-database indicated by the target sub-database identifier that corresponds to the first business type identifier; wherein, a sub-database includes multiple sub-data tables, and different sub-data tables correspond to different business types; The target Redis client reads the target order number from the sub-data table.

2. The method according to claim 1, characterized in that, The order numbers stored in the sub-data table are multiple order numbers sorted from smallest to largest.

3. The method according to claim 2, characterized in that, The order numbers stored in the sub-data table are stored in an ordered set Zset data structure, and the primary key of the Zset data structure is the business type.

4. A system for providing order numbers, characterized in that, include: A remote dictionary service Redis server is used to receive a first order number request message sent by a first user client. The first order number request message includes the first user's first identity identification number (ID). The Redis server is further configured to determine the target sub-database identifier corresponding to the first user ID based on the mapping relationship between the user ID and the sub-database identifier; wherein, the mapping relationship between the user ID and the sub-database is determined based on the number of order numbers required by the user, when the number of order numbers required by the user meets a preset threshold, the user ID corresponds to a sub-database alone, and when the number of order numbers required by the user does not meet the preset threshold, the user ID and at least one other user ID jointly correspond to a sub-database; The Redis server is further configured to determine the target Redis client corresponding to the target sub-database identifier based on the mapping relationship between the sub-database identifier and the Redis client; The Redis server is further configured to send a second order number request message to the target Redis client, the second order number request message including the target sub-database identifier; The target Redis client is used to receive the target sub-database identifier; The target Redis client is also used to read the target order number from the sub-database indicated by the target sub-database identifier; The target Redis client is also used to send the target order number to the Redis server; The Redis server is also configured to send the target order number to the first user client after receiving the target order number; wherein the number of target order numbers is generated based on the user's current stress level and the user's historical experience, and is stored in each sub-database after generation; The first order number request message also includes a first business type identifier, and correspondingly, the second order number request message also includes the first business type identifier; The target Redis client is specifically used to: determine the sub-data table in the sub-database indicated by the target sub-database identifier that corresponds to the first business type identifier; wherein, a sub-database includes multiple sub-data tables, and different sub-data tables correspond to different business types; and read the target order number from the sub-data table.

5. The system according to claim 4, characterized in that, The order numbers stored in the sub-data table are multiple order numbers sorted from smallest to largest.

6. The system according to claim 5, characterized in that, The order numbers stored in the sub-data table are stored in an ordered set Zset data structure, and the primary key of the Zset data structure is the business type.

7. A system for providing order numbers, characterized in that, include: Memory and processor; The memory is used to store program instructions; The processor is used to invoke program instructions in the memory to execute the method as described in any one of claims 1 to 3.

8. A computer-readable medium, characterized in that, The computer-readable medium stores program code for computer execution, the program code including instructions for performing the method as described in any one of claims 1 to 3.

9. A computer program product, said computer program product comprising computer program code, characterized in that, When the computer program code is run on a computer, it causes the computer to implement the method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and device for processing order data of high-concurrency businesses

    CN107464151A

  • Method and device for operating Redis database

    CN110109983A