User management notification method and device for graph database document site

By introducing event listening mechanism and Keycloak integration into the graph database document site, we automatically send permission change notification emails, solving the problem of untimely notification of user permission change and improving user experience and system efficiency.

CN120337190BActive Publication Date: 2025-09-02杭州悦数科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510829419.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-02
Estimated Expiration
2045-06-20

AI Technical Summary

Technical Problem

In the prior art, the problem of untimely notification of user rights changes at the site of the graph database document site is not promptly and the burden on the administrator has caused users to be unable to understand the permission changes in time, affecting work efficiency and system reliability.

Method used

Through the event listening mechanism of the identity access management service, the administrator event is captured and the association creation event of the user joining the user group is identified, and the permission change notification email is automatically constructed and sent. Keycloak integration is used to obtain the target notification group name and user contact information to ensure the timeliness and accuracy of notifications.

Benefits of technology

It realizes the automation of user permission change notifications, reduces the burden on administrators, improves user experience and system efficiency, and ensures the timely and accurate transmission of permission notifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120337190B_ABST
    Figure CN120337190B_ABST
Patent Text Reader

Abstract

The present invention discloses a user management notification method and device for a graph database document site, which belongs to the field of graph database technology and includes: obtaining a pre-configured target notification group name set, the target notification group is associated with the access rights of the graph database document site; capturing administrator events and identifying whether the current event is an association creation event for adding a user to a user group; in response to identifying it as an association creation event, parsing event data, extracting a group identifier and a user identifier, and querying group attribute information based on the group identifier to obtain a group name; if the obtained group name belongs to the target notification group name set, querying user attribute information based on the user identifier to obtain the user name and user contact information; constructing a notification message containing the user name and the name of the target notification group to which it is added, and sending it to the user. This application can automatically send a permission change notification to a user when an administrator assigns or modifies permissions for a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graph database technology, and in particular to a method and device for user management notification of a graph database document site. Background Art

[0002] To achieve efficient and secure user authentication and permission management, graph database documentation sites are often integrated with mature identity and access management (IAM) technologies such as Keycloak. Keycloak is an open-source IAM platform that provides powerful user management, authentication, and authorization capabilities. Users accessing graph database documentation sites are required to log in and register using Keycloak. This integration not only improves development efficiency but also ensures the security and reliability of user authentication.

[0003] However, although the integration of the graph database documentation site and Keycloak provides many conveniences in user authentication and permission management, there are significant shortcomings in user permission notification.

[0004] When administrators assign or modify permissions for users, users often don't immediately learn of the changes. This information asymmetry can lead to users not attempting to access certain resources because they're unaware of the permissions they already possess. This not only impacts user productivity but can also cause users to doubt the system's usability and reliability. For example, a new employee might be granted access rights but remain unaware of their new permissions and therefore avoid attempting to access the relevant resources.

[0005] Furthermore, administrators need to manually notify users of permission changes, which not only increases their workload but also makes omissions and errors more likely, further exacerbating the information asymmetry between users and administrators. For example, administrators may forget to notify certain users of permission updates, or errors may occur during the notification process, preventing users from correctly understanding the scope of their permissions. This manual notification method is not only inefficient but also prone to human error, impacting the overall management efficiency of the system. Summary of the Invention

[0006] The purpose of the present invention is to provide a user management notification method and device for a graph database document site, so as to solve the problems in the prior art of delayed notification of permission changes and heavy burden on administrators when the user permissions of a database document site are modified by the administrator.

[0007] To achieve the above objectives, this application adopts the following technical solutions:

[0008] The present application provides a user management notification method for a graph database document site, comprising the following steps:

[0009] Obtain a set of target notification group names pre-configured in the identity access management service, wherein the target notification group is associated with access rights to a graph database document site;

[0010] Capture administrator events through the event listening mechanism of the Identity Access Management service and identify whether the current event is an association creation event for adding a user to a user group based on the operation type and resource type in the event;

[0011] In response to identifying the association creation event, parsing event data, extracting a group identifier of the operated user group and a user identifier of the added user, and querying group attribute information according to the group identifier to obtain a group name;

[0012] If the acquired group name belongs to the target notification group name set, querying the user attribute information according to the user identifier to obtain the user name and user contact information;

