Method and system for analyzing WEB user active data of digital substation

By setting an active tag validity period and real-time database analysis in digital substations, the problem of insufficient classification and statistics of user access data is solved, and accurate statistics and visualization of user activity are achieved.

CN121958261APending Publication Date: 2026-05-01XJ ELECTRIC CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XJ ELECTRIC CO LTD
Filing Date
2025-11-21
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Digital substations lack the classification and statistics of system user access data, making it impossible to effectively understand the system and user usage.

Method used

By setting an expiration period for an active tag when a user logs in, and combining a real-time database and a system access log model, the system records and analyzes user activity data, including login, operation, and logout behaviors, constructs a tree-structured list of users, and displays the relevant data through a visual interface.

Benefits of technology

It achieves accurate statistics on user activity, distinguishes between online time and actual active time, avoids the problem of inflated active time, and has a simple and efficient statistical method that can adapt to complex user operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121958261A_ABST
    Figure CN121958261A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of digital substation data analysis, and particularly relates to a digital substation WEB user active data analysis method and system. The method comprises the following steps: after a user logs in, analyzing user login information, writing online user data of the user and a corresponding active mark into a real-time database, and setting a validity period of the active mark so as to delete active mark data from the real-time database after the validity period; the online user data comprises identity information of the user; when the user operates, the identity information of the operation user is analyzed; if the active mark of the user is stored in the real-time database, refreshing and resetting the validity period of the active mark, otherwise, re-writing the active mark and setting the validity period of the active mark; when the user exits, analyzing current user information, and deleting the active mark data; and when the active mark data is deleted, subtracting the initial active time in the active mark data from the current time to obtain the single active duration of the user corresponding to the active mark.
Need to check novelty before this filing date? Find Prior Art

Description

A method and system for analyzing active WEB user data in digital substations Technical Field

[0001] This invention belongs to the field of digital substation data analysis, specifically relating to a method and system for analyzing the activity data of WEB users in digital substations. Background Technology

[0002] After logging in, users access the digital substation system. Relevant user activity data includes total user access, currently online users, user login and logout records, and user online activity duration. Current digital substations often lack categorized statistics on system user access data, making it difficult to understand system and user usage.

[0003] Chinese invention patent application CN119127637A discloses a method and system for recording user front-end behavior logs. This solution uses the Vue framework and integrates a custom Vue plugin to automatically record details of user interactions with the system. Back-end processing includes a user operation recording interface that receives and processes user behavior data sent from the front-end, generates standardized JSON objects, and records them through a logging system. An online time calculation interface uses Redis to manage user session states and calculates and accumulates user online time based on heartbeat information. ELK logging and analysis involves creating a dedicated index in Elasticsearch to store user operation logs and online time data, and using Logstash to collect and parse back-end logs, providing a data analysis interface. This improves the continuity and accuracy of user activity statistics and effectively distinguishes between truly active users and casual visitors. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for analyzing active WEB user data in digital substations, which solves the problem that existing digital substations often lack classification and statistics of system user access data, making it difficult to understand the system and user usage.

[0005] To achieve the above objectives, this invention provides a method for analyzing active user data in a digital substation web application, comprising: when a user logs into the digital substation web application, parsing the user's login information, combining it with a user information model containing the user's identity information, writing the user's online user data and corresponding activity tag into a real-time database, and setting the validity period of the activity tag so that the data of the activity tag is deleted from the real-time database after the validity period expires; the online user data contains the user's identity information; when the user operates in the web application, intercepting resource requests related to the operation and parsing the identity information of the operating user; if the real-time database contains the user's activity tag, refreshing and resetting the validity period of the activity tag; otherwise, rewriting the activity tag and setting its validity period; when the user exits the web application, parsing the current user information, and deleting the data of the activity tag if the user's activity tag is in the real-time database; when the data containing the activity tag is deleted, subtracting the start active time in the activity tag data from the current time to obtain the single active duration of the user corresponding to the activity tag.

[0006] Furthermore, it also includes: after obtaining the single active duration of the user corresponding to the active tag, updating the WEB user activity data in the user online time statistics model, which includes the user's identity information, date, and current online active duration, based on the user's identity information, so as to display the WEB user activity data to the user through a visualization interface.

[0007] Furthermore, this also includes: simultaneously writing the active flag of the logged-in user to the real-time database and writing access log information containing the user's identity information, the access type corresponding to the login, and the access time to the system access log model; deleting the active flag data if it still exists in the real-time database and simultaneously writing access log information containing the user's identity information, the access type corresponding to the logout, and the access time to the system access log model; filtering all access log information with the access type "login" by querying the system access log model and exporting it to the visualization interface to show users the total number of users accessing the digital substation WEB system; filtering all access log information with the access type "login" and the access time within the most recent day by querying the system access log model and exporting it to the visualization interface to show users the users accessing the digital substation WEB in the most recent day; querying online user data in the real-time database and exporting it to the visualization interface to show users the currently online users of the digital substation WEB; and filtering all access log information with the access type "login" for a specified user within a specified time by querying the system access log model and exporting it to the visualization interface to show users the number of times the specified user logged into the digital substation WEB within the specified time.

