User information processing method and device, electronic equipment and storage medium
By obtaining the user information query commands of the superior software, determining the target tenant and user types, the accurate query strategy queries on multiple storage ends, solving the problem of user information confusion in multi-tenant scenarios, improving query accuracy and efficiency, and realizing the security and management efficiency of user data.
Patent Information
- Application Number
- CN202510476532.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-07-18
AI Technical Summary
In the multi-tenant scenario, the existing technology cannot realize the isolation management of local users by tenant, resulting in confusion of user information of different tenants, resulting in insecure security and management efficiency of user data.
By obtaining the user information query command issued by the superior software, determine the target tenant and user type to which the user to be queried, accurately determine the target information query strategy based on the target tenant and user type, and query it on multiple user information storage ends.
It improves the accuracy and efficiency of user information query, solves the problems of inefficient security and management caused by user information confusion among different tenants, and realizes user isolation management under tenants.
Smart Images

Figure CN120336390A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a user information processing method, apparatus, electronic device, and storage medium. Background Art
[0002] Currently, the user management of storage systems highly depends on the system layer. Whether it is the addition, deletion, or query operation of users, it is all achieved by relying on the user management service provided by the system layer, and the interaction with the domain also depends on the system configuration file.
[0003] However, in a multi-tenant scenario, the system layer cannot isolate and manage local users by tenant, and it is also difficult to meet the need for each tenant to independently join the domain. The user information of different tenants is prone to confusion, resulting in low security and management efficiency of user data. Summary of the Invention
[0004] This application provides a user information processing method, apparatus, electronic device, and storage medium, so as to at least solve the problem in related technologies that the user information of different tenants is prone to confusion, resulting in low security and management efficiency of user data.
[0005] This application provides a user information processing method, including:
[0006] Obtain a user information query command sent by a superior software;
[0007] Determine the target tenant and user type to which the user to be queried belongs according to the user information query command;
[0008] Determine the target information query strategy of the user information query command according to the target tenant and user type;
[0009] Based on the target information query strategy, query user information on multiple user information storage ends to obtain the information query result of the user to be queried.
[0010] This application also provides a user information processing apparatus, including:
[0011] An obtaining module, configured to obtain a user information query command sent by a superior software;
[0012] A first determination module, configured to determine the target tenant and user type to which the user to be queried belongs according to the user information query command;
[0013] A second determination module, configured to determine the target information query strategy of the user information query command according to the target tenant and user type;
[0014] A query module, configured to query user information at multiple user information storage ends based on the target information query policy, so as to obtain the information query result of the user to be queried.
[0015] This application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above user information processing methods when executing the computer program.
[0016] This application also provides a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program implements the steps of any of the above user information processing methods when executed by a processor.
[0017] This application also provides a computer program product, including a computer program, and the computer program implements the steps of any of the above user information processing methods when executed by a processor.
[0018] Through this application, after obtaining a user information query command issued by a superior software such as a management software, the target tenant and user type to which the user to be queried belongs are determined according to the command, and then the target information query policy is accurately determined based on the target tenant and user type, and then queries are performed at multiple user information storage ends based on this policy. Therefore, it is possible to solve the problem that user information of different tenants is prone to confusion in the related art, resulting in low security and management efficiency of user data, and achieve the technical effect of improving the accuracy and efficiency of user information query. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of this application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of this application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0020] Figure 1 It is a schematic structural diagram of a user information processing system based on the embodiments of this application;
[0021] Figure 2 It is a schematic flowchart of a user information processing method provided by the embodiments of this application;
[0022] Figure 3 It is a schematic flowchart of an exemplary user information processing method provided by the embodiments of this application;
[0023] Figure 4 It is a schematic flowchart of the operation of a network domain user information query sub-module provided by the embodiments of this application;
[0024] Figure 5Schematic structural diagram of an exemplary user information processing system provided by an embodiment of the present application;
[0025] Figure 6 Schematic structural diagram of a user information processing device provided by an embodiment of the present application;
[0026] Figure 7 Schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0027] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0028] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0029] In the related art, user management on the storage system depends on the system level. For example, for adding, deleting, and querying users, the user management services provided by the OS system are used. At the same time, the interaction with the domain also depends on the system configuration file. Under this method, limited by the system, it is impossible to achieve the requirements of isolated management of local users distinguishing tenants and each tenant being able to join the domain in a multi-tenant scenario.
[0030] To solve the above technical problems, embodiments of the present application provide a user information processing method, apparatus, electronic device, and storage medium. The method includes: obtaining a user information query command sent by a superior software; determining a target tenant and user type to which the user to be queried belongs according to the user information query command; determining a target information query strategy for the user information query command according to the target tenant and user type; and querying user information on multiple user information storage ends based on the target information query strategy to obtain an information query result of the user to be queried. In the method provided by the above solution, after obtaining a user information query command sent by a superior software such as a management software, the target tenant and user type to which the user to be queried belongs are clarified according to the command, and then the target information query strategy is accurately determined based on the target tenant and user type, and then the query is performed on multiple user information storage ends based on this strategy. Therefore, the problem that user information of different tenants is prone to confusion in the related art, resulting in low security and management efficiency of user data, can be solved, and the technical effect of improving the accuracy and efficiency of user information query can be achieved.
[0031] To enable those skilled in the art of this technology to better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the user information processing method depends, the specific application environment architecture or specific hardware architecture will be described herein.
[0033] First, the structure of the user information processing system on which the present application is based will be described:
[0034] The user information processing method, apparatus, electronic device, and storage medium provided by the embodiments of the present application are applicable to querying user information in a multi-tenant scenario of a distributed storage system. As Figure 1 shown, it is a schematic structural diagram of the user information processing system based on the embodiments of the present application, mainly including a superior software, a user information processing device, and multiple user information storage ends. The superior software is used to send a user information query command to the user information processing device, and the user information processing device responds to the user information query command in a tenant isolation manner and queries user information on multiple user information storage ends.
[0035] The embodiments of the present application provide a user information processing method for querying user information in a multi-tenant scenario of a distributed storage system. The execution subject of the embodiments of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer, and other electronic devices that can be used to query user information in a multi-tenant scenario of a distributed storage system.
[0036] As Figure 2As shown in the figure, it is a schematic flowchart of the user information processing method provided by an embodiment of the present application. The method includes:
[0037] Step 201, obtain a user information query command sent by the superior software.
[0038] Specifically, the superior software includes a management software. When the superior software needs to perform operations such as querying tenants and / or allocating Quality of Service (QoS) quotas, verifying user validity, or counting user information in a distributed storage system, it sends corresponding user information query commands.
[0039] Step 202, determine the target tenant and user type to which the user to be queried belongs according to the user information query command.
[0040] Among them, the user type can be set according to business requirements and is at least divided into two types: local users and domain users. Local users can be further detailed into local windows users and local linux users, and domain users can be further detailed into Lightweight Directory Access Protocol (LDAP) domain users, Network Information Service (NIS) domain users, Active Directory (AD) domain users, etc.
[0041] Specifically, by parsing the user information query command, identifiers related to the tenant and user type can be extracted from the user information query command to determine the target tenant and user type to which the user to be queried belongs.
[0042] Specifically, in one embodiment, the user information query command can be parsed to obtain the parsing result of the user information query command; according to the parsing result, the target tenant and user type to which the user to be queried belongs are determined.
[0043] Among them, the parsing result at least includes query identifier information. The query identifier information includes the name of the user to be queried, the target tenant and user type to which the user to be queried belongs, and the query identifier information is the identifier related to the tenant and user type.
[0044] It should be noted that a tenant is an independent organizational unit in a distributed storage system. Different tenants may have different resource allocations, permission settings, and management policies. For example, in a distributed storage system of an enterprise, different departments may be divided into different tenants, and each tenant has its own independent storage resources and user management system. By clarifying the target tenant, queries can be performed in the relevant information storage area of the tenant to avoid confusion with the information of other tenants.
[0045] Step 203: Determine the target information query strategy for the user information query command according to the target tenant and user type.
[0046] It should be noted that different target tenants and user types require different query strategies. For example, for local users, the query should be preferentially conducted from the local user information database; while for domain users, the query strategy should be selected according to the specific domain type (such as LDAP domain, NIS domain, AD domain), and the user information query should be preferentially conducted from the corresponding network domain server.
[0047] Among them, the target information query strategy at least includes the query scope and query order.
[0048] Step 204: Based on the target information query strategy, conduct user information query on multiple user information storage ends to obtain the information query result of the user to be queried.
[0049] Among them, the user information storage ends include the local user information database and multiple network domain servers.
[0050] Specifically, based on the target information query strategy determined in advance and applicable to the user to be queried, conduct user information query on user information storage ends such as the local user information database and multiple network domain servers to obtain the information query result of the user to be queried. Among them, the information query result at least includes the user ID (user unique identifier) and user group ID (user group unique identifier) of the user to be queried.
[0051] Furthermore, after obtaining the user ID and user group ID of the user to be queried, the user name can be obtained in batches by specifying the user IDs of multiple users under the specified tenant; the group name can be obtained in batches by specifying the user group IDs of multiple users under the specified tenant; it is also possible to query whether the user name exists under the specified domain of the specified tenant, query whether the user group name exists under the specified domain of the specified tenant, query the user group to which the user with the user ID belongs under the specified tenant, query the user name of the user with the user ID under the specified tenant, and query the user group name of the user group with the user group ID under the specified tenant.
[0052] Based on the above embodiments, as an implementable manner, in one embodiment, determining the target information query strategy for the user information query command according to the target tenant and user type includes:
[0053] Step 2031: Determine the target query order according to the target tenant;
[0054] Step 2032: Determine the target query scope according to the user type;
[0055] Step 2033: Determine the target information query strategy for the user information query command according to the target query order and target query scope.
[0056] Specifically, different tenants have different storage and access patterns for user information. Therefore, a specific query order needs to be set for each tenant. In practical applications, the query order information of the tenant can be stored in the user information query order table in the database. For example, the query order of tenant tenant1 is "local-LDAP-NIS-AD", which means that when querying user information under tenant tenant1, it will first look for it in the local user information database. If no matching information is found, it will then query the LDAP domain server, NIS domain server, and AD domain server in sequence. Such a query order setting can optimize the query path and improve the query efficiency according to the business characteristics and usage habits of the tenant. Among them, if the query order information of a certain tenant is not recorded in the user information query order table, the default order is adopted. The default order and the user information query order table can be configured in the upper-level software.
[0057] Among them, the user type determines the data source range that should be covered when querying user information, that is, different user types correspond to different query ranges. The following Table 1 shows the query ranges corresponding to each user type:
[0058] Table 1
[0059] User type Query range local locallinux + localwindows localwindows localwindows locallinux locallinux windows localwindows + AD linux locallinux + LDAP + NIS LDAP LDAP NIS NIS AD AD ALL locallinux + localwindows + LDAP + NIS + AD
[0060] Specifically, the intersection can be taken between the query order and the query range to obtain the information query strategy. For example, to query the user information of the "LDAP" type in tenant tenant2, according to the query order of tenant2 (such as "LDAP-local-NIS") and the query range of "linux" type users ("locallinux+LDAP+NIS"), the target information query strategy is: first query the user information in the LDAP domain server. If not found, then query in the local user information database and the NIS domain server in sequence, realizing accurate and efficient user information query.
[0061] Based on the above embodiments, as an implementable manner, in one embodiment, the method further includes:
[0062] Step 301, while feeding back the information query result of the user to be queried to the upper-level software, generate an information key-value pair according to the information query result of the user to be queried;
[0063] Step 302, use the composite key in the information key-value pair as the cache index, and cache the information query result in the local cache area.
[0064] Among them, the composite key includes the name of the user to be queried, the target tenant to which the user to be queried belongs, and the user type.
[0065] Specifically, when caching the user information query result in the local cache area, the cache index needs to include tenant information, user name, and user type. For example, for the cache map<key,value>, the key is tenant - user name - user type, and the value is the information query result such as the user ID and user group ID of the user. The composition form of the composite key key realizes the uniqueness of user information under different tenants in the cache.
[0066] Further, in an embodiment, before querying user information on multiple user information storage ends based on the target information query policy to obtain the information query result of the user to be queried, it can be determined whether the information query result of the user to be queried exists in the local cache area; in the case where the information query result of the user to be queried exists in the local cache area, the information query result of the user to be queried is read from the local cache area; in the case where the information query result of the user to be queried does not exist in the local cache area, the step of querying user information on multiple user information storage ends based on the target information query policy to obtain the information query result of the user to be queried is executed.
[0067] It should be noted that in the case where the timeliness requirement of the user information query result by the superior software is general, such as when the user information query is performed this time for some information statistics and display, in order to improve the information query efficiency, in the case where the information query result of the user to be queried exists in the local cache area, the information query result of the user to be queried is directly read from the local cache area.
[0068] Further, in an embodiment, a monitoring linked list can also be configured for the local cache area; when writing the information query result corresponding to any cache index into the local cache area, a node corresponding to the cache index is added to the head of the monitoring linked list; based on the cache value of the information query result corresponding to each cache index represented by the monitoring linked list, the cache space of the local cache area is released.
[0069] Among them, the monitoring linked list is a data structure used to track the status and usage of cached data in the local cache area, used to associate the information query result corresponding to each cache index in the local cache area in the form of nodes, and each node contains meta - information related to the cache index, such as the addition time, usage time, etc., to represent the cache value of the information query result corresponding to each cache index.
[0070] Specifically, in one embodiment, the tail node of the monitoring linked list can be detected according to a preset monitoring period, and it is determined whether the addition time of the tail node exceeds a preset addition time threshold; in the case where the addition time of the tail node exceeds the preset addition time threshold, it is determined whether the usage time of the tail node exceeds a preset usage time threshold; in the case where the usage time of the tail node exceeds the preset usage time threshold, the tail node is removed from the monitoring linked list, and the information query result corresponding to the tail node is deleted from the local buffer to release the buffer space of the local buffer.
[0071] Among them, the cache value includes the addition time and the usage time of the node. The addition time of the node is used to represent the caching duration of the information query result corresponding to the node in the local buffer, and the usage time of the node is used to represent the access frequency of the information query result corresponding to the node in the local buffer. When the upper-layer software accesses the information query result cached in the local buffer map through the interface, it is necessary to determine whether this cache is the tail node of the linked list. If so, the usage time of the tail node is updated.
[0072] Specifically, based on the timer thread, the tail node of the monitoring linked list can be detected according to a preset monitoring period (every 1 second). First, it is determined whether the usage time of the tail node is 0. If it is 0, it means that the tail node is also the head node, and the usage time of the tail node is updated to the current time.
[0073] Specifically, it can be determined whether the addition time of the tail node exceeds a preset addition time threshold. The preset addition time threshold is used to measure whether the caching time of the cached data in the local buffer is long enough. For example, the preset addition time threshold can be set to 600 seconds. If the addition time of the tail node exceeds this threshold, it means that the information query result corresponding to this node has been cached in the buffer for a long time and may no longer be needed. Therefore, it is necessary to further determine its usage time. In the case where the addition time of the tail node exceeds the preset addition time threshold, it is continued to determine whether the usage time of the tail node exceeds a preset usage time threshold. The preset usage time threshold is used to measure whether the access frequency of the cached data is low enough. For example, the preset usage time threshold can be set to 10 seconds. If the usage time of the tail node also exceeds this threshold, it means that the cached data not only has been cached for a long time but also has not been accessed recently, and its cache value is low. Therefore, the tail node can be removed from the monitoring linked list, and the information query result corresponding to the tail node is deleted from the local buffer to release the buffer space of the local buffer for subsequent caching of new information query results.
[0074] Correspondingly, in one embodiment, when the usage time of the tail node does not exceed the preset usage time threshold, it is determined whether the user to be queried corresponding to the tail node is an invalid user; when the user to be queried corresponding to the tail node is an invalid user, the step of removing the tail node from the monitoring linked list and deleting the information query result corresponding to the tail node in the local buffer to release the buffer space of the local buffer is executed.
[0075] Among them, an invalid user refers to a user who no longer has valid permissions or has been deleted in the system.
[0076] Specifically, the corresponding query interface can be called to interact with the user information storage end to verify the validity of the user to be queried. If it is determined that the user to be queried corresponding to the tail node is an invalid user, it can be determined that the cached data corresponding to this node has lost its value, so the corresponding cleanup operation is executed.
[0077] Correspondingly, in one embodiment, when the user to be queried corresponding to the tail node is a valid user, the tail node is re-added to the head of the monitoring linked list as the node to be moved, and the addition time is updated to the current time.
[0078] Specifically, if the usage time of the tail node does not exceed the preset usage time threshold and the user to be queried corresponding to it is a valid user, it can be determined that the information query result corresponding to this tail node is periodically accessed data, that is, the information query result corresponding to this tail node is more likely to be accessed again in the future. Although the cached data (information query result) corresponding to this tail node has been stored for a long time, since there has been an access recently and the user is valid, it indicates that it still has certain usage value. Therefore, it is moved to the head of the linked list to mark it as the most recently used cached data, making it less likely to be cleared in subsequent cache space release operations, thereby improving the cache hit rate.
[0079] Based on the above embodiments, as an implementable method, in one embodiment, based on the target information query strategy, user information is queried from multiple user information storage ends to obtain the information query result of the user to be queried, including:
[0080] Step 2041, based on the target query range characterized by the target information query strategy, at least one target user information storage end to be queried is screened from multiple user information storage ends;
[0081] Step 2042, based on the target query order characterized by the target information query strategy, user information is sequentially queried from the target user information storage ends to obtain the information query result of the user to be queried.
[0082] Among them, the user information storage end at least includes a local user information database and multiple network domain servers.
[0083] It should be noted that, in the case where the upper-level software has relatively high requirements for the timeliness of the query result of user information, for example, when the user information query is performed this time for system configuration, resource allocation, etc., the method of directly querying from the user information storage end is adopted to determine the query result of the user information to be queried.
[0084] Specifically, in one embodiment, the access interface of the target user information storage end is called; through the access interface of the target user information storage end, the target user information storage end is accessed to query user information from the target user information storage end.
[0085] Exemplarily, as Figure 3 shown, it is a schematic flowchart of an exemplary user information processing method provided by an embodiment of the present application. First, when the query result of the user information to be queried is stored in the local buffer, the query result of the user information to be queried is read from the local buffer and the query result is returned. When the query in the local buffer fails, it is judged whether the query sequence information of the target tenant is recorded in the user information query sequence table. If so, the intersection of the interface parameter (target query range) and the target query sequence is used to determine the target information query strategy; if not, the intersection of the default sequence and the target query sequence is used to determine the target information query strategy. When the target user information storage end is the local user information database, the local user information query sub-module interface is called, and the local user information database is queried for user information through the local user information query sub-module interface. When the target user information storage end is an LDAP domain server, the LDAP domain user information query sub-module interface is called, and the LDAP domain server is queried for user information through the LDAP domain user information query sub-module interface. When the target user information storage end is an NIS domain server, the NIS domain user information query sub-module interface is called, and the NIS domain server is queried for user information through the NIS domain user information query sub-module interface. When the target user information storage end is an AD domain server, the AD domain user information query sub-module interface is called, and the AD domain server is queried for user information through the AD domain user information query sub-module interface. Among them, the access interface of the target user information storage end includes the local user information query sub-module interface, the LDAP domain user information query sub-module interface, the NIS domain user information query sub-module interface, and the AD domain user information query sub-module interface.
[0086] Specifically, in one embodiment, when the target user information storage end includes any network domain server, the corresponding target network user information query module may be called through the access interface of the target user information storage end; the target network user information query module determines whether the domain information of the target tenant is cached in the domain information cache by traversing the domain information cache; if the domain information of the target tenant is cached in the domain information cache, it is determined that the target tenant has joined the target network domain corresponding to the target network user information query module; the system query interface of the target network domain is called to access the target network domain server through the system query interface and query user information on the target network domain server.
[0087] Specifically, as Figure 4 shown, it is a schematic diagram of the operation process of the network domain user information query sub-module provided by the embodiment of the present application. The upper-level software such as the management software is responsible for saving the tenant and the corresponding network domain information into the database after the tenant joins a certain network domain. After receiving the information saved by the management software, the database notifies the corresponding network domain user information query sub-module to update the domain information cache to ensure that the cached data in the domain information cache can timely reflect the latest information in the database. When the network domain user information query sub-module queries user information on the network domain server through an external call request, it first queries in the domain information cache whether there is domain information of the corresponding target tenant. If the domain information of the target tenant is cached in the domain information cache, it is determined that the target tenant has joined the target network domain corresponding to the target network user information query module. Then, by obtaining the domain information of the tenant and constructing corresponding parameters, the domain interaction function (the system query interface of the target network domain) is called to query user information, and finally the query result is returned to the upper-level call. If there is no domain information of the corresponding tenant in the cache, a failure is returned to the upper-level call to indicate that the target tenant has not joined the target network domain.
[0088] Exemplarily, as Figure 5As shown in the figure, it is a schematic structural diagram of an exemplary user information processing system provided by an embodiment of the present application. The system includes a user management module and a local user information database. The local user information database is used to store local user information in different tenants, provide a user information query function for the upper layer, and the management key can perform addition, deletion, modification, and query of local users on the local user information database. The user management module includes: a user information query sub-module, which is used to provide a user information query interface externally and call the query interfaces of other sub-modules internally to implement user information caching and cache updating, and control the order of calling other sub-modules; a local user information query sub-module, which is used to provide a local user information query interface for the user information query sub-module, interact with the local user information database, query user information, and pass it to the upper layer; an LDAP domain information query sub-module, which is used to save the LDAP domain user information cache and implement an interface for interacting with the LDAP domain; an NIS domain information query sub-module, which is used to save the NIS domain user information cache and implement an interface for interacting with the NIS domain; an AD domain information query sub-module, which is used to save the AD domain user information cache and implement an interface for interacting with the AD domain. Among them, the method provided by the embodiment of the present application is mainly applied to the user information query sub-module.
[0089] The user information processing method provided by the embodiment of the present application includes obtaining a user information query command sent by a superior software; determining the target tenant and user type to which the user to be queried belongs according to the user information query command; determining the target information query strategy of the user information query command according to the target tenant and user type; and querying user information on multiple user information storage ends based on the target information query strategy to obtain the information query result of the user to be queried. In the method provided by the above solution, after obtaining a user information query command sent by a superior software such as a management software, the target tenant and user type to which the user to be queried belongs are determined according to the command, and then the target information query strategy is accurately determined based on the target tenant and user type, and then the query is performed on multiple user information storage ends based on this strategy. Therefore, it can solve the problem that the user information of different tenants is prone to confusion in the related art, resulting in low security and management efficiency of user data, and achieve the technical effect of improving the accuracy and efficiency of user information query. Moreover, it solves the local demand for distinguishing the local user management and domain user management of tenants in a multi-tenant scenario, fundamentally getting rid of the dependence on the OS system layer for user management and domain control management, giving the user the maximum management authority, realizing user isolation under the tenant, and providing technical support for resource isolation among multiple tenants in a distributed storage system.
[0090] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0091] An embodiment of the present application further provides a user information processing device for executing the user information processing method provided in the above embodiment.
[0092] As Figure 6 shown, it is a schematic structural diagram of the user information processing device provided by the embodiment of the present application. The user information processing device 60 includes: an acquisition module 601, a first determination module 602, a second determination module 603, and a query module 604.
[0093] Among them, the acquisition module is used to acquire the user information query command issued by the superior software; the first determination module is used to determine the target tenant and user type to which the user to be queried belongs according to the user information query command; the second determination module is used to determine the target information query policy of the user information query command according to the target tenant and user type; the query module is used to query user information on multiple user information storage ends based on the target information query policy to obtain the information query result of the user to be queried.
[0094] Specifically, in one embodiment, the first determination module is specifically used for:
[0095] Parse the user information query command to obtain the parsing result of the user information query command;
[0096] Determine the target tenant and user type to which the user to be queried belongs according to the parsing result;
[0097] Among them, the parsing result at least includes query identification information, and the query identification information includes the name of the user to be queried, the target tenant to which the user to be queried belongs, and the user type.
[0098] Specifically, in one embodiment, the second determination module is specifically used for:
[0099] Determine the target query order according to the target tenant;
[0100] Determine the target query range according to the user type;
[0101] Determine the target information query policy of the user information query command according to the target query order and the target query range.
[0102] Specifically, in one embodiment, the device further includes:
[0103] A cache module, which is used to feedback the information query result of the user to be queried to the superior software, and at the same time, generate an information key-value pair according to the information query result of the user to be queried; use the composite key in the information key-value pair as the cache index, and cache the information query result into the local cache area;
[0104] Among them, the composite key includes the name of the user to be queried, the target tenant to which the user to be queried belongs, and the user type.
[0105] Specifically, in one embodiment, the query module is further configured to:
[0106] Before querying user information on multiple user information storage ends based on the target information query policy to obtain the information query result of the user to be queried, determine whether the information query result of the user to be queried is stored in the local buffer;
[0107] In the case where the information query result of the user to be queried is stored in the local buffer, read the information query result of the user to be queried from the local buffer;
[0108] In the case where the information query result of the user to be queried is not stored in the local buffer, execute the step of querying user information on multiple user information storage ends based on the target information query policy to obtain the information query result of the user to be queried.
[0109] Specifically, in one embodiment, the cache module is further configured to:
[0110] Configure a monitoring linked list for the local buffer;
[0111] When writing the information query result corresponding to any cache index into the local buffer, add the node corresponding to the cache index to the head of the monitoring linked list;
[0112] Release the cache space of the local buffer based on the cache value of the information query results corresponding to each cache index represented by the monitoring linked list.
[0113] Specifically, in one embodiment, the cache module is specifically configured to:
[0114] Detect the tail node of the monitoring linked list according to a preset monitoring period, and determine whether the addition time of the tail node exceeds the preset addition time threshold;
[0115] In the case where the addition time of the tail node exceeds the preset addition time threshold, determine whether the usage time of the tail node exceeds the preset usage time threshold;
[0116] In the case where the usage time of the tail node exceeds the preset usage time threshold, remove the tail node from the monitoring linked list and delete the information query result corresponding to the tail node in the local buffer to release the cache space of the local buffer;
[0117] Among them, the cache value includes the addition time and usage time of the node. The addition time of the node is used to represent the caching duration of the information query result corresponding to the node in the local buffer, and the usage time of the node is used to represent the access frequency of the information query result corresponding to the node in the local buffer.
[0118] Specifically, in one embodiment, the cache module is further configured to:
[0119] When the usage time of the tail node does not exceed a preset usage time threshold, determine whether the user to be queried corresponding to the tail node is an invalid user;
[0120] When the user to be queried corresponding to the tail node is an invalid user, execute the steps of removing the tail node from the monitoring linked list and deleting the information query result corresponding to the tail node in the local buffer to release the cache space of the local buffer.
[0121] Specifically, in one embodiment, the cache module is further configured to:
[0122] When the user to be queried corresponding to the tail node is a valid user, add the tail node as a node to be moved back to the head of the monitoring linked list and update the addition time to the current time.
[0123] Specifically, in one embodiment, the query module is specifically configured to:
[0124] Based on the target query range characterized by the target information query policy, filter at least one target user information storage end to be queried from multiple user information storage ends;
[0125] Based on the target query order characterized by the target information query policy, sequentially query user information from the target user information storage ends to obtain the information query result of the user to be queried;
[0126] Wherein, the user information storage end at least includes a local user information database and multiple network domain servers.
[0127] Specifically, in one embodiment, the query module is specifically configured to:
[0128] Call the access interface of the target user information storage end;
[0129] Through the access interface of the target user information storage end, access the target user information storage end to query user information from the target user information storage end.
[0130] Specifically, in one embodiment, the query module is specifically configured to:
[0131] When the target user information storage end includes any network domain server, call the corresponding target network user information query module through the access interface of the target user information storage end;
[0132] The target network user information query module determines whether the domain information of the target tenant is cached in the domain information cache by traversing the domain information cache;
[0133] If the domain information of the target tenant is cached in the domain information cache, it is determined that the target tenant has joined the target network domain corresponding to the target network user information query module;
[0134] Call the system query interface of the target network domain to access the target network domain server through the system query interface and query user information on the target network domain server.
[0135] For the description of the features in the embodiments corresponding to the user information processing device, reference can be made to the relevant descriptions in the embodiments corresponding to the user information processing method, which will not be elaborated here one by one.
[0136] An embodiment of the present application also provides an electronic device, as Figure 7 shown, is a schematic structural diagram of the electronic device provided by the embodiment of the present application, including a processor 10 and a memory 20. A computer program is stored in the memory 20, and the processor 10 is configured to run the computer program to execute the steps in any of the above embodiments of the user information processing method.
[0137] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above embodiments of the user information processing method when running.
[0138] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disk, magnetic disk or optical disc and other various media that can store computer programs.
[0139] An embodiment of the present application also provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the user information processing method.
[0140] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the user information processing method.
[0141] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner 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 to exceed the scope of this application.
[0142] The above has introduced in detail a user information processing method, apparatus, electronic device, and storage medium provided by this application. Specific examples are used herein to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for processing user information, characterized in that, Including: Obtain a user information query command sent by the superior software; Determine the target tenant and user type to which the user to be queried belongs according to the user information query command; Determine the target information query strategy of the user information query command according to the target tenant and user type; Based on the target information query strategy, query user information on multiple user information storage ends to obtain the information query result of the user to be queried.
2. The user information processing method according to claim 1, wherein The determining the target tenant and user type to which the user to be queried belongs according to the user information query command includes: Parse the user information query command to obtain the parsing result of the user information query command; Determine the target tenant and user type to which the user to be queried belongs according to the parsing result; Wherein, the parsing result at least includes query identification information, and the query identification information includes the name of the user to be queried, the target tenant and user type to which the user to be queried belongs.
3. The user information processing method according to claim 1, wherein The determining the target information query strategy of the user information query command according to the target tenant and user type includes: Determine the target query order according to the target tenant; Determine the target query range according to the user type; Determine the target information query strategy of the user information query command according to the target query order and the target query range.
4. The user information processing method according to claim 1, wherein The method further includes: While feeding back the information query result of the user to be queried to the superior software, generate an information key-value pair according to the information query result of the user to be queried; Use the composite key in the information key-value pair as a cache index, and cache the information query result into the local cache area; Wherein, the composite key includes the name of the user to be queried, the target tenant and user type to which the user to be queried belongs.
5. The user information processing method according to claim 4, wherein Before querying user information on multiple user information storage ends based on the target information query strategy to obtain the information query result of the user to be queried, the method further includes: Judge whether the local cache area stores the information query result of the user to be queried; If the local cache area stores the information query result of the user to be queried, read the information query result of the user to be queried from the local cache area; If the local cache area does not store the information query result of the user to be queried, execute the step of querying user information on multiple user information storage ends based on the target information query strategy to obtain the information query result of the user to be queried.
6. The user information processing method according to claim 4, wherein The method further includes: Configure a monitoring linked list for the local cache area; When the information query result corresponding to any cache index is written into the local cache area, add the node corresponding to the cache index to the head of the monitoring linked list; Release the cache space of the local cache area based on the cache value of the information query result corresponding to each cache index represented by the monitoring linked list.
7. The user information processing method according to claim 6, wherein The releasing the cache space of the local cache area based on the cache value of the information query result corresponding to each cache index represented by the monitoring linked list includes: Detect the tail node of the monitoring linked list according to a preset monitoring period, and determine whether the addition time of the tail node exceeds a preset addition time threshold; In the case where the addition time of the tail node exceeds the preset addition time threshold, determine whether the usage time of the tail node exceeds a preset usage time threshold; In the case where the usage time of the tail node exceeds the preset usage time threshold, remove the tail node from the monitoring linked list, and delete the information query result corresponding to the tail node in the local buffer area to release the buffer space of the local buffer area; Wherein, the cache value includes the addition time and the usage time of the node. The addition time of the node is used to represent the caching duration of the information query result corresponding to the node in the local buffer area, and the usage time of the node is used to represent the access frequency of the information query result corresponding to the node in the local buffer area.
8. The user information processing method according to claim 7, characterized in that The method further includes: In the case where the usage time of the tail node does not exceed the preset usage time threshold, determine whether the user to be queried corresponding to the tail node is an invalid user; In the case where the user to be queried corresponding to the tail node is an invalid user, perform the step of removing the tail node from the monitoring linked list and deleting the information query result corresponding to the tail node in the local buffer area to release the buffer space of the local buffer area.
9. The user information processing method according to claim 8, wherein The method further includes: In the case where the user to be queried corresponding to the tail node is a valid user, add the tail node as a node to be moved to the head of the monitoring linked list again, and update the addition time to the current time.
10. The user information processing method according to claim 1, wherein The querying of the user information at multiple user information storage ends based on the target information query policy to obtain the information query result of the user to be queried includes: Based on the target query range characterized by the target information query policy, screen at least one target user information storage end to be queried among the multiple user information storage ends; Based on the target query order characterized by the target information query policy, sequentially query the user information of the target user information storage ends to obtain the information query result of the user to be queried; Wherein, the user information storage end at least includes a local user information database and multiple network domain servers.
11. The user information processing method according to claim 10, characterized in that, The querying of the user information of the target user information storage end includes: Call the access interface of the target user information storage end; Through the access interface of the target user information storage end, access the target user information storage end to query the user information of the target user information storage end.
12. The user information processing method according to claim 11, wherein The accessing of the target user information storage end through the access interface of the target user information storage end to query the user information of the target user information storage end includes: In the case where the target user information storage end includes any network domain server, call the corresponding target network user information query module through the access interface of the target user information storage end; The target network user information query module determines whether the domain information of the target tenant is cached in the domain information cache by traversing the domain information cache; If the domain information of the target tenant is cached in the domain information cache, it is determined that the target tenant has joined the target network domain corresponding to the target network user information query module; Call the system query interface of the target network domain to access the target network domain server through the system query interface and query user information on the target network domain server.
13. A user information processing device, characterized in that, Comprising: An acquisition module for acquiring a user information query command issued by a superior software; A first determination module for determining the target tenant and user type to which the user to be queried belongs according to the user information query command; A second determination module for determining the target information query strategy of the user information query command according to the target tenant and user type; A query module for querying user information on multiple user information storage ends based on the target information query strategy to obtain an information query result of the user to be queried.
14. An electronic device, characterized in that, Comprising: A memory for storing a computer program; A processor for implementing the steps of the user information processing method according to any one of claims 1 to 12 when executing the computer program.
15. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the user information processing method according to any one of claims 1 to 12 when executed by a processor.
16. A computer program product, comprising a computer program, characterized in that, The computer program implements the steps of the user information processing method according to any one of claims 1 to 12 when executed by a processor.
Citation Information
Cited By
Storage system quota statistical information management method and device, equipment and medium
CN121050656A