[0013] A notification message including the user name and the name of the target notification group to which the user belongs is constructed, and the notification message is sent to the user through the user contact information.

[0014] Preferably, the step of obtaining a target notification group name set preconfigured in the identity access management service includes:

[0015] Initialize a static and immutable empty collection to store the target notification group name;

[0016] Read the notification group configuration parameters in the Identity Access Management service environment variables;

[0017] If the configuration parameter is a non-empty value, extract all target notification group names using commas as separators, and add all target notification group names to the set;

[0018] When the environment variable is unset or empty, a warning is logged and initialization is skipped.

[0019] Preferably, the identifying whether the current event is an association creation event for adding a user to a user group based on the operation type and resource type in the event includes:

[0020] Extract the operation type and resource type from the event object;

[0021] When the operation type is a create operation and the resource type is a user group membership, the current event is determined to be an association creation event for adding a user to a user group.

[0022] Preferably, the parsing of event data, extracting the group identifier of the operated user group and the user identifier of the added user, and querying group attribute information according to the group identifier to obtain the group name, includes:

[0023] Extract the resource path from the event and verify whether the resource path conforms to the preset format;

[0024] If they match, the path string is split according to the path hierarchy structure to obtain the group identifier of the operated user group and the user identifier of the added user;

[0025] A group model object is acquired according to the group identifier, and a name attribute value is extracted from the group model object to obtain a group name.

[0026] Preferably, querying user attribute information according to the user identifier to obtain the user name and user contact information includes:

[0027] A user model is obtained according to the user identifier, and a username field and an email address field are extracted from the user model object to obtain a username and an email address.

[0028] Preferably, constructing a notification message including the user name and the name of the target notification group to which the user has joined, and sending the notification message to the user through the user contact information includes:

[0029] Constructing email content in a structured text format, dynamically embedding a user name and a list of target notification group names to which the user has joined, wherein the list includes at least one target notification group name;

[0030] Encapsulate the email subject, email address and email content to generate a notification email;

[0031] The built-in email service of the identity access management service is called to send the notification email to the user's mailbox.

[0032] Preferably, the method further comprises:

[0033] Set up a scheduled task scheduler to poll users at fixed time intervals and add them to the user group event cache queue;

[0034] When the preset conditions are met, the scheduler shutdown process is triggered;

[0035] Before executing shutdown, check whether the scheduler has been initialized and is in running state;

[0036] If all conditions are met, a shutdown request is initiated and the maximum waiting time is set;

[0037] If the task is not completed within the timeout, the scheduler process will be forcibly terminated.

[0038] A user management notification device for a graph database document site, comprising:

[0039] An acquisition module, configured to acquire a set of target notification group names preconfigured in the identity access management service, wherein the target notification group is associated with access rights to a graph database document site;

[0040] an identification module, configured to capture administrator events through an event monitoring mechanism of the identity access management service, and identify whether the current event is an association creation event for adding a user to a user group based on an operation type and a resource type in the event;

[0041] a response module, configured to, in response to identifying the association creation event, parse event data, extract a group identifier of the operated user group and a user identifier of the added user, and query group attribute information according to the group identifier to obtain a group name;

[0042] a query module configured to query user attribute information according to the user identifier to obtain a user name and user contact information if the acquired group name belongs to the target notification group name set;

[0043] The notification module is used to construct a notification message including the user name and the name of the target notification group to which the user joins, and send the notification message to the user through the user contact information.

[0044] An electronic device includes a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement a user management notification method for a graph database document site as described in any one of the above.

[0045] A computer-readable storage medium storing a computer program, wherein the computer program enables a computer to implement a user management notification method for a graph database document site as described in any one of the above when executed.

[0046] The present invention has the following beneficial effects:

[0047] The present invention can automatically send permission change notifications to users when administrators assign or modify permissions for them. This not only improves the user experience, but also reduces the administrator's workload, ensuring efficient system operation and data security. In particular, through integration with Keycloak, permission notifications can be conveyed to users in a timely and accurate manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0049] Figure 1 This is a flowchart of a user management notification method for a graph database document site provided by an embodiment of the present application;