[0008] Furthermore, the user information model also includes a department ID associated with the corresponding user identity information; the analysis method further includes: constructing a tree structure list of departments and users based on the department ID associated with the user identity information in the user information model and the information including the superior department ID associated with the department ID in the department information relationship model, so as to display it to the user through a visual interface; the department information relationship model includes the association information of department ID, department name and superior department ID.

[0009] Furthermore, methods for deleting active data from the real-time database after the expiration date include: configuring the real-time database so that it automatically deletes the active data after the expiration date of the active data stored within it.

[0010] Furthermore, it also includes: querying the cumulative value of each online active time of a specified user within a specified time period in the online time statistics model, and exporting it to a visualization interface to show users the total online active time of a specified user within a specified time period in the digital substation WEB.

[0011] Furthermore, the online user data also includes access tokens, access token expiration times, and the flags corresponding to refresh tokens.

[0012] Furthermore, parsing user login information, intercepting resource requests related to user operations and parsing the identity information of the current user, parsing the current user information when the user logs out of the system, and deleting the corresponding user's active tag data in the real-time database when the user logs out of the system are all implemented through the framework's backend services.

[0013] Furthermore, the real-time database uses Redis, while the user information model, online duration statistics model, and system access log model all use Postgres database models.

[0014] The above-mentioned technical solution of the present invention provides a novel method for analyzing the active data of WEB users in digital substations. Its beneficial effects include: by setting an active tag validity period that starts or resets when a user has actual active behavior (such as logging in or operating) on ​​the WEB of a digital substation, it is possible to accurately associate actual active behavior with continuous active duration, clearly distinguish between user online time and user actual active time, avoid the problem of inflated user active time, and the statistical method is simple and efficient. It can also perform simple and efficient analysis even in complex situations such as continuous user operation or long-term inactivity.

[0015] This invention also provides a digital substation WEB user activity data analysis system, including a processor. The processor stores executable program instructions, which are executed to implement a digital substation WEB user activity data analysis method, including: when a user logs into the digital substation WEB, parsing the user login information, combining it with a user information model containing the user's identity information, writing the user's online user data and corresponding activity tag to a real-time database, and setting the validity period of the activity tag so that the data of the activity tag is deleted from the real-time database after the validity period expires; the online user data contains the user's identity information; when the user operates in the WEB, intercepting operation-related resource requests and parsing the identity information of the operating user; if the real-time database contains the user's activity tag, refreshing and resetting the validity period of the activity tag, otherwise rewriting the activity tag and setting its validity period; when the user exits the WEB, parsing the current user information, and deleting the data of the activity tag if the user's activity tag exists in the real-time database; when the data with the activity tag is deleted, subtracting the start active time in the activity tag data from the current time to obtain the single active duration of the user corresponding to the activity tag.

[0016] Furthermore, the analysis method also includes: after obtaining the single active duration of the user corresponding to the active tag, updating the WEB user activity data in the user online time statistics model, which includes the user's identity information, date, and current online active duration, based on the user's identity information, so as to display the WEB user activity data to the user through a visualization interface.

[0017] Furthermore, the analysis method also includes: simultaneously writing the active flag of the logged-in user to the real-time database and writing access log information containing the user's identity information, the access type corresponding to login, and the access time to the system access log model; deleting the active flag data if it still exists in the real-time database, and simultaneously writing access log information containing the user's identity information, the access type corresponding to logout, and the access time to the system access log model; and filtering all access log information with the access type "login" by querying the system access log model and exporting it to a visualization interface to display the digital substation WEB system to the user. The system tracks total user access; it queries the system access log model to filter out all access log information with the access type "login" and the access time within the most recent day, and exports this information to a visualization interface to show users who accessed the digital substation WEB in the most recent day; it queries the online user data in the real-time database and exports it to a visualization interface to show users who are currently online on the digital substation WEB; and it queries the system access log model to filter out all access log information with the access type "login" for a specified user within a specified time period, and exports this information to a visualization interface to show users the number of times the specified user logged into the digital substation WEB within the specified time period.

[0018] Furthermore, the user information model also includes a department ID associated with the corresponding user identity information; the analysis method further includes: constructing a tree structure list of departments and users based on the department ID associated with the user identity information in the user information model and the information including the superior department ID associated with the department ID in the department information relationship model, so as to display it to the user through a visual interface; the department information relationship model includes the association information of department ID, department name and superior department ID.

[0019] Furthermore, methods for deleting active data from the real-time database after the expiration date include: configuring the real-time database so that it automatically deletes the active data after the expiration date of the active data stored within it.

