User management method, system and storage medium
By converting the user identifier into an internal identifier and storing its corresponding relationship in the cache, and using the three-level cache for search, the problems of large storage space and low query efficiency in the existing technology are solved, and efficient user information management is achieved.
Patent Information
- Application Number
- CN202110117594.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-28
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-01-28
AI Technical Summary
In the existing technology, the business system occupies a large storage space when storing user IDs and group IDs, and the query efficiency is low, requiring frequent database queries, resulting in cumbersome operations.
By receiving the user ID, converting it into an internal ID, and storing its corresponding relationship in the cache, the three-level cache (business cache, system cache, database cache) is used for search, which reduces database operations and improves query efficiency.
It greatly reduces the database storage space requirements, improves the efficiency of user information management, and reduces the frequency of database operations.
Smart Images

Figure CN112835929B
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a user management method, system and storage medium. Background Art
[0002] In the related art, when the business system performs daily business operations, the user ID and group ID are often stored together in the database, which requires a large storage space; when searching for information, each group needs to be queried in turn, which has low query efficiency and high requirements for business system design. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a user management method, which can improve the efficiency of data query and greatly reduce the demand for data storage space.
[0004] The present application also proposes a user management system having the above user management method.
[0005] The present application also proposes a computer-readable storage medium.
[0006] According to the first aspect of the present application, the user management method includes:
[0007] receiving a user identification;
[0008] Converting the user ID into an internal ID;
[0009] Searching the cache according to the internal identifier to obtain a search result;
[0010] Obtaining corresponding user information according to the search result;
[0011] The cache includes a business cache, a system cache, and a database cache, and the cache pre-stores a correspondence between the user identifier and the internal identifier.
[0012] According to the user management method of the embodiment of the present application, there are at least the following beneficial effects: the user identifier is converted into an internal identifier and its corresponding relationship is stored, which greatly reduces the demand for database storage space; the corresponding user information is obtained by searching in the cache, which improves management efficiency and greatly reduces database operations.
[0013] According to some embodiments of the present application, converting the user identifier into an internal identifier includes: generating a bit array according to the data amount of the user identifier; converting the user identifier into an internal identifier; and storing the internal identifier in the bit array.
[0014] According to some embodiments of the present application, searching the cache according to the internal identifier to obtain a search result includes: searching in the business cache according to the internal identifier to obtain a first search result; searching in the system cache according to the first search result to obtain a second search result; searching in the database cache according to the second search result to obtain a third search result; wherein the user information is obtained according to the first search result, the second search result, and the third search result.
[0015] According to some embodiments of the present application, searching the cache according to the internal identifier to obtain a search result also includes: customizing query conditions; searching in the business cache, system cache, and database cache according to the query conditions to obtain the search result; and obtaining the storage location of the user identifier based on the search result.
[0016] According to some embodiments of the present application, it also includes: importing the user identifier through an attachment; performing group conversion processing on the user identifier to generate the internal identifier, and obtaining a group conversion result; uploading the group conversion result to the management platform; wherein the group conversion result includes the correspondence between the user identifier and the internal identifier, and the group position of the internal identifier.
[0017] According to some embodiments of the present application, it also includes: writing the internal identifier into a persistent device according to the result of the group conversion.
[0018] According to the second aspect of the present application, a user management system includes:
[0019] A service interface module, used to receive and search for user identification;
[0020] A data conversion module, connected to the service interface module for converting the user identifier into an internal identifier;
[0021] A data cache module, which is in communication with the data conversion module and is used to store the corresponding relationship between the user identifier and the internal identifier in a cache;
[0022] The cache includes business cache, system cache and database cache.
[0023] The user management system according to the embodiment of the present application has at least the following beneficial effects: receiving and searching for user representations through the service interface module, and converting the user identifier into an internal identifier using the data conversion module, and storing the corresponding relationship, which greatly reduces the demand for database storage space; storing the corresponding relationship between the user identifier and the internal identifier through the data cache module, and obtaining the corresponding user information by searching in the cache, which improves management efficiency and greatly reduces database operations.
[0024] According to some embodiments of the present application, the service interface module is also used to perform calling operations, and the calling operations include importing, exporting, and managing.
[0025] According to some embodiments of the present application, it also includes: a persistent storage module, which is communicatively connected to the data cache module and is used to permanently store the internal identifier.
[0026] According to the computer-readable storage medium of the third aspect embodiment of the present application, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the user management method as described in the first aspect embodiment of the present application.
[0027] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The present application is further described below with reference to the accompanying drawings and embodiments, wherein:
[0029] Figure 1 A flowchart of a user management method according to an embodiment of the present application;
[0030] Figure 2 for Figure 1 Specific flow diagram of step S200;
[0031] Figure 3 for Figure 1 Specific flow diagram of step S300;
[0032] Figure 4 for Figure 1 Another specific flow chart of step S300;
[0033] Figure 5 A flowchart of another user management method according to an embodiment of the present application;
[0034] Figure 6 This is a structural block diagram of the user management system of an embodiment of the present application;
[0035] Figure 7 This is a structural block diagram of another user management system according to an embodiment of the present application.
[0036] Reference numerals:
[0037] Service interface module 100 , data conversion module 200 , data cache module 300 , and persistent storage module 400 . DETAILED DESCRIPTION
[0038] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0039] In the description of the present application, it should be understood that descriptions involving orientation, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0040] In the description of this application, "several" means more than one, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0041] In the description of this application, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in this application based on the specific content of the technical solution.
[0042] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0043] Reference below Figure 1 A user management method according to an embodiment of the present application is described.
[0044] like Figure 1 The user management method according to the embodiment of the present application includes:
[0045] Step S100: receiving a user identification;
[0046] Step S200: converting the user ID into an internal ID;
[0047] Step S300: searching the cache according to the internal identifier to obtain a search result;
[0048] Step S400: Obtain corresponding user information according to the search result.
[0049] The cache includes a business cache, a system cache, and a database cache, and the cache pre-stores a correspondence between a user identifier and an internal identifier.
[0050] For example, the service interface module receives the user identification transmitted externally and transmits the user identification to the data conversion module. The user identification can be imported through an attachment or input manually, wherein the user identification corresponds to the user information. After receiving the user identification, the data conversion module converts the user identification into an internal identification and saves the corresponding relationship between the user identification and the internal identification in the cache, which includes the business cache, the system cache and the database cache.
[0051] Since the correspondence between user IDs and internal IDs is mostly stored in the business cache, when it is necessary to obtain user information, the system needs to search the business cache to see whether the user ID corresponding to the input internal ID exists. For example, when it is necessary to obtain certain user information, the user enters the corresponding internal ID into the user management system to search the business cache to see whether the user ID corresponding to the input internal ID exists. If the user ID corresponding to the input internal ID does not exist in the business cache, then the search is performed in the system cache; further, if the user ID corresponding to the input internal ID is not found in the system cache, then the search is continued in the database cache.
[0052] Furthermore, if a user identifier corresponding to the input internal identifier is found in any search process, the corresponding user information is obtained according to the search result, and the user information includes the user's name, mobile phone number, which groups the user belongs to, etc. According to the user management method of the embodiment of the present application, by converting the user identifier into an internal identifier and storing the corresponding relationship, the demand for database storage space is greatly reduced; the corresponding user information is obtained by hierarchical search in the cache, which improves management efficiency and greatly reduces database operations.
[0053] In some embodiments of the present application, converting the user identifier into an internal identifier includes: generating a bit array according to the data amount of the user identifier; converting the user identifier into an internal identifier; and storing the internal identifier in the bit array.
[0054] like Figure 2 As shown, step S200: converting the user identifier into an internal identifier includes but is not limited to the following steps:
[0055] Step S210: Generate a bit array according to the data amount of the user identification;
[0056] Step S220: converting the user ID into an internal ID;
[0057] Step S230: Store the internal identifier in a bit array.
[0058] After receiving the user identifier, the data conversion module generates a bit array according to the amount of user identifier data, then converts the user identifier into an internal identifier, and finally stores the converted internal identifier in the bit data. For example, assuming that the amount of user identifier data to be processed is SIZE, a long integer array with a length of SIZE / 64+1 is generated as a bit array according to the data amount. The user identifier is converted into an internal identifier, and the internal identifier corresponding to each user identifier occupies one bit of the bit array. If the converted internal identifier belongs to the bit array, the converted internal identifier bit is set to 1 on the bit array; if it does not belong to the bit array, it is set to 0. After all settings are completed, the bit array is stored in the cache. By setting the bit array, the demand for database storage can be reduced, and the grouped import and export of user data can be quickly realized when the data volume is large.
[0059] In some embodiments of the present application, the cache is searched according to the internal identifier to obtain a search result, including: searching in the business cache according to the internal identifier to obtain a first search result; searching in the system cache according to the first search result to obtain a second search result; searching in the database cache according to the second search result to obtain a third search result; wherein user information is obtained according to the first search result, the second search result, and the third search result.
[0060] like Figure 3 As shown, step S300: searching the cache according to the internal identifier to obtain a search result, including but not limited to the following steps:
[0061] Step S310: searching in the service cache according to the internal identifier to obtain a first search result;
[0062] Step S320: searching in the system cache according to the first search result to obtain a second search result;
[0063] Step S330: Search in the database cache according to the second search result to obtain a third search result.
[0064] The user information is obtained according to the first search result, the second search result and the third search result.
[0065] When you need to find user information, first enter the internal ID. The system searches in the cache based on the correspondence between the internal ID and the user ID. Since most data is stored in the business cache, the search is first performed in the business cache.
[0066] A search is performed in the business cache according to the internal identifier to obtain a first search result. If the first search result is found, the corresponding user information is obtained according to the first search result; if the first search result is not found, the first search result is output as not found.
[0067] When the first search result is not found, a search is performed in the system cache. If found, the corresponding user information is obtained based on the second search result. If not found, the second search result is output as not found. When the first search result is found, the search in the system cache is stopped and the second search result is output as found.
[0068] When the second search result is not found, the database cache is searched. If found, the corresponding user information is obtained according to the third search result. If not found, the third search result is output as not found. When the second search result is found, the search in the database cache is stopped and the third result is output as found. The three-level search can improve management efficiency and reduce database operations when querying user information.
[0069] In some embodiments of the present application, searching the cache according to the internal identifier to obtain the search result also includes: customizing the query conditions; searching in the business cache, system cache, and database cache according to the query conditions to obtain the search result; and obtaining the storage location of the user identifier according to the search result.
[0070] like Figure 4 As shown, step S300: searching the cache according to the internal identifier to obtain a search result, including but not limited to the following steps:
[0071] Step S340: Customize query conditions;
[0072] Step S350: searching in the business cache, system cache, and database cache according to the query conditions to obtain the search results;
[0073] Step S360: Obtain the storage location of the user identifier according to the search result.
[0074] In some embodiments, in addition to using internal identifiers to search the cache, the user can also customize the query conditions. The customized query conditions include grammatical keywords and can support complex query conditions. Syntactic keywords include AND, OR, exclamation marks, brackets, spaces, etc. When the grammatical keyword is AND, the search result satisfies two or more customized conditions at the same time; when the grammatical keyword is OR, the search result satisfies at least one of the customized query conditions; when the grammatical keyword is brackets, the search result preferentially satisfies the conditions in the brackets. After obtaining the search results, the storage location of the user identifier and the user information are obtained according to the search results. It can be understood that other grammatical keywords can also be set according to needs. By customizing the query conditions, complex query conditions can be supported to meet the query needs of users.
[0075] In some embodiments of the present application, it also includes: importing a user identifier through an attachment; performing group conversion processing on the user identifier to generate an internal identifier, and obtaining a group conversion result; uploading the group conversion result to a management platform; wherein the group conversion result includes the correspondence between the user identifier and the internal identifier, and the group position of the internal identifier.
[0076] like Figure 5 As shown, the user management method according to the embodiment of the present application also includes:
[0077] Step S500: importing the user ID through the attachment;
[0078] Step S600: performing group conversion processing on the user identifier to generate an internal identifier, and obtaining a group conversion result;
[0079] Step S700: Upload the group conversion result to the management platform.
[0080] In some embodiments, the user uploads an attachment through the management platform, imports the user ID into the data module, performs group conversion processing on the user ID to generate an internal ID, thereby obtaining a grouping result, that is, a different bit array, and writes the bit array into the cache. After the group conversion is completed, the system uploads the import result to the management platform, and when the user queries the information, the user information can be obtained through the management platform.
[0081] In some embodiments of the present application, the internal identifier is also written into a persistent device according to the result of the group conversion. For example, after the user identifier is converted into an internal identifier, the internal identifier is saved into a storage device that can be permanently saved, such as a disk, or the internal identifier is stored in a database or in a data file, thereby realizing the persistent storage of the internal identifier. By writing the internal identifier into a persistent device, it can be ensured that data will not be lost, which facilitates the user to query user information.
[0082] The embodiment of the present application also provides a user management system, including: a service interface module, a data conversion module and a data cache module. The service interface module is used to receive and search for user identification; the data conversion module is connected to the service interface module for converting the user identification into an internal identification; the data cache module is connected to the data conversion module for storing the corresponding relationship between the user identification and the internal identification in a cache; wherein the cache includes a business cache, a system cache, and a database cache.
[0083] For example, Figure 6 As shown, the service interface module 100 provides a unified entry for calling all services. The service interface module 100 can realize the import and export of user identification, and can also realize the query function. For example, input the internal identification, because the user management system stores the corresponding relationship between the user identification and the internal identification, the system will query the corresponding user identification according to the internal identification, and then obtain the required user information, wherein the user information includes the user name, mobile phone number, etc.
[0084] The data conversion module 200 is in communication with the service interface module 100 and is used to realize the conversion between the user identification and the internal identification. The user identification is usually a non-numeric string or a mobile phone number. When the mobile phone number is used as the user identification, a large amount of storage space is often consumed. Therefore, the data conversion module 200 generates a corresponding bit array according to the amount of data to be stored, converts the user identification into an internal identification and stores it in the bit array, and stores the bit array in the cache module for storage.
[0085] The data cache module 300 is connected to the data conversion module 200. In order to speed up the conversion speed between the user ID and the internal ID, the system stores the corresponding relationship between the user ID and the internal ID in the cache, wherein the cache includes the business cache, the system cache, and the database cache. When the user queries the user message through the user management system, the business cache is searched first. If it does not exist, the system cache is searched. If it still does not exist, the database is searched. Through the three-level query, instead of searching directly in the database, the database operation is reduced, thereby improving the management efficiency.
[0086] According to the user management system of the embodiment of the present application, the service interface module is used to receive and search for user representations, and the data conversion module is used to convert the user identifier into an internal identifier, and the corresponding relationship is stored, which greatly reduces the demand for database storage space; the correspondence between the user identifier and the internal identifier is stored through the data cache module, and the corresponding user information is obtained by searching in the cache, which improves management efficiency and greatly reduces database operations.
[0087] In some embodiments of the present application, the service interface module is also used to perform call operations, including import, export, and management. For example, the service interface module can realize the import, export, and management functions of user identification. The user uploads the user identification in the attachment through the service interface module, imports it into the data conversion module, and then uploads the imported result to the management platform. The user can manage the user information through the service interface module.
[0088] In some embodiments of the present application, it further includes: a persistent storage module. The persistent storage module is in communication with the data cache module and is used to permanently store the internal identifier. Figure 7 As shown, the persistent storage module 400 is in communication connection with the data cache module 300, and writes the internal identifier into the persistent device in a grouped manner to achieve permanent storage of data.
[0089] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to execute the user management method of any one of the above embodiments of the present application.
[0090] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0091] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the purpose of the present application. In addition, the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
Claims
1. A user management method, characterized in that: include: receiving a user identification; A bit array is generated according to the data volume of the user identifier, the user identifier is converted into an internal identifier, the internal identifier is stored in the bit array, the user identifier is converted into an internal identifier, and each internal identifier corresponding to the user identifier occupies a bit of the bit array; if the converted internal identifier belongs to the bit array, the converted internal identifier bit is set to 1 on the bit array, and if the internal identifier does not belong to the bit array, the converted internal identifier bit is set to 0 on the bit array; wherein the bit array is stored in a cache; the cache includes a business cache, a system cache, and a database cache, and the cache pre-stores a correspondence between the user identifier and the internal identifier; Searching in the business cache according to the internal identifier to obtain a first search result; searching in the system cache according to the first search result to obtain a second search result; searching in the database cache according to the second search result to obtain a third search result; Corresponding user information is obtained according to the first search result, the second search result, and the third search result.
2. The user management method according to claim 1, characterized in that: The step of searching the cache according to the internal identifier to obtain a search result further includes: Customize query conditions; Searching in the business cache, the system cache, and the database cache according to the query condition to obtain the search result; The storage location of the user identifier is obtained according to the search result.
3. The user management method according to claim 2, characterized in that: Also includes: Importing the user ID via an attachment; Performing group conversion processing on the user identifier to generate the internal identifier, and obtaining a group conversion result; Uploading the group conversion result to the management platform; The group conversion result includes the corresponding relationship between the user identifier and the internal identifier, and the group position of the internal identifier.
4. The user management method according to claim 3, characterized in that: Also includes: According to the result of the group conversion, the internal identifier is written into a persistent device.
5. User management system, characterized in that, include: A service interface module, used to receive and search for user identification; a data conversion module, which is in communication connection with the service interface module, and is used to generate a bit array according to the data volume of the user identifier, convert the user identifier into an internal identifier, store the internal identifier in the bit array, convert the user identifier into an internal identifier, and each internal identifier corresponding to the user identifier occupies a bit of the bit array; if the converted internal identifier belongs to the bit array, the converted internal identifier bit is set to 1 on the bit array, and if the internal identifier does not belong to the bit array, the converted internal identifier bit is set to 0 on the bit array; wherein the bit array is stored in a cache; the cache includes a business cache, a system cache, and a database cache, and the cache pre-stores a correspondence between the user identifier and the internal identifier; the searching of the user identifier specifically includes: searching in the business cache according to the internal identifier to obtain a first search result; searching in the system cache according to the first search result to obtain a second search result; searching in the database cache according to the second search result to obtain a third search result; obtaining corresponding user information according to the first search result, the second search result, and the third search result; The data cache module is in communication with the data conversion module and is used to store the corresponding relationship between the user identifier and the internal identifier in a cache.
6. The user management system according to claim 5, characterized in that: The service interface module is also used to execute calling operations, which include importing, exporting, and managing.
7. The user management system according to claim 5, characterized in that: Also includes: The persistent storage module is connected to the data cache module for permanently storing the internal identifier.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the user management method according to any one of claims 1 to 4.