[0050] Figure 2 It is a full flow chart from opening the authentication connection to the administrator changing the user's access rights to notifying the user of the change in their access rights;

[0051] Figure 3 This is a structural diagram of a user management notification device for a graph database document site provided by an embodiment of the present application;

[0052] Figure 4 It is a schematic diagram of an electronic device for implementing a user management notification method for a graph database document site provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] To make the technical solution of the present application clearer, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. The terms "first", "second", etc. in the claims and description of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate. This is merely a way of distinguishing objects of the same attributes when describing the embodiments of the present application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, so that a process, method, system, product, or device comprising a series of units is not necessarily limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0054] Example 1

[0055] like Figure 1 As shown, a user management notification method for a graph database document site includes the following steps:

[0056] S110, obtaining a set of target notification group names pre-configured in the identity access management service, and access rights to the target notification group associated with the graph database document site;

[0057] S120. Capturing administrator events through the event monitoring mechanism of the identity access management service, and identifying whether the current event is an association creation event for adding a user to a user group based on the operation type and resource type in the event;

[0058] S130: In response to identifying the association creation event, parsing the event data, extracting the group identifier of the operated user group and the user identifier of the added user, and querying the group attribute information according to the group identifier to obtain the group name;

[0059] S140: If the obtained group name belongs to the target notification group name set, query the user attribute information according to the user identifier to obtain the user name and user contact information;

[0060] S150: Construct a notification message including the user name and the name of the target notification group to which the user has joined, and send the notification message to the user through the user contact information.

[0061] In this embodiment, the identity access management service uses Keycloak. External users' access requests to the graph database document site are redirected to Keycloak through the reverse proxy layer for unified authentication.

[0062] In the specific implementation, the Nginx server is used as the reverse proxy of the graph database document site, the Oauth2 Proxy container is integrated in the Nginx server, and an authentication connection is established with Keycloak. Among them, the reverse proxy configuration, Oauth2Proxy container integration and Keycloak linkage method refer to the technical solution disclosed in the Chinese invention patent application with application publication number CN120090882A and invention name "A method for implementing user authentication and DingTalk notification for a graph database document site".

[0063] Once the architecture is fully built, this embodiment uses the target notification group name configuration parameter to specify in Keycloak the group name to which notifications should be sent when an administrator adds a user to a user group. This configuration parameter can specify multiple target notification groups simultaneously, separated by commas. For example, KEYCLOAK_NOTIFIED_GROUPS=doc-viewer,admin indicates that two groups, doc-viewer and admin, are configured to receive Keycloak notifications. In Keycloak, a group is a collection of users that can be used to simplify user management and permission allocation. Users can belong to multiple groups and inherit the group's attributes and role mappings. In this embodiment, the target notification group is associated with the access rights of the document site in the graph database. For example, users in the target notification group can view and browse the content on the document site but cannot make any modifications, or users in the target notification group can not only view documents but also modify, update, or delete them. Administrators have the highest level of access rights and can manage user roles, assign permissions, back up and restore data, and so on.

[0064] Before determining whether to send a notification to a user, you must first obtain the target notification group name set configured in Keycloak to match the user group name to which the user has joined.

[0065] In some embodiments, obtaining a set of target notification group names preconfigured in the identity access management service includes:

[0066] Initialize a static and immutable empty collection to store the target notification group name;

[0067] Read the notification group configuration parameters in the Identity Access Management service environment variables;

[0068] If the configuration parameter is a non-empty value, all target notification group names are extracted using commas as separators, and all target notification group names are added to the set;

[0069] When the environment variable is unset or empty, a warning is logged and initialization is skipped.

[0070] Specifically, we first define a static, immutable, empty Set collection, NOTIFICATED_GROUPS, to store the names of the groups that trigger notifications (i.e., the target notification group names). A Set is a data structure used to store unique elements. In this example, the notification method is email. The email address is the SMTP email address configured in the Keycloak domain public, and the email address is the user email address configured in the corresponding user model.

[0071] In the constructor of the GroupJoinListenerProvider class, receive a KeycloakSession instance and assign it to the session property of the current class. Then, use the synchronized keyword to lock the GroupJoinListenerProvider class to ensure that only one thread can execute the initialization code block in a multi-threaded environment to avoid repeated initialization. Inside the synchronized code block, check the static Boolean variable initialized (this variable is declared elsewhere in the class to mark whether it has been initialized). If it has not been initialized, that is, initialized is false, execute the initialization logic.

