A private number AXYG mode number selection method, system, device and storage medium
By using Redis data structures and Lua script difference operations, a privacy number selection method in AXYG mode was implemented, which solves the problems of insufficient selection performance and functional limitations in existing technologies, improves selection performance and connection rate, and meets the number display needs of customers.
Patent Information
- Application Number
- CN202411705996.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-11-26
Smart Images

Figure CN119676697B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication services, more particularly, it relates to a privacy number AXYG mode number selection method, system, device and storage medium. BACKGROUND
[0002] The current privacy number AXYG mode number selection technology is realized based on a relational database. In terms of performance, it cannot meet the demand of low response delay when the privacy number business grows rapidly, and the user experience is poor. In terms of business function, it cannot support the priority arrangement combination strategy number selection of city, province and country, and cannot support random number selection and number selection according to the binding quantity.
[0003] The current privacy number AXG mode cannot support different privacy numbers when A number is called back, and cannot meet the demand of seeing the local home number when A number is called back in the express home delivery, home appliance store after-sales and other industries, which may affect the connection rate of the callback scene in these industries. SUMMARY
[0004] The technical problem to be solved by the present application is to solve the above-mentioned deficiencies of the prior art. The purpose of the present application is to provide a privacy number AXYG mode number selection method, which can greatly improve the number selection performance.
[0005] The second purpose of the present application is to provide a privacy number AXYG mode number selection system.
[0006] The third purpose of the present application is to provide a computer device.
[0007] The fourth purpose of the present application is to provide a computer storage medium.
[0008] In order to achieve the above-mentioned first purpose, the present application provides a privacy number AXYG mode number selection method, comprising:
[0009] First, the privacy number of the customer is obtained; and according to the city partition, province partition and country partition to which the privacy number of the customer belongs, different key Redis sorted set number pool data structures are generated: city number pool, key is customer identifier_area number, value is privacy number set, the score of each number is 0; province number pool, key is customer identifier_province number, value is privacy number set, the score of each number is 0; nationwide number pool, key name is customer identifier, value is privacy number set, the score of each number is 0; score 0 indicates that the binding quantity of the privacy number is initially 0;
[0010] Then create G number group, a G number group for a groupId identification, and corresponding to a plurality of real numbers, according to the groupId and the corresponding real number to generate different key Redislist data structure: key for groupId, value for real number set;
[0011] The number selection process includes the following steps:
[0012] Step 1. Get the AXYG binding request initiated by the customer, get the incoming real A number, groupId, specified privacy number X area code, specified privacy number Y area code;
[0013] Step 2. According to the incoming real number A, groupId and specified privacy number X area code, specified privacy number Y area code, generate X area code corresponding Redis storage key, Y area code corresponding Redis storage key;
[0014] Step 3. Select privacy number X according to the X area code corresponding Redis storage key; if the privacy number X is successfully selected, execute step 4; otherwise, execute step 6;
[0015] Step 4. Select privacy number Y according to the Y area code corresponding Redis storage key; if the privacy number Y is successfully selected, execute step 5; otherwise, roll back X number, remove the X number selected in step 3 from the real number A bound privacy number X set, indicating that the privacy number is not bound with the real number A, and execute step 6;
[0016] Step 5. Return the selected privacy number X and privacy number Y to the customer;
[0017] Step 6. Return the information of insufficient number pool resources to the customer.
[0018] As a further improvement, the X area code corresponding Redis storage key includes: the real number A bound privacy number X set key for customer identification_privacy number X area code_real number A, and the privacy number X set key for customer identification_X area code.
[0019] The Y area code corresponding Redis storage key includes: the groupId bound privacy number Y set key for customer identification_privacy number Y area code_groupId, and the privacy number Y set key for customer identification_Y area code.
[0020] Further, step 3 includes the following steps:
[0021] Step 31. Determine whether the number set of the specified privacy number X area code is empty, if not, execute step 32; if empty, execute step 34;
[0022] Step 32. According to the generated X area code corresponding Redis storage key, execute the SDIFF command through the Redis lua script, and perform set difference operation on the real number A bound privacy number X set and the number set of the specified privacy number X area code;
[0023] Step 33. Determine whether the difference set result is empty. If not, randomly select a privacy number from the difference set result, and execute step 36; if empty, execute step 34;
[0024] Step 34. Execute the ZRANGE command through the Redis lua script to select the X number with the smallest score from the province number pool; determine whether the X number already exists in the real number A bound privacy number X set, if not, execute step 36; if exists, execute step 35;
[0025] Step 35. Execute the ZRANGE command through the Redis lua script to select the X number with the smallest score from the nationwide number pool; determine whether the X number already exists in the real number A bound privacy number X set, if not, execute step 36; if exists, execute step 38;
[0026] Step 36. Add the obtained privacy number to the real number A bound privacy number X set, indicating that the privacy number has been bound with the real number A;
[0027] Step 37. Execute the ZINCRBY command through the Redis lua script to add 1 to the score of the selected X number in the city, province, and nationwide number pool, indicating that the binding quantity of the privacy number increases; return the selected privacy number X;
[0028] Step 38. Return the selection failure information.
[0029] Further, step 4 includes the following steps:
[0030] Step 41. Determine whether the number set of the specified privacy number Y area code is empty. If not, execute step 42; if empty, execute step 44;
[0031] Step 42. According to the generated Y area code corresponding Redis storage key, execute the SDIFF command through the Redis lua script, and perform set difference operation on the groupId bound privacy number Y set and the number set of the specified privacy number Y area code;
[0032] Step 43. Determine whether the difference set result is empty. If not, randomly select a privacy number from the difference set result, and execute step 46; if empty, execute step 44;
[0033] Step 44. Execute the ZRANGE command through the lua script of Redis to select the Y number with the minimum score from the province number pool, and judge whether the Y number exists in the groupId bound private number Y set; if not, execute step 46; if yes, execute step 45;
[0034] Step 45. Execute the ZRANGE command through the lua script of Redis to select the Y number with the minimum score from the nationwide number pool, and judge whether the Y number exists in the groupId bound private number Y set; if not, execute step 46; if yes, execute step 48;
[0035] Step 46. Add the obtained private number to the groupId bound private number Y set, indicating that the private number is bound to the groupId;
[0036] Step 47. Execute the ZINCRBY command through the lua script of Redis to increase the score of the selected Y number in the city, province and nationwide number pool by 1, indicating that the binding quantity of the private number is increased; and return the selected private number Y;
[0037] Step 48. Return the selection failure information.
[0038] In order to achieve the above-mentioned purpose two, the application provides a private number AXYG mode number selection system, comprising:
[0039] The number pool module is used for obtaining the private number of the customer; and generating different key Redis sorted set number pool data structures according to the city partition, province partition and country partition to which the private number of the customer belongs: the city number pool, the key is the customer identifier_area number, the value is the private number set, and the score of each number is 0; the province number pool, the key is the customer identifier_province number, the value is the private number set, and the score of each number is 0; the nationwide number pool, the key name is the customer identifier, the value is the private number set, and the score of each number is 0; and the score of 0 indicates that the binding quantity of the private number is initially 0;
[0040] The G number group module is used for creating a G number group, and one G number group is one groupId identifier and corresponds to a plurality of real numbers; and different keys Redis list data structures are generated according to the groupId and the corresponding real numbers: the key is the groupId, and the value is the real number set;
[0041] The obtaining module is used for obtaining the AXYG binding request initiated by the customer, obtaining the transmitted real A number, groupId, specified private number X area number and specified private number Y area number.
[0042] A generating storage key module, for generating an X area code corresponding Redis storage key and a Y area code corresponding Redis storage key according to the real number A, the group ID, and the specified privacy number X area code and the specified privacy number Y area code respectively;
[0043] A selecting module, for selecting the privacy number X according to the X area code corresponding Redis storage key, and selecting the privacy number Y according to the Y area code corresponding Redis storage key;
[0044] A returning module, for returning the selected privacy number X and the privacy number Y to the client, or returning the information of insufficient number pool resources to the client.
[0045] In order to achieve the above-mentioned purpose three, the application provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor realizes the above-mentioned privacy number AXYG mode number selection method when executing the computer program.
[0046] In order to achieve the above-mentioned purpose four, the application provides a computer readable storage medium, which stores a computer program, and the computer program realizes the above-mentioned privacy number AXYG mode number selection method when being executed by a processor.
[0047] Beneficial effects
[0048] Compared with the prior art, the application has the advantages of:
[0049] The application supports the priority arrangement combination strategy number selection of three kinds of customer code number pools of cities, provinces and the whole country, and the number selection performance is greatly improved; the numbers in the G number group can be called to the numbers in the corresponding binding relationship through the X number, and the A number can be called to the numbers in the corresponding binding relationship in the G number group through the Y number. BRIEF DESCRIPTION OF DRAWINGS
[0050] Figure 1 The flowchart of the application. DETAILED DESCRIPTION
[0051] The application will be further described below in combination with the specific embodiments in the drawings.
[0052] Reference Figure 1 A privacy number AXYG mode number selection method, comprising:
[0053] Firstly, the privacy number of the customer is acquired; and according to the city partition, province partition and country partition to which the privacy number of the customer belongs, different key Redis sorted set number pool data structures are generated: city number pool, key is customer identifier_area number, value is privacy number set, and the score of each number is 0; province number pool, key is customer identifier_province number, value is privacy number set, and the score of each number is 0; nationwide number pool, key name is customer identifier, value is privacy number set, and the score of each number is 0; the score (score) is 0, which indicates that the binding quantity of the privacy number is initially 0.
[0054] Then, a G number group is created, one G number group is one group identifier, and corresponds to a plurality of real numbers, which are generally the numbers of the business personnel of the customer system. Different key Redis list data structures are generated according to the group identifier and the corresponding real numbers: key is group identifier, value is real number set. The group identifier can represent the G number group.
[0055] The number selection process includes the following steps:
[0056] Step 1. The AXYG binding request initiated by the customer is acquired, and the incoming real number A, group identifier, specified privacy number X area number and specified privacy number Y area number are obtained.
[0057] Step 2. The X area number corresponding Redis storage key and the Y area number corresponding Redis storage key are generated according to the incoming real number A, group identifier, specified privacy number X area number and specified privacy number Y area number.
[0058] The X area number corresponding Redis storage key includes: the real number A has bound the privacy number X set key is customer identifier_privacy number X area number_real number A, and the specified area number privacy number X set key is customer identifier_X area number.
[0059] The Y area number corresponding Redis storage key includes: the group identifier has bound the privacy number Y set key is customer identifier_privacy number Y area number_groupId, and the specified area number privacy number Y set key is customer identifier_Y area number.
[0060] Step 3. The privacy number X is selected according to the X area number corresponding Redis storage key; if the privacy number X is successfully selected, step 4 is executed; otherwise, step 6 is executed.
[0061] Step 4. Select private number Y based on the Redis storage key corresponding to area code Y. If private number Y is successfully selected, proceed to step 5. Otherwise, roll back number X. The set of private numbers X bound to real number A is removed from the number X selected in step 3, indicating that the private number is not bound to real number A. Then proceed to step 6.
[0062] Step 5. Return the selected private number X and private number Y to the customer;
[0063] Step 6. Return the information that the number pool resources are insufficient to the customer.
[0064] Specifically, step 3 includes the following steps:
[0065] Step 31. Determine whether the number set of the designated private number X area code is empty. If not, proceed to step 32; if empty, proceed to step 34;
[0066] Step 32. Based on the generated Redis storage key corresponding to area code X, execute the SDIFF command through the Redis Lua script to perform a set difference operation on the set of privacy numbers X bound to real number A and the set of numbers with the specified privacy number X area code;
[0067] Step 33. Determine whether the difference result is empty. If not, randomly select a private number from the difference result and execute step 36. If it is empty, execute step 34.
[0068] Step 34. Execute the ZRANGE command through the Redis Lua script to select the number X with the smallest score (i.e., the smallest binding amount) from the provincial number pool; determine whether the real number A is already bound to the privacy number set X (key: customer ID_privacy number X area code_real number A, value: privacy number set). If not, proceed to step 36; if so, proceed to step 35.
[0069] Step 35. Execute the ZRANGE command through the Redis Lua script to select the number X with the smallest score (i.e., the smallest binding amount) from the national number pool; determine whether the real number A is already bound to the privacy number set X (key: customer ID_privacy number X area code_real number A, value: privacy number set). If not, proceed to step 36; if so, proceed to step 38.
[0070] Step 36. Add the obtained private number to the set of private numbers X bound to real number A (key: customer ID_private number X area code_real number A, value: private number set), indicating that the private number has been bound to real number A;
[0071] Step 37. Execute the ZINCRBY command through the lua script of Redis to add 1 to the score of the city, province, and national number pool of the selected number X, indicating that the binding quantity of the privacy number increases; return the selected privacy number X;
[0072] Step 38. Return the selection failure information.
[0073] Step 4 includes the following steps:
[0074] Step 41. Determine whether the number set of the specified privacy number Y area code is empty. If not, execute step 42; if empty, execute step 44;
[0075] Step 42. According to the generated Redis storage key corresponding to the Y area code, execute the SDIFF command through the lua script of Redis to do set difference operation on the groupId bound privacy number Y set and the number set of the specified privacy number Y area code;
[0076] Step 43. Determine whether the set difference result is empty. If not, randomly select a privacy number from the set difference result and execute step 46; if empty, execute step 44;
[0077] Step 44. Execute the ZRANGE command through the lua script of Redis to select the Y number with the smallest score from the province number pool, and determine whether the Y number already exists in the groupId bound privacy number Y set. If not, execute step 46; if exists, execute step 45;
[0078] Step 45. Execute the ZRANGE command through the lua script of Redis to select the Y number with the smallest score from the national number pool, and determine whether the Y number already exists in the groupId bound privacy number Y set. If not, execute step 46; if exists, execute step 48;
[0079] Step 46. Add the obtained privacy number to the groupId bound privacy number Y set (key: customer identification_privacy number Y area code_groupId, value: privacy number set), indicating that the privacy number has been bound to the groupId;
[0080] Step 47. Execute the ZINCRBY command through the lua script of Redis to add 1 to the score of the city, province, and national number pool of the selected Y number, indicating that the binding quantity of the privacy number increases; return the selected privacy number Y;
[0081] Step 48. Return the selection failure information.
[0082] Thus, the priority arrangement combination strategy of the three customer code number pools of city, province and country is supported, and the number selection performance is greatly improved. The numbers in the G number group can be called to the A number corresponding to the binding relationship through the X number, and the A number can be called to the number (default first number) in the G number group corresponding to the binding relationship through the Y number.
[0083] A privacy number AXYG mode number selection system, comprising:
[0084] A number pool module for obtaining a customer's privacy number; and generating different key Redis sorted set number pool data structures according to the city partition, province partition and country partition to which the customer's privacy number belongs: a city number pool, the key is a customer identifier_area number, the value is a privacy number set, and the score of each number is 0; a province number pool, the key is a customer identifier_province number, the value is a privacy number set, and the score of each number is 0; a country number pool, the key is a customer identifier, the value is a privacy number set, and the score of each number is 0; the score of 0 indicates that the binding quantity of the privacy number is initially 0;
[0085] A G number group module for creating a G number group, a G number group being identified by a groupId, and corresponding to a plurality of real numbers, and generating different key Redis list data structures according to the groupId and the corresponding real numbers: the key is a groupId, and the value is a real number set;
[0086] An acquisition module for obtaining a customer-initiated AXYG binding request to obtain an incoming real A number, a groupId, a specified privacy number X area number and a specified privacy number Y area number;
[0087] A storage key generation module for generating a Redis storage key corresponding to the X area number and a Redis storage key corresponding to the Y area number according to the transmitted real number A, the groupId and the specified privacy number X area number and the specified privacy number Y area number;
[0088] A selection module for selecting a privacy number X according to the Redis storage key corresponding to the X area number, and selecting a privacy number Y according to the Redis storage key corresponding to the Y area number;
[0089] A return module for returning the selected privacy number X and the privacy number Y to the customer, or returning a number pool resource insufficient information to the customer.
[0090] A computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned privacy number AXYG mode number selection method when executing the computer program.
[0091] A computer readable storage medium, having stored thereon a computer program, the computer program being executed by a processor to implement the private number AXYG mode number selection method.
[0092] The above is only the preferred embodiment of the present application, it should be noted that for those skilled in the art, without departing from the structure of the present application, can also be made several variations and improvements, these will not affect the effect and the practicality of the patent of the present application.
Claims
1. A method for selecting a private number in AXYG mode, characterized in that: include: First, obtain the customer's private number; and generate Redis sorted set number pool data structures with different keys based on the city partition, province partition, and country partition to which the customer's private number belongs: the city number pool, the key is customer ID_area code, the value is the private number collection, and the score of each number is 0; the province number pool, the key is customer ID_province code, the value is the private number collection, and the score of each number is 0; the national number pool, the key is customer ID, the value is the private number collection, and the score of each number is 0; a score of 0 indicates that the binding amount of the private number is initially 0; Then create a G number group. A G number group is identified by a groupId and corresponds to multiple real numbers. Based on the groupId and the corresponding real numbers, a Redislist data structure with different keys is generated: the key is the groupId, and the value is the real number set. The number selection process includes the following steps: Step 1. Obtain the AXYG binding request initiated by the customer and obtain the real A number, groupId, designated privacy number X area code, and designated privacy number Y area code; Step 2. Generate the Redis storage key corresponding to area code X and area code Y based on the real number A, groupId, and the designated privacy number X area code and the designated privacy number Y area code respectively; Step 3. Select the private number X based on the Redis storage key corresponding to area code X; if the private number X is successfully selected, proceed to step 4; otherwise, proceed to step 6; Step 4. Select private number Y based on the Redis storage key corresponding to area code Y. If private number Y is successfully selected, proceed to step 5. Otherwise, roll back number X. The set of private numbers X bound to real number A is removed from the number X selected in step 3, indicating that the private number is not bound to real number A. Then proceed to step 6. Step 5. Return the selected private number X and private number Y to the customer; Step 6. Return the information that the number pool resources are insufficient to the customer.
2. A method for selecting a private number in AXYG mode according to claim 1, characterized in that: The Redis storage keys corresponding to the X area code include: the real number A is bound to the privacy number X set key is customer ID_privacy number X area code_real number A, the privacy number X set key of the specified area code is customer ID_X area code; The Redis storage keys corresponding to the Y area code include: groupId bound to the privacy number Y set key is customer ID_privacy number Y area code_groupId, and the privacy number Y set key of the specified area code is customer ID_Y area code.
3. The method for selecting a private number in AXYG mode according to claim 2, characterized in that: Step 3 includes the following steps: Step 31. Determine whether the number set of the designated private number X area code is empty. If not, proceed to step 32; if empty, proceed to step 34; Step 32. Based on the generated Redis storage key corresponding to area code X, execute the SDIFF command through the Redis Lua script to perform a set difference operation on the set of privacy numbers X bound to real number A and the set of numbers with the specified privacy number X area code; Step 33. Determine whether the difference result is empty. If not, randomly select a private number from the difference result and execute step 36. If it is empty, execute step 34. Step 34. Execute the ZRANGE command through the Redis Lua script to select the X number with the smallest score from the provincial number pool; determine whether the X number already exists in the set of private numbers X that are bound to the real number A. If not, proceed to step 36; if so, proceed to step 35. Step 35. Execute the ZRANGE command through the Redis Lua script to select the number X with the smallest score from the national number pool; determine whether the number X already exists in the set of private numbers X that are bound to real number A. If not, proceed to step 36; if so, proceed to step 38. Step 36. Add the obtained private number to the set of private numbers X that are bound to real number A, indicating that the private number has been bound to real number A; Step 37. Execute the ZINCRBY command through the Redis Lua script to increase the score of the city, province, and national number pool of the selected number X by 1, indicating that the number of private numbers bound has increased; and return the selected private number X. Step 38. Return the selection failure information.
4. The method for selecting a private number in AXYG mode according to claim 3, characterized in that: Step 4 includes the following steps: Step 41. Determine whether the number set of the designated private number Y area code is empty. If not, proceed to step 42; if empty, proceed to step 44; Step 42. Based on the generated Redis storage key corresponding to area code Y, execute the SDIFF command through the Redis Lua script to perform a set difference operation on the set of private numbers Y bound to groupId and the set of numbers with the specified private number Y area code; Step 43. Determine whether the difference result is empty. If not, randomly select a private number from the difference result and execute step 46. If it is empty, execute step 44. Step 44. Execute the ZRANGE command through the Redis Lua script to select the Y number with the smallest score from the provincial number pool and determine whether the Y number already exists in the groupId-bound private number Y set; if not, execute step 46; if so, execute step 45; Step 45. Execute the ZRANGE command through the Redis Lua script to select the Y number with the smallest score from the national number pool. Check whether the Y number already exists in the groupId-bound private number Y set. If not, proceed to step 46. If so, proceed to step 48. Step 46. Add the obtained private number to the set Y of private numbers bound to groupId, indicating that the private number has been bound to groupId; Step 47. Execute the ZINCRBY command through the Redis Lua script, add 1 to the score of the city, province, and national number pool of the selected number Y, indicating that the binding amount of the private number has increased; and return the selected private number Y; Step 48. Return the selection failure information.
5. A privacy number AXYG mode number selection system, characterized by: include: Number pool module, used to obtain customers' private numbers; And according to the city partition, province partition, and country partition to which the customer's privacy number belongs, a Redis sorted set number pool data structure with different keys is generated respectively: for the city number pool, the key is the customer ID_area code, the value is the privacy number set, and the score of each number is 0; for the province number pool, the key is the customer ID_province code, the value is the privacy number set, and the score of each number is 0; for the national number pool, the key is the customer ID, the value is the privacy number set, and the score of each number is 0; a score of 0 indicates that the binding amount of the privacy number is initially 0; The G number group module is used to create G number groups. A G number group is identified by a groupId and corresponds to multiple real numbers. A Redislist data structure with different keys is generated based on the groupId and the corresponding real numbers: the key is the groupId and the value is the real number set; The acquisition module is used to obtain the AXYG binding request initiated by the customer and obtain the incoming real A number, groupId, designated privacy number X area code, and designated privacy number Y area code; Generate storage key module, which is used to generate Redis storage key corresponding to area code X and area code Y respectively according to the transmitted real number A, groupId, and designated privacy number X area code and designated privacy number Y area code; The selection module is used to select the private number X according to the Redis storage key corresponding to the area code X; and select the private number Y according to the Redis storage key corresponding to the area code Y; The return module is used to return the selected privacy number X and privacy number Y to the customer; or return the information of insufficient number pool resources to the customer.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, it implements the privacy number AXYG mode number selection method described in any one of claims 1-4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements a privacy number AXYG mode number selection method as described in any one of claims 1-4.
Citation Information
Patent Citations
Method and device for realizing two-way voice communication between privacy number and real number through non-binding relationship
CN115022867A
Flexible content selection processes using secure multi-party computation
US20230171091A1