[0020] Furthermore, the analysis method also includes: querying the cumulative value of each online active time of a specified user within a specified time in the online time statistics model, and exporting it to a visualization interface to display to the user the total online active time of a specified user in the digital substation WEB within a specified time.

[0021] Furthermore, the online user data also includes access tokens, access token expiration times, and the flags corresponding to refresh tokens.

[0022] Furthermore, parsing user login information, intercepting resource requests related to user operations and parsing the identity information of the current user, parsing the current user information when the user logs out of the system, and deleting the corresponding user's active tag data in the real-time database when the user logs out of the system are all implemented through the framework's backend services.

[0023] Furthermore, the real-time database uses Redis, while the user information model, online duration statistics model, and system access log model all use Postgres database models.

[0024] The technical solution of the digital substation WEB user activity data analysis system described above can achieve the same beneficial effects as the digital substation WEB user activity data analysis method described above. Attached Figure Description

[0025] Figure 1 is a flowchart illustrating the analysis of the single active duration of a digital substation WEB user in an embodiment of the present invention's digital substation WEB user activity data analysis method; Figure 2 is an example diagram illustrating the settings for information such as cached access tokens, access token expiration time, and refresh token corresponding markers in an embodiment of the present invention's digital substation WEB user activity data analysis method; Figure 3 is an example diagram illustrating the settings for cached activity markers in an embodiment of the present invention's digital substation WEB user activity data analysis method; Figure 4 is an example diagram illustrating the architecture for implementing digital substation WEB user activity data analysis in an embodiment of the present invention's digital substation WEB user activity data analysis method; Figure 5 is an example diagram illustrating a table of relevant data on user online time and user login / logout counts exported in an embodiment of the present invention's digital substation WEB user activity data analysis method; Figure 6 is an example diagram illustrating a table of relevant data on user login time in an embodiment of the present invention's digital substation WEB user activity data analysis method; Figure 7 is an example diagram illustrating the visualization of the number of logins of a specified user within a specified time in the digital substation WEB user activity data analysis method of the present invention; Figure 8 is an example diagram illustrating the visualization of the online time of a specified user within a specified time in the digital substation WEB user activity data analysis method of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0027] This implementation method presents a technical solution for analyzing the active data of WEB users in digital substations. By periodically invalidating and resetting the validity period based on user operation behavior, the active data of WEB users in digital substations can be collected simply and effectively.

[0028] Referring to Figure 1, the method includes: when a user logs into the digital substation WEB, parsing the user login information, combining it with a user information model containing the user's identity information, writing the user's online user data and corresponding activity tag to the real-time database, and setting the validity period of the activity tag so that the data of the activity tag is deleted from the real-time database after the validity period expires; the online user data contains the user's identity information; when the user operates in the digital substation WEB, intercepting operation-related resource requests and parsing the identity information of the operating user; if the real-time database contains the user's activity tag, refreshing and resetting the validity period of the activity tag, otherwise rewriting the activity tag and setting its validity period; when the user exits the digital substation WEB, parsing the current user information, and deleting the data of the activity tag if the user's activity tag is in the real-time database; when the data with the activity tag is deleted, subtracting the start active time in the activity tag data from the current time to obtain the single active duration of the user corresponding to the activity tag.

[0029] Therefore, by setting an activity tag validity period that starts or resets when a user has actual active behavior (such as logging in or operating) on ​​the digital substation WEB, it is possible to accurately associate actual active behavior with continuous active duration, clearly distinguish between user online time and user actual active time, avoid the problem of inflated user active time, and the statistical method is simple and efficient. It can also perform simple and efficient analysis even in complex situations such as continuous user operation or long periods of inactivity.

[0030] In this embodiment, the real-time database uses Redis, and the user information model, online duration statistics model, and system access log model all use Postgres. In other embodiments, the real-time database can also use other forms of real-time databases, and the user information model, online duration statistics model, and system access log model can also use other database models, which will not be elaborated here.

[0031] Furthermore, to facilitate the visualization of analysis results reflecting other dimensions of active WEB user data in digital substations, the analysis method in this embodiment also includes: simultaneously writing the active tag of the logged-in user to the real-time database, and simultaneously writing access log information containing the user's identity information, the access type corresponding to login, and the access time to the system access log model; and simultaneously deleting the active tag data if the active tag still exists in the real-time database, and simultaneously writing access log information containing the user's identity information, the access type corresponding to logout, and the access time to the system access log model.

[0032] To more comprehensively collect online user data, the online user data can also include access tokens, access token expiration times, and the flags corresponding to refresh tokens. In one specific embodiment, the settings for caching access tokens, access token expiration times, and the flags corresponding to refresh tokens are detailed in Figure 2.