[0072] The initialization logic includes:

[0073] a. Read the value of KEYCLOAK_NOTIFIED_GROUPS from the system environment variable, which is the target notification group name;

[0074] b. If the environment variable exists and is not empty, split it by commas to obtain all target notification group names, and add each split target notification group name to the NOTIFIERED_GROUPS collection to obtain the target notification group name set. At the same time, log the initialized target notification group names;

[0075] c. If the environment variable does not exist or is empty, a warning log is recorded, and a prompt is given that the target notification group is not configured;

[0076] d. Record a log message indicating that the GroupJoinListenerProvider has been initialized.

[0077] e. Set the initialized flag to true so that the next time you create a GroupJoinListenerProvider instance, it will not be initialized again.

[0078] You also need to register an event listener in Keycloak. This event listener is used to capture administrator events. This is an existing technology and will not be described in detail here.

[0079] When the event listener captures an administrator event, it needs to determine whether the current event is an association creation event for adding a user to a user group based on the operation type and resource type contained in the event.

[0080] In some embodiments, identifying whether the current event is an association creation event for adding a user to a user group based on an operation type and a resource type in the event includes:

[0081] Extract the operation type and resource type from the event object;

[0082] When the operation type is a create operation and the resource type is a user group membership, the current event is determined to be an association creation event for adding a user to a user group.

[0083] Specifically, determine whether the operation type of the event is CREATE and whether its resource type is GROUP_MEMBERSHIP. If both conditions are met, the event is determined to be an association creation event in which the administrator adds the user to the user group. Continue to obtain the resource path of the event and its corresponding Realm, and check whether its resource path starts with "users / ". If not, record a warning log and end the processing; if so, determine whether the resource path conforms to the preset format users / {userId} / groups / {groupId}. If so, split the resource path by " / " and check whether the length of the split array is at least The number of elements in the array is at least 4, and the third element is "groups". If not, record a warning log and end the process. If so, extract the user identifier (user ID) and group identifier (group ID) from the split array, then obtain the group model object (GroupModel) according to the group ID, and extract the group name from the group model object. Then determine whether the group name is in the target notification group name set NOTIFIED_GROUPS. If so, call the cacheGroupJoinEvent() method to cache the user joining the user group event. If not, record a log indicating that the group is not in the NOTIFIED_GROUPS collection.

[0084] It should also be noted here that if any exception occurs during this processing, it will be captured and recorded in the error log.

[0085] The code example corresponding to this process is as follows:

[0086] public void onEvent(AdminEvent event, boolean includeRepresentation){

[0087] / / Print the received administrator event information, including operation type and resource type

[0088] logger.info("Received admin event: " + event.getOperationType() +" - " + event.getResourceType());

[0089] / / Check if the administrator event's operation type is CREATE and the resource type is GROUP_MEMBERSHIP

[0090] if (event.getOperationType() == OperationType.CREATE &&

[0091] event.getResourceType() == ResourceType.GROUP_MEMBERSHIP) {

[0092] / / Print the resource path of the association creation event being processed to add the user to the user group

[0093] logger.info("Processing group membership event: " +event.getResourcePath());

[0094] try {

[0095] / / Get the Realm to which the event belongs

[0096] RealmModel realm = session.realms().getRealm(event.getRealmId());

[0097] String resourcePath = event.getResourcePath();

[0098] / / Make sure the resource path starts with "users / " and conforms to the expected format

[0099] if (resourcePath != null && resourcePath.startsWith("users / ")) {

[0100] / / Split the resource path by " / " and extract the user ID and group ID

[0101] String[] parts = resourcePath.split(" / ");

[0102] if (parts.length >= 4 && "groups".equals(parts[2])) {

[0103] String userId = parts[1]; / / Extract user ID

[0104] String groupId = parts[3]; / / Extract group ID

[0105] / / Get the group model object based on the group ID

[0106] GroupModel group = session.groups().getGroupById(realm, groupId);

[0107] if (group != null && NOTIFIED_GROUPS.contains(group.getName())) {

[0108] / / If the group is in the target notification group set, cache the association creation event for adding the user to the user group

[0109] cacheGroupJoinEvent(realm, userId, groupId);

[0110] } else {

[0111] / / If the group name is not in the target notification group set, log it

[0112] logger.info("Group is not in notified list.Group: " + (group != null ? group.getName() : groupId));

[0113] }

[0114] } else {

[0115] / / If the resource path format is incorrect, record a warning log

[0116] logger.warn("Invalid resource path format: " +resourcePath);

[0117] }

[0118] } else {

[0119] / / If the resource path does not conform to the expected format, record a warning log

[0120] logger.warn("Resource path does not start with 'users / '. Path: " + resourcePath);

[0121] }

[0122] } catch (Exception e) {

[0123] / / Catch exceptions and record error logs

[0124] logger.error("Error processing group join event", e);

[0125] }

[0126] }

[0127] }

[0128] After the administrator has added the user to the target notification group, an email is constructed to notify the corresponding user of the access rights change message, such as Figure 2 As shown, it shows the entire process from opening the authentication connection to the administrator changing the user's access rights to notifying the user of the change in their access rights.

[0129] In some embodiments, constructing a notification message including the user name and the name of the target notification group to which the user has joined, and sending the notification message to the user through the user contact information includes:

[0130] Constructing email content in a structured text format, dynamically embedding a user name and a list of target notification group names to which the user has joined, wherein the list includes at least one target notification group name;

[0131] Encapsulate the email subject, email address and email content to generate a notification email;

[0132] Call the built-in email service of the Identity Access Management service to send a notification email to the user's mailbox.

[0133] The built-in email service, EmailSenderProvider, is retrieved from the Keycloak session and checked for availability. If unavailable, an error is logged and the process terminated. If available, the generateEmailContent() method is called to generate an HTML-formatted email body and log an indication that an attempt is being made to send the email to the user's mailbox. The emailSender.send() method is then called to send the email. The parameters for the emailSender.send() method include: 1) SMTP configuration information obtained from the Realm configuration, including the SMTP server address, port, and authentication information; 2) the user's email address obtained from the user object; 3) the email subject (fixed as "You have been added to newgroups"); 4) the email body (HTML format); and 5) the email body (plain text format). The two contents are identical here, but in practice, the plain text format may remove HTML tags. If the email is sent successfully, a success log is recorded. If an EmailException is thrown during the send process, the exception is caught and an error log is recorded.

[0134] The steps for generating the email content specifically include:

[0135] 1. Receive user information and group list as parameters;

[0136] 2. Use the StringBuilder() method to build a target notification group name list in HTML format (each target notification group name as a list item` `);

[0137] 3. Returns a complete HTML document string, which includes: 1) a greeting to the user (using the user name); 2) a description text (informing that the user has been added to the following groups); 3) a constructed list of target notification group names; 4) a prompt such as "You can access to the Docs" (you can access the documents); 5) the sender's signature such as YueshuGraph IDPSystem.

[0138] If the group to which the administrator adds the user does not belong to the target notification group, only a prompt message is generated in the log, and no email is sent.

[0139] The method provided in this embodiment can automatically send permission change notifications to users when administrators assign or modify permissions for them. This not only improves the user experience but also reduces the administrator's workload, ensuring efficient system operation and data security. In particular, through integration with Keycloak, permission notifications can be delivered to users in a timely and accurate manner.

[0140] In some embodiments, a user management notification method for a graph database document site further includes:

[0141] Set up a scheduled task scheduler to poll users at fixed time intervals and add them to the user group event cache queue;

[0142] When the preset conditions are met, the scheduler shutdown process is triggered;

[0143] Before executing shutdown, check whether the scheduler has been initialized and is in running state;

[0144] If all conditions are met, a shutdown request is initiated and the maximum waiting time is set;

[0145] If the task is not completed within the timeout, the scheduler process will be forcibly terminated.

[0146] Specifically, a scheduled task scheduler is configured to trigger user permission change tasks (i.e., when an administrator adds a user to a user group) at predetermined intervals. This design not only ensures that permission changes are processed promptly, but also effectively avoids task queue congestion caused by continuous or excessively frequent permission changes. Once the previous permission change task is completed, the next task will be executed based on its queue order and the preset time interval, rather than immediately entering the execution state.