[0033] To facilitate the visualization of the analysis results of WEB user activity data in digital substations, the analysis method in this embodiment further includes: after obtaining the single active duration of the user corresponding to the active marker, updating the WEB user activity data in the user online duration statistical model, which includes the user's identity information, date, and current online active duration, based on the user's identity information, so as to display the WEB user activity data to the user through a visualization interface.

[0034] In addition, the user information model may also include department IDs associated with the corresponding user identity information. Therefore, the analysis method in this embodiment further includes: constructing a tree-structured list of departments and users based on the department IDs associated with the user identity information in the user information model and the information in the department information relationship model that includes the parent department IDs associated with the department IDs, to be displayed to the user through a visual interface; the department information relationship model includes the association information of department IDs, department names, and parent department IDs. In a specific embodiment, the system user list query is achieved by searching the user information table (system_users) and the department information table (system_dept), and constructing a tree-structured list of departments and users based on the department IDs associated in the user information table and the parent department IDs associated in the department information table.

[0035] To simplify the deletion process, the methods for deleting active data from the real-time database after the expiration date include: configuring the real-time database so that it automatically deletes the active data after the expiration date of the active tags stored within it.

[0036] In one specific embodiment, the user's identity information can be represented by a user ID. The user information model, online duration statistics model, system access log model, and department information relationship model involved all adopt the Postgres database model and are presented in tabular form, as follows: The user information table (system_users, i.e., the user information model) contains the user ID (the unique primary key of this user information table), the user name (e.g., login account), the user password (stored encrypted via SHA256 + HASH), and the department ID, etc. The detailed model design is shown in Table 1 below.

[0037] Table 1. Field Name | Field Description | Primary Key | Foreign Key | Data Type | Notes id | User ID | Xint8(64) | username | User Account | varchar(30) | Login Account | nickname | User Name | varchar(100) | password | Password | varchar(100) | SHA256 + HASH Encrypted Storage dept_id | Department ID | Xint8(64) | system_dept | Table id Field The department information table (system_dept, i.e., the department information relationship model) includes department ID, department name, parent department ID, etc. The detailed model design is shown in Table 2.

[0038] Table 2 Field Name Field Description Primary Key Foreign Key Data Type Notes id Department id Xint8(64) name Department Name varchar(30) parent_id Parent Department id int8(64) The system access log table (system_login_log, i.e., the system access log model) contains the primary key id (i.e., the id of each log message), user id, access type (login or logout), recording time, etc. The detailed model design is shown in Table 3.