[0147] When the scheduler object is destroyed or no longer needs to be called, the process of closing the scheduler will be triggered. The scheduler shutdown process includes: checking whether the scheduler has been initialized and has not been closed. If all conditions are met, a shutdown request is sent and 10 seconds are waited for the task in the scheduler to complete. If the timeout is exceeded, the scheduler is forcibly closed. If it does not time out, initialized is marked as uninitialized. If a thread interrupt exception is caught while waiting for the task to complete, an error log is recorded and the scheduler is forcibly closed. If any condition is not met, it is skipped directly.

[0148] At the same time, under normal circumstances, the administrator's event of adding a user to a user group will be placed in the scheduled task scheduler for asynchronous processing, but if the scheduler is closed, the system will process the event synchronously instead.

[0149] This embodiment introduces a timed task scheduling mechanism to effectively control the frequency and timing of administrators adding users to user groups, thereby preventing a single task from occupying system resources for a long time and ensuring a smooth permission change process.

[0150] Example 2

[0151] like Figure 3 As shown, a user management notification device for a graph database document site includes:

[0152] An acquisition module is used to obtain a set of target notification group names pre-configured in the identity access management service, and the access rights of the target notification group to the associated graph database document site;

[0153] an identification module, configured to capture administrator events through an event monitoring mechanism of the identity access management service, and identify whether the current event is an association creation event for adding a user to a user group based on an operation type and a resource type in the event;

[0154] a response module, configured to, in response to identifying the association creation event, parse the event data, extract the group identifier of the operated user group and the user identifier of the added user, and query the group attribute information according to the group identifier to obtain the group name;

[0155] A query module, configured to query user attribute information based on a user identifier to obtain a user name and user contact information if the acquired group name belongs to the target notification group name set;

[0156] The notification module is used to construct a notification message containing the user name and the name of the target notification group to which the user belongs, and send the notification message to the user through the user contact information.

[0157] This embodiment is used to implement the method provided by the above embodiment and has the corresponding beneficial effects of the above method. For technical details not fully described in this embodiment, please refer to the methods provided by all the above embodiments of the present invention.

[0158] Example 3

[0159] like Figure 4 As shown, an electronic device includes a memory 401 and a processor 402, wherein the memory 401 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 402 to implement the above-mentioned user management notification method of a graph database document site.

[0160] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0161] A computer-readable storage medium storing a computer program, wherein the computer program enables a computer to implement the above-mentioned user management notification method for a graph database document site when executed.

[0162] Exemplarily, a computer program may be divided into one or more modules / units, one or more modules / units being stored in the memory 401 and executed by the processor 402, and the input interface 405 and the output interface 406 completing the I / O interface transmission of data to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in a computer device.

[0163] The computer device may be a desktop computer, laptop, PDA, cloud server, or other computing device. The computer device may include, but is not limited to, memory 401 and processor 402. Those skilled in the art will appreciate that this embodiment is merely an example of a computer device and does not limit the computer device. The computer device may include more or fewer components, or a combination of certain components, or different components. For example, the computer device may also include an input device 407, a network access device, a bus, and the like.

[0164] The processor 402 may be a central processing unit (CPU), other general-purpose processors 402, digital signal processors 402 (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor 402 may be a microprocessor 402 or any conventional processor 402.

[0165] Memory 401 can be an internal storage unit of a computer device, such as a hard drive or memory of the computer device. Memory 401 can also be an external storage device of the computer device, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Furthermore, memory 401 can include both an internal storage unit of the computer device and an external storage device. Memory 401 is used to store computer programs and other programs and data required by the computer device. Memory 401 can also be used to temporarily store data in output device 408. The aforementioned storage media include various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM) 403, a random access memory (RAM) 404, a disk, or an optical disk.

[0166] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A user management notification method for a graph database document site, characterized in that: The following steps are involved: Obtain a set of target notification group names pre-configured in the identity access management service, wherein the target notification group is associated with access rights to a graph database document site; Capture administrator events through the event listening mechanism of the identity access management service and extract the operation type and resource type from the event object; When the operation type is a create operation and the resource type is a user group membership, the current event is determined to be an association creation event for adding a user to a user group; In response to identifying the association creation event, parsing event data, extracting a group identifier of the operated user group and a user identifier of the added user, and querying group attribute information according to the group identifier to obtain a group name; If the acquired group name belongs to the target notification group name set, querying the user attribute information according to the user identifier to obtain the user name and user contact information; Constructing a notification message including the user name and the name of the target notification group to which the user has joined, and sending the notification message to the user through the user contact information; Set up a scheduled task scheduler to poll users at fixed time intervals and add them to the user group event cache queue; When the preset conditions are met, the scheduler shutdown process is triggered; Before executing shutdown, check whether the scheduler has been initialized and is in running state; If all conditions are met, a shutdown request is initiated and the maximum waiting time is set; If the task is not completed within the timeout, the scheduler process will be forcibly terminated.

2. A user management notification method for a graph database document site according to claim 1, characterized in that: The step of obtaining a set of target notification group names pre-configured in the identity access management service includes: Initialize a static and immutable empty collection to store the target notification group name; Read the notification group configuration parameters in the Identity Access Management service environment variables; If the configuration parameter is a non-empty value, extract all target notification group names using commas as separators, and add all target notification group names to the set; When the environment variable is unset or empty, a warning is logged and initialization is skipped.

3. A user management notification method for a graph database document site according to claim 2, characterized in that: The parsing of the event data, extracting the group identifier of the operated user group and the user identifier of the added user, and querying the group attribute information according to the group identifier to obtain the group name, includes: Extract the resource path from the event and verify whether the resource path conforms to the preset format; If they match, the path string is split according to the path hierarchy structure to obtain the group identifier of the operated user group and the user identifier of the added user; A group model object is acquired according to the group identifier, and a name attribute value is extracted from the group model object to obtain a group name.

4. A user management notification method for a graph database document site according to claim 3, characterized in that: The querying of user attribute information according to the user identifier to obtain the user name and user contact information includes: A user model is obtained according to the user identifier, and a username field and an email address field are extracted from the user model object to obtain a username and an email address.

5. A user management notification method for a graph database document site according to claim 4, characterized in that: The constructing a notification message including the user name and the name of the target notification group to which the user has joined, and sending the notification message to the user through the user contact information includes: Constructing email content in a structured text format, dynamically embedding a user name and a list of target notification group names to which the user has joined, wherein the list includes at least one target notification group name; Encapsulate the email subject, email address and email content to generate a notification email; The built-in email service of the identity access management service is called to send the notification email to the user's mailbox.

6. A user management notification device for a graph database document site, characterized in that: include: An acquisition module, configured to acquire a set of target notification group names preconfigured in the identity access management service, wherein the target notification group is associated with access rights to a graph database document site; An identification module is used to capture administrator events through the event monitoring mechanism of the identity access management service and extract the operation type and resource type from the event object; When the operation type is a create operation and the resource type is a user group membership, the current event is determined to be an association creation event for adding a user to a user group; a response module, configured to, in response to identifying the association creation event, parse event data, extract a group identifier of the operated user group and a user identifier of the added user, and query group attribute information according to the group identifier to obtain a group name; a query module configured to query user attribute information according to the user identifier to obtain a user name and user contact information if the acquired group name belongs to the target notification group name set; a notification module, configured to construct a notification message including the user name and the name of the target notification group to which the user has joined, and send the notification message to the user through the user contact information; Set up a scheduled task scheduler to poll users at fixed time intervals and add them to the user group event cache queue; When the preset conditions are met, the scheduler shutdown process is triggered; Before executing shutdown, check whether the scheduler has been initialized and is in running state; If all conditions are met, a shutdown request is initiated and the maximum waiting time is set; If the task is not completed within the timeout, the scheduler process will be forcibly terminated.

7. An electronic device, characterized in that: It includes a memory and a processor, the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement a user management notification method for a graph database document site as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables a computer to implement a user management notification method for a graph database document site according to any one of claims 1 to 5 when executed.

Citation Information

Patent Citations

  • Multi-strategy access control login method and device, computer equipment and storage medium

    CN111800440A

  • Implementation method for user authentication and nailing notification of graph database document site

    CN120090882A