[0039] Table 3 Field Name Field Description Primary Key Foreign Key Data Type Notes id Access ID Xint8(64) log_type Log type varchar(30) 100: Login, 200: Logout, 101: Login failed user_id User ID Xint8(64) system_users Table ID field log_time Log time timestamp(0) Login or logout time The user online time statistics table (user_online_statistics, i.e., the online time statistics model) includes the primary key id (i.e., the id of a single user's online time statistics for a single day), user id, date (year, month, day), online active time (unit: minutes), etc. The detailed model design is shown in Table 4.

[0040] Table 4 Field Name Field Description Primary Key Foreign Key Data Type Notes id Statistics id Xint8(64) user_id User id Xvarchar(30) system_users Table id Field date Date varchar(0) Format: yyyy (year) - MM (month) - dd (day) online_time Online duration int4(32) Unit: seconds The data collection involved in the table mainly includes three parts: first, user login information, including the user ID, username, and login time when the user logs into the system; second, the operation information of the user on the system interface and the ID of active users; and third, the user logout information, including the user ID, username, and logout time. This is mainly implemented through the framework backend service.

[0041] In this implementation, parsing user login information, intercepting resource requests related to user operations and parsing the current user's identity information, parsing the current user information when the user exits the system, and deleting the corresponding user's activity marker data from the real-time database when the user exits the system are all implemented through the framework backend service (i.e., the system framework backend service). Specifically, when a user logs into the digital substation WEB system, the framework backend service parses information such as the current username, user ID, and login time. After logging in, when the user performs clicks and interface switching operations on the system interface, the framework backend service intercepts and processes resource requests and updates the corresponding user's activity duration data.

[0042] In one specific embodiment, the real-time database uses a Redis cache database. This Redis database mainly maintains user online information, where login_auth_user contains online user data, including user ID, access token, access token expiration time, and refresh token, and user_online is an active marker for online users.

[0043] In this embodiment, after a user logs into the system, the system framework backend service parses the user login information, obtains the currently logged-in user account, writes the user ID, access type (login), and recording time to the system access log table (system_login_log), and writes a user_online active user flag to the Redis cache database, setting the validity period of this flag data (default is 5 minutes, which can be modified and adjusted). After expiration, Redis automatically deletes the data of the active flag (i.e., the Redis cache database automatically deletes the user_online active flag data of the corresponding user stored within it). While automatic deletion of the active flag by the real-time database is more convenient, it can also be controlled through external program commands. An example of setting the cache active flag is shown in Figure 3.

[0044] When a user performs actions such as clicking or switching interfaces in the digital substation system, the framework's backend service intercepts the relevant resource requests, parses the current user ID, and if the active tag corresponding to the current user ID does not exist in the real-time database, it rewrites the active tag and sets its validity period. If it exists, it refreshes and resets the validity period of the user_online active tag data corresponding to the user in the Redis cache database (the default is 5 minutes, which can be modified and adjusted by the configuration).

[0045] When a user logs out of the system, the system framework backend service parses the current user information, writes the user ID, access type (logout), and record time to the system access log table (system_login_log), and deletes the corresponding user's user_online active flag data from the Redis cache database (if it exists, delete it; otherwise, no operation is performed); this deletion operation is implemented by the system framework backend service.

[0046] The system framework backend service continuously monitors the user_online user activity marker data in the Redis cache database. When the corresponding user activity marker data expires (i.e., the corresponding user_online activity marker data in the Redis cache database is deleted, whether it is automatically deleted by the Redis cache database or deleted by the system framework backend service), the program subtracts the start time of the marker data from the current time to obtain the single active duration. After that, it can update the user online time statistics table (user_online_statistics) with data such as user ID, date, and online active duration based on the corresponding user ID.

[0047] In a preferred embodiment, referring to Figure 4, a QianKunCard interface (i.e., a visual interface displaying relevant data to users) is developed based on the QianKun micro-frontend technology architecture and the Vue frontend development and SpringBoot backend development technology architecture. The application frontend interface meets the requirements of the "Digital Station DC-OS 3.0 Micro-frontend No-code Orchestration Framework Technical Solution." It retrieves relevant data from the database and visualizes user login information, online activity duration, and other data. The displayed data includes the total number of system user visits, users who visited in the last day, currently online users, the system user list, user login counts, and online duration. It also supports exporting data to an Excel spreadsheet for download. For example, Figures 5 and 6 show the exported user online duration and user login / logout count data, as well as the user login time (access time for users whose access type is login), respectively. From a software perspective, this includes: Data acquisition layer: When a user logs into the digital substation WEB system, the framework backend service parses information such as the current username, user ID, and login time. After logging in, when the user performs operations such as clicking and switching interfaces on the system interface, the framework backend service intercepts and processes resource requests and updates the corresponding user's active duration data.

[0048] Analysis and Modeling Layer: Constructs a database model for the digital substation system framework and maintains data such as user information, login / logout logs, and user online time.

[0049] Visualization layer: Based on the QianKun micro-frontend technology architecture and VUE frontend development and SpringBoot backend development technology architecture, the QianKunCard card interface for displaying user access information is developed. Relevant data is obtained from the database, and data such as user login information and online active time are visualized.

[0050] In this embodiment, by querying the system access log model, all access log information with the access type of login is filtered out and exported to the visualization interface to show the total number of users accessing the digital substation WEB system to the user; in a specific embodiment, the query of the total number of system users accessing the system is achieved by filtering all records with the access type of login in the system access log table (system_login_log).

[0051] By querying the system access log model, all access log information with the access type being login and the access time being within the most recent day is filtered out and exported to the visualization interface to show users the users who accessed the digital substation WEB in the most recent day; in a specific embodiment, the query for users who accessed the most recent day is done by filtering all records with the access type being login and the recording time being within the most recent day in the system access log table (system_login_log).

[0052] The system queries online user data from a real-time database and exports it to a visualization interface to display the current online users of the digital substation web application. In one specific embodiment, the query for current online users is implemented by looking up the login_auth_user data in the Redis cache database.

[0053] By querying the system access log model, all access log information of a specified user within a specified time period that is classified as "login" is filtered out and exported to a visualization interface to show the user the number of times the specified user logged into the digital substation WEB within the specified time period. In a specific embodiment, the number of times a user logs in within a specified time period is all records of the user with the access type "login" in the system access log table (system_login_log), as shown in Figure 7.

[0054] Similarly, the analysis method in this embodiment also includes: querying the cumulative value of each online active duration of a specified user within a specified time in the online duration statistics model, and exporting it to a visualization interface to display the total online active duration of a specified user in the digital substation WEB within a specified time. In a specific embodiment, the online duration of a user within a specified time is the cumulative value of the user's daily online duration in the user online duration statistics table (user_online_statistics), as shown in Figure 8.

[0055] In summary, this implementation method can perform statistical analysis and visualization of data such as cumulative user visits, current online users, number of user logins, user login and logout logs, and online active duration, which facilitates the monitoring and evaluation of system usage and solves the technical problem of lacking effective monitoring of system access in the prior art.

[0056] This embodiment provides a technical solution for a digital substation WEB user activity data analysis system. The system includes a processor containing executable program instructions, which are executed to implement the following digital substation WEB user activity data analysis method. The method for analyzing active user data in the digital substation web application includes: when a user logs into the digital substation web application, the user's login information is parsed, and combined with a user information model containing the user's identity information, the user's online user data and corresponding activity tag are written to the real-time database. The validity period of the activity tag is set so that the data is deleted from the real-time database after the expiration date. The online user data contains the user's identity information. When a user operates within the digital substation web application, resource requests related to the operation are intercepted, and the user's identity information is parsed. If the real-time database contains the user's activity tag, its validity period is refreshed and reset; otherwise, the activity tag is rewritten and its validity period is set. When a user exits the digital substation web application, the current user information is parsed, and if the user's activity tag exists in the real-time database, the data containing the activity tag is deleted. When data containing an activity tag is deleted, the duration of a single active session for the user corresponding to that activity tag is obtained by subtracting the start time of the activity tag from the current time.

[0057] Therefore, by setting an activity tag validity period that starts or resets when a user has actual active behavior (such as logging in or operating) on ​​the digital substation WEB, it is possible to accurately associate actual active behavior with continuous active duration, clearly distinguish between user online time and user actual active time, avoid the problem of inflated user active time, and the statistical method is simple and efficient. It can also perform simple and efficient analysis even in complex situations such as continuous user operation or long periods of inactivity.

[0058] In this embodiment, the real-time database uses Redis, and the user information model, online duration statistics model, and system access log model all use Postgres. In other embodiments, the real-time database can also use other forms of real-time databases, and the user information model, online duration statistics model, and system access log model can also use other database models, which will not be elaborated here.

[0059] Furthermore, to facilitate the visualization of analysis results reflecting other dimensions of active WEB user data in digital substations, the analysis method in this embodiment also includes: simultaneously writing the active tag of the logged-in user to the real-time database, and simultaneously writing access log information containing the user's identity information, the access type corresponding to login, and the access time to the system access log model; and simultaneously deleting the active tag data if the active tag still exists in the real-time database, and simultaneously writing access log information containing the user's identity information, the access type corresponding to logout, and the access time to the system access log model.

[0060] To provide a more comprehensive overview of online user data, the data can also include access tokens, access token expiration times, and the flags associated with refresh tokens.

[0061] To facilitate the visualization of the analysis results of WEB user activity data in digital substations, the analysis method in this embodiment further includes: after obtaining the single active duration of the user corresponding to the active marker, updating the WEB user activity data in the user online duration statistical model, which includes the user's identity information, date, and current online active duration, based on the user's identity information, so as to display the WEB user activity data to the user through a visualization interface.

[0062] In addition, the user information model may also include department IDs associated with the corresponding user identity information. Therefore, the analysis method in this embodiment further includes: constructing a tree-structured list of departments and users based on the department IDs associated with the user identity information in the user information model and the information in the department information relationship model that includes the parent department IDs associated with the department IDs, to be displayed to the user through a visual interface; the department information relationship model includes the association information of department IDs, department names, and parent department IDs. In a specific embodiment, the system user list query is achieved by searching the user information table (system_users) and the department information table (system_dept), and constructing a tree-structured list of departments and users based on the department IDs associated in the user information table and the parent department IDs associated in the department information table.

[0063] To simplify the deletion process, the methods for deleting active data from the real-time database after the expiration date include: configuring the real-time database so that it automatically deletes the active data after the expiration date of the active tags stored within it.

[0064] In one specific embodiment, the user's identity information can be represented by a user ID. The user information model, online duration statistics model, system access log model, and department information relationship model involved all adopt the Postgres database model and are presented in tabular form, as follows: The user information table (system_users, i.e., the user information model) contains the user ID (the unique primary key of this user information table), the user name (e.g., login account), the user password (stored encrypted via SHA256 + HASH), and the department ID, etc.

[0065] The department information table (system_dept, i.e., the department information relationship model) includes department ID, department name, parent department ID, etc.

[0066] The system access log table (system_login_log, i.e., the system access log model) contains the primary key id (i.e., the id of each log message), user id, access type (login or logout), recording time, etc.

[0067] The user online time statistics table (user_online_statistics, i.e., the online time statistics model) includes the primary key id (i.e., the id for the online time statistics of a single user on a single day), user id, date (year, month, day), online active time (unit: minutes), etc.

[0068] The data collection mentioned above mainly includes three parts: first, user login information, including the user ID, username, and login time when the user logs into the system; second, the operation information performed by the user on the system interface and the IDs of active users; and third, the user logout information, including the user ID, username, and logout time. This is mainly implemented through the framework's backend service.

[0069] In this implementation, parsing user login information, intercepting resource requests related to user operations and parsing the current user's identity information, parsing the current user information when the user exits the system, and deleting the corresponding user's activity marker data from the real-time database when the user exits the system are all implemented through the framework backend service (i.e., the system framework backend service). Specifically, when a user logs into the digital substation WEB system, the framework backend service parses information such as the current username, user ID, and login time. After logging in, when the user performs clicks and interface switching operations on the system interface, the framework backend service intercepts and processes resource requests and updates the corresponding user's activity duration data.

[0070] In one specific embodiment, the real-time database uses a Redis cache database. This Redis database mainly maintains user online information, where login_auth_user contains online user data, including user ID, access token, access token expiration time, and refresh token, and user_online is an active marker for online users.

[0071] In this embodiment, after a user logs into the system, the system framework backend service parses the user login information, obtains the currently logged-in user account, writes the user ID, access type (login), and recording time to the system access log table (system_login_log), and writes a user_online active user flag to the Redis cache database, and sets the validity period of this flag data (default is 5 minutes, which can be modified and adjusted). After the expiration, Redis automatically deletes the data of the active flag (that is, the Redis cache database automatically deletes the user_online active flag data of the corresponding user stored in itself). It is more convenient for the real-time database to automatically delete the active flag, but it can also be controlled by external program commands.

[0072] When a user performs actions such as clicking or switching interfaces in the digital substation system, the framework's backend service intercepts the relevant resource requests, parses the current user ID, and if the active tag corresponding to the current user ID does not exist in the real-time database, it rewrites the active tag and sets its validity period. If it exists, it refreshes and resets the validity period of the user_online active tag data corresponding to the user in the Redis cache database (the default is 5 minutes, which can be modified and adjusted by the configuration).

[0073] When a user logs out of the system, the system framework backend service parses the current user information, writes the user ID, access type (logout), and record time to the system access log table (system_login_log), and deletes the corresponding user's user_online active flag data from the Redis cache database (if it exists, delete it; otherwise, no operation is performed); this deletion operation is implemented by the system framework backend service.

[0074] The system framework backend service continuously monitors the user_online user activity marker data in the Redis cache database. When the corresponding user activity marker data expires (i.e., the corresponding user_online activity marker data in the Redis cache database is deleted, whether it is automatically deleted by the Redis cache database or deleted by the system framework backend service), the program subtracts the start time of the marker data from the current time to obtain the single active duration. After that, it can update the user online time statistics table (user_online_statistics) with data such as user ID, date, and online active duration based on the corresponding user ID.

[0075] In a preferred embodiment, based on the QianKun micro-frontend technology architecture and the Vue frontend development and SpringBoot backend development technology architecture, a QianKunCard card interface (i.e., a visual interface that displays corresponding data to users) is developed for displaying user access information. The application frontend interface meets the requirements of the "Digital Substation DC-OS 3.0 Micro-frontend No-code Orchestration Framework Technical Solution". It retrieves relevant data from the database and visualizes user login information, online activity time, and other data. The displayed data includes the total number of system user visits, users who visited in the last day, currently online users, the system user list, user login counts, and online time, and supports exporting data to an Excel spreadsheet for download. From a software perspective, this includes: a data acquisition layer: when a user logs into the digital substation WEB system, the framework backend service parses information such as the current username, user ID, and login time. After logging in, when the user performs clicks and interface switching operations on the system interface, the framework backend service intercepts and processes resource requests and updates the corresponding user's activity time data.

[0076] Analysis and Modeling Layer: Constructs a database model for the digital substation system framework and maintains data such as user information, login / logout logs, and user online time.

[0077] Visualization layer: Based on the QianKun micro-frontend technology architecture and VUE frontend development and SpringBoot backend development technology architecture, the QianKunCard card interface for displaying user access information is developed. Relevant data is obtained from the database, and data such as user login information and online active time are visualized.

[0078] In this embodiment, by querying the system access log model, all access log information with the access type of login is filtered out and exported to the visualization interface to show the total number of users accessing the digital substation WEB system to the user; in a specific embodiment, the query of the total number of system users accessing the system is achieved by filtering all records with the access type of login in the system access log table (system_login_log).

[0079] By querying the system access log model, all access log information with the access type being login and the access time being within the most recent day is filtered out and exported to the visualization interface to show users the users who accessed the digital substation WEB in the most recent day; in a specific embodiment, the query for users who accessed the most recent day is done by filtering all records with the access type being login and the recording time being within the most recent day in the system access log table (system_login_log).

[0080] The system queries online user data from a real-time database and exports it to a visualization interface to display the current online users of the digital substation web application. In one specific embodiment, the query for current online users is implemented by looking up the login_auth_user data in the Redis cache database.

[0081] By querying the system access log model, all access log information of a specified user within a specified time period that is classified as "login" is filtered out and exported to a visualization interface to show the user the number of times the specified user logged into the digital substation WEB within the specified time period. In one specific embodiment, the number of logins of a user within a specified time period is all records of the user with the access type "login" in the system access log table (system_login_log).

[0082] Similarly, the analysis method in this embodiment also includes: querying the cumulative value of each online active duration of a specified user within a specified time in the online duration statistics model, and exporting it to a visualization interface to display the total online active duration of a specified user in the digital substation WEB within a specified time. In a specific embodiment, the online duration of a user within a specified time is the cumulative value of the user's daily online duration in the user online duration statistics table (user_online_statistics).

[0083] In summary, this implementation method can perform statistical analysis and visualization of data such as cumulative user visits, current online users, number of user logins, user login and logout logs, and online active duration, which facilitates the monitoring and evaluation of system usage and solves the technical problem of lacking effective monitoring of system access in the prior art.

[0084] It should be understood that the above-described specific embodiments of the present invention are merely illustrative or explanatory of the principles of the present invention, and do not constitute a limitation thereof.

Claims

1. A method for analyzing active WEB user data in digital substations, characterized in that, include: When a user logs into the digital substation WEB, the user login information is parsed, and combined with the user information model containing the user's identity information, the user's online user data and corresponding activity tag are written to the real-time database. The validity period of the activity tag is set so that the data of the activity tag is deleted from the real-time database after the validity period expires. Online user data includes the user's identity information; when a user operates in the WEB, the resource requests related to the operation are intercepted and the user's identity information is parsed; if the real-time database contains the user's activity tag, the validity period of the activity tag is refreshed and reset, otherwise the activity tag is rewritten and its validity period is set. When a user logs out of the web, the current user information is parsed, and if the user's activity tag is still stored in the real-time database, the data of the activity tag is deleted. When data with an active tag is deleted, the duration of a single active session for the user corresponding to that active tag is obtained by subtracting the start time of the active tag from the current time.

2. The method for analyzing active WEB user data in digital substations according to claim 1, characterized in that, Also includes: After obtaining the single active duration of the user corresponding to the active tag, the web user activity data in the user online time statistics model, which includes the user's identity information, date, and current online active duration, is updated according to the user's identity information, so as to display the web user activity data to the user through a visualization interface.

3. The method for analyzing active WEB user data in digital substations according to claim 1 or 2, characterized in that, Also includes: While writing the active tag of the logged-in user to the real-time database, the system also writes access log information containing the user's identity information, the access type corresponding to the login, and the access time to the system access log model. If the active tag of the user still exists in the real-time database, the system also writes access log information containing the user's identity information, the access type corresponding to the logout, and the access time to the system access log model. By querying the system access log model, the system filters out all access log information with the access type of login and exports it to the visualization interface to show users the total number of user accesses to the digital substation WEB system. By querying the system access log model, all access log information with the access type being login and the access time being within the most recent day is filtered out and exported to the visualization interface to show users the users who accessed the digital substation WEB in the most recent day. By querying online user data from a real-time database and exporting it to a visualization interface, the current online users of the digital substation web can be displayed to users. By querying the system access log model, all access log information of the specified user within a specified time period that is of the login type is selected, and exported to the visualization interface to show the user the number of times the specified user logged into the digital substation WEB within the specified time period.

4. The method for analyzing active WEB user data in digital substations according to claim 1 or 2, characterized in that, The user information model also includes a department ID associated with the corresponding user identity information; the analysis method further includes: constructing a tree structure list of departments and users based on the department ID associated with the user identity information in the user information model and the information including the superior department ID associated with the department ID in the department information relationship model, so as to display it to the user through a visual interface; the department information relationship model includes the association information of department ID, department name and superior department ID.

5. The method for analyzing active WEB user data in digital substations according to claim 1 or 2, characterized in that, Methods for deleting active data from the real-time database after the expiration date include: configuring the real-time database so that it automatically deletes the active data after the expiration date of the active tags stored within it.

6. The method for analyzing active WEB user data in digital substations according to claim 2, characterized in that, Also includes: By querying the cumulative value of each online active time of a specified user within a specified time period in the online time statistics model, and exporting it to the visualization interface, the total online active time of a specified user in the digital substation WEB within a specified time period can be displayed to the user.

7. The method for analyzing active WEB user data in digital substations according to claim 1 or 2, characterized in that, Online user data also includes access tokens, access token expiration times, and the flags corresponding to refresh tokens.

8. The method for analyzing active WEB user data in digital substations according to claim 1 or 2, characterized in that, Parsing user login information, intercepting resource requests related to user operations and parsing the identity information of the current user, parsing the current user information when the user logs out of the system, and deleting the corresponding user's activity tag data in the real-time database when the user logs out of the system are all implemented through the framework's backend service.

9. The method for analyzing active WEB user data in digital substations according to claim 2, characterized in that, The real-time database uses Redis, while the user information model, online duration statistics model, and system access log model all use Postgres database models.

10. A digital substation WEB user activity data analysis system, comprising a processor, wherein the processor stores executable program instructions, characterized in that, The executable program instructions are executed to implement the digital substation WEB user activity data analysis method according to any one of claims 1-9.

Citation Information

Patent Citations

  • User front end behavior log recording method and system

    CN119127637A