User log behavior analysis method and device
By collecting and correlating user and operation logs of SAS 9 system, the problem of logs being unable to be shared and utilized is solved, and the system robustness and user behavior analysis capabilities are improved.
Patent Information
- Application Number
- CN202211434878.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-16
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2042-11-16
AI Technical Summary
The SAS 9 system lacks effective technical means in security audit, troubleshooting and operation and maintenance monitoring, and the user log cannot be shared and fully utilized, resulting in insufficient system robustness.
By collecting logs of the computing server's login request service and querying request service, establishing user log information tables and operation log information tables, and relating them to obtain user login information and operation information of the computing server, realizing systematic log collection and extract.
It effectively improves the robustness of SAS 9 system in the application environment, enhances security auditing and troubleshooting capabilities, and supports targeted analysis of user behavior.
Smart Images

Figure CN116032779B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for analyzing user log behavior. Background Art
[0002] The ObjectSpawner service is used to process user login requests, called the login request service. The generated log will record the user information of the client accessing the system, such as user account, login time, client IP, access authentication domain, etc. The Workspace service is used to process user query requests, called the query request service. The generated log records the time when the query was submitted, user account, submitted program, query end time, etc.
[0003] With the explosive growth of data today, more and more people are engaged in the field of data mining. Whether the user's operating behavior and habits are legitimate is crucial to the enterprise application system, and user logs are a good means of monitoring and analysis. Summary of the invention
[0004] The inventors found that SAS 9 analysis software has been deeply involved in the field of data mining and data analysis for many years and is widely used by analyst users. In the SAS 9 system, the computing layer service, as the computing core of data processing and processing, is mainly completed by the Workspace service and the ObjectSpawner service. When users initiate requests from the client, a large number of logs will be generated every day, including user login, execution code, execution time, etc. However, the resources between the computing layer servers of SAS 9 are isolated from each other, and user logs are distributed on various servers, which cannot be shared and are not fully utilized. There is a lack of effective technical means in terms of security auditing, troubleshooting, operation and maintenance monitoring, etc.
[0005] In order to solve at least one of the above problems or other similar problems, the embodiments of the present application provide a user log behavior analysis method and device to systematically collect and extract relevant user information from the logs generated by login request services (such as Workspace services) and query request services (such as ObjectSpawner services) to perform targeted analysis of user behavior.
[0006] According to one aspect of an embodiment of the present application, a method for analyzing user log behavior is provided, the method comprising:
[0007] Collect log information of login request service and query request service of computing server, and establish user log information table and operation log information table;
[0008] Extracting log information of the login request service to the user log information table;
[0009] Extracting log information of the query request service to the operation log information table;
[0010] The user log information table and the operation log information table are associated to obtain the user's login information and operation information on the computing server.
[0011] In some embodiments, collecting log information of a login request service of a computing server includes:
[0012] Confirming the log directory of the login request service of the computing server;
[0013] The login request service log under the log directory is transferred to the first temporary directory.
[0014] In some embodiments, collecting log information of a query request service of a computing server includes:
[0015] Confirming a log directory of a query request service of the computing server;
[0016] The query request service log under the log directory is transferred to the second temporary directory.
[0017] In some embodiments, the method further comprises:
[0018] Modify the query request related configuration file of the computing server and turn on the log switch of the query request service.
[0019] In some embodiments, the method further comprises:
[0020] Modify the log-related configuration file of the computing server and add a date directory in a predetermined date format as a parent directory for storing log files.
[0021] In some embodiments, the user log information table includes one or a combination of the following fields: user name, group name, group name information, job name, server name, login time, last operation time, online time, log path, and client application name.
[0022] In some embodiments, the operation log information table includes one or a combination of the following fields: user name, group name, group name information, job name, server name, operation type, operation submission time, operation end time, operation running time, CPU time, relevant input tables involved in the operation, relevant output tables involved in the operation, the number of variables and the number of records in the relevant input tables involved in the operation, the number of variables and the number of records in the relevant output tables involved in the operation, and operation error information.
[0023] In some embodiments, extracting the log information of the login request service to the user log information table includes:
[0024] Traversing the login request service log in the first temporary directory, performing string processing on the log file name of the login request service log to obtain a first data table;
[0025] Extracting data information from the first data table, and outputting the extracted data information to a first temporary data table;
[0026] The user-user group relationship table is associated with the first temporary data table, and the association result is inserted into the user log information table.
[0027] In some embodiments, extracting the log information of the query request service to the operation log information table includes:
[0028] Traversing the query request service logs in the second temporary directory, performing string processing on the log file names of the query request service logs, and obtaining a second data table;
[0029] Read the file content in the log file name from the second data table, and output the read file content to the second temporary data table;
[0030] Extracting data information from the second temporary data table, and outputting the extracted data information to a third temporary data table;
[0031] The user-user group relationship table is associated with the third temporary data table, and the association result is inserted into the operation log information table.
[0032] In some embodiments, associating the user log information table with the operation log information table includes:
[0033] The user log information table and the operation log information table are associated according to the user name to obtain the login information and operation information of the user corresponding to the user name on the computing server.
[0034] According to another aspect of an embodiment of the present application, a user log behavior analysis device is provided, the device comprising:
[0035] A log collection and archiving unit collects log information of login request services and query request services of computing servers, and establishes a user log information table and an operation log information table;
[0036] A first extracting unit, which extracts the log information of the login request service to the user log information table;
[0037] A second extraction unit, which extracts the log information of the query request service to the operation log information table;
[0038] An associating unit associates the user log information table with the operation log information table to obtain the user's login information and operation information on the computing server.
[0039] In some embodiments, the log collection and archiving unit collects log information of a login request service of a computing server, including:
[0040] Confirming the log directory of the login request service of the computing server;
[0041] The login request service log under the log directory is transferred to the first temporary directory.
[0042] In some embodiments, the log collection and archiving unit collects log information of the query request service of the computing server, including:
[0043] Confirming a log directory of a query request service of the computing server;
[0044] The query request service log under the log directory is transferred to the second temporary directory.
[0045] In some embodiments, the log collection and archiving unit further modifies a query request related configuration file of the computing server to turn on a log switch for the query request service.
[0046] In some embodiments, the log collection and archiving unit further modifies the log-related configuration file of the computing server and adds a date directory in a predetermined date format as a parent directory for storing the log file.
[0047] In some embodiments, the user log information table includes one or a combination of the following fields: user name, group name, group name information, job name, server name, login time, last operation time, online time, log path, and client application name.
[0048] In some embodiments, the operation log information table includes one or a combination of the following fields: user name, group name, group name information, job name, server name, operation type, operation submission time, operation end time, operation running time, CPU time, relevant input tables involved in the operation, relevant output tables involved in the operation, the number of variables and the number of records in the relevant input tables involved in the operation, the number of variables and the number of records in the relevant output tables involved in the operation, and operation error information.
[0049] In some embodiments, the first extracting unit extracts the log information of the login request service to the user log information table, including:
[0050] Traversing the login request service log in the first temporary directory, performing string processing on the log file name of the login request service log to obtain a first data table;
[0051] Extracting data information from the first data table, and outputting the extracted data information to a first temporary data table;
[0052] The user-user group relationship table is associated with the first temporary data table, and the association result is inserted into the user log information table.
[0053] In some embodiments, the second extracting unit extracts the log information of the query request service to the operation log information table, including:
[0054] Traversing the query request service logs in the second temporary directory, performing string processing on the log file names of the query request service logs, and obtaining a second data table;
[0055] Read the file content in the log file name from the second data table, and output the read file content to the second temporary data table;
[0056] Extracting data information from the second temporary data table, and outputting the extracted data information to a third temporary data table;
[0057] The user-user group relationship table is associated with the third temporary data table, and the association result is inserted into the operation log information table.
[0058] In some embodiments, the associating unit associates the user log information table with the operation log information table, including:
[0059] The user log information table and the operation log information table are associated according to the user name to obtain the login information and operation information of the user corresponding to the user name on the computing server.
[0060] One of the beneficial effects of the embodiments of the present application is that: according to the embodiments of the present application, the defects of the SAS 9 system in security auditing, troubleshooting, operation and maintenance monitoring, etc. are made up, and the robustness of the SAS 9 system in the application environment is effectively improved. In addition, through the embodiments of the present application, the logs generated by the query request service and the login request service can be systematically collected and extracted with relevant user information, so as to facilitate targeted analysis of user behavior. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative work.
[0062] Figure 1 This is a schematic diagram of how an analyst user accesses a SAS 9 system.
[0063] Figure 2 This is a diagram of the partial structure of ObjectSpawner service log information.
[0064] Figure 3 This is a diagram of the partial structure of the Workspace service log information.
[0065] Figure 4 It is a schematic diagram of the user log behavior analysis method of an embodiment of the present application.
[0066] Figure 5 yes Figure 1 A schematic diagram of a specific example of the method is shown.
[0067] Figure 6 is a flowchart of a specific example of step 401.
[0068] Figure 7 The figure is a schematic diagram of an example of extracting the log information of the ObjectSpawner service to the user log information table.
[0069] Figure 8 yes Figure 7 A schematic diagram of a specific example of the method is shown.
[0070] Fig. 9 The figure is a schematic diagram of an example of extracting log information of the Workspace service to the user log information table.
[0071] Fig.10 yes Fig. 9 A schematic diagram of a specific example of the illustrated method.
[0072] Fig.11 It is a schematic diagram of a specific example of user log behavior analysis.
[0073] Fig.12 A schematic diagram of a user log behavior analysis device according to an embodiment of the present application. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0075] Figure 1This is a schematic diagram of how an analyst user accesses a SAS 9 system. Figure 1 As shown in the figure, users mainly access the SAS9 system through two data mining tools, SASEG and SASEM. SASEG is used for data query and data processing, while SASEM is used for model training and model analysis. The computing server of the SAS 9 system includes ObjectSpawner service and Workspace service. Among them, ObjectSpawner service is used to process user login requests. The generated log will record the user information of the client accessing the system, such as user account, login time, client IP, access authentication domain, etc. Figure 2 This is a diagram of the partial structure of the ObjectSpawner service log information. The Workspace service is used to process user query requests. The generated log records the time when the query was submitted, the user account, the submitted program, the time when the query ended, and other information. Figure 3 This is a diagram of the partial structure of the log information of the Workspace service.
[0076] It should be noted that the user log behavior analysis method and device disclosed in the present application can be used in the field of financial technology, and can also be used in any field other than the field of financial technology. The present application does not limit the application field of the user log behavior analysis method and device.
[0077] In addition, in the embodiments of this application, the acquisition, storage, use, and processing of data are in compliance with the relevant provisions of national laws and regulations. In addition, the user information involved in the embodiments of this application is obtained through legal and compliant channels, and the acquisition, storage, use, and processing of user information are authorized and agreed by the customer.
[0078] Example 1
[0079] Figure 4 is a schematic diagram of a user log behavior analysis method according to an embodiment of the present application. Figure 4 As shown, the user log behavior analysis method provided in the embodiment of the present application includes:
[0080] 401: Collect log information of the login request service and query request service of the computing server, and establish a user log information table and an operation log information table;
[0081] 402: extract the log information of the login request service to the user log information table;
[0082] 403: extracting the log information of the query request service to the operation log information table;
[0083] 404: Associating the user log information table with the operation log information table to obtain the user's login information and operation information on the computing server.
[0084] It is worth noting that the above Figure 4 The embodiments of the present application are only schematically described, but the present application is not limited thereto. For example, the execution order of the various operations can be appropriately adjusted, and other operations can be added or some operations can be reduced. Those skilled in the art can make appropriate modifications based on the above content, and are not limited to the above appended Figure 4 Records of.
[0085] In the embodiment of the present application, the login request service and the query request service are respectively ObjectSpawner service and Workspace service as an example for description, but the present application is not limited thereto.
[0086] In the embodiments of the present application, Figure 1 As shown, the SAS 9 system includes multiple computing servers, each of which includes an ObjectSpawner service and a Workspace service. This application collects the log information of the ObjectSpawner service and the Workspace service of each computing server, establishes a user log information table and an operation log information table, extracts the log information of the ObjectSpawner service into the user log information table, extracts the log information of the Workspace service into the operation log information table, and then associates the user log information table with the operation log information table to obtain the user's login information and operation information for the computing server. As a result, the defects of the SAS 9 system in security auditing, troubleshooting, operation and maintenance monitoring, etc. are made up, and the robustness of the SAS 9 system in the application environment is effectively improved. In addition, according to the method of the embodiment of the present application, the logs generated by the Workspace service and the ObjectSpawner service can also be systematically collected and extracted from the relevant user information, so as to facilitate targeted analysis of user behavior.
[0087] Figure 5 yes Figure 1 A schematic diagram of a specific example of the method shown. Figure 5 As shown, the method includes:
[0088] 501: Log collection and archiving;
[0089] 502: Extract the log information of ObjectSpawner service;
[0090] 503: Extract the log information of the Workspace service;
[0091] 504: Based on the user account and process account, associate the extracted log information of the two services.
[0092] according to Figure 5 The method can obtain the user's login information and operation information for each computing server of the SAS 9 system.
[0093] In the above example, step 502 and step 503 are executed in parallel, but the present application is not limited thereto. Step 502 and step 503 may also be executed sequentially, for example, step 502 is executed first and then step 503, or step 503 is executed first and then step 502.
[0094] In the embodiment of the present application, in step 401, the log directory and log file name structure information generated by the ObjectSpawner service and the Workspace service can be confirmed according to the installation configuration directory of the SAS 9 system on the server. At the same time, two new table structures are created to record the log information of the ObjectSpawner service and the log information of the Workspace service respectively.
[0095] In some embodiments, collecting log information of the ObjectSpawner service of the computing server includes:
[0096] Confirm the log directory of the ObjectSpawner service of the computing server;
[0097] The ObjectSpawner service log under the log directory is transferred to the first temporary directory.
[0098] For example, in the computing server of the SAS 9 system, taking / sas / sas94 as the media installation directory, each computing server generates a log file for the day in the / sas / sas94 / config / Lev1 / ObjectSpawnerXX / Logs directory. The file name consists of ObjectSpawner+date of the day+service machine name+service process number.
[0099] In the above example, you can create a new temporary directory on each computing server and add a scheduled job. For example, copy the log files of the previous three days to the temporary directory every night, and clear the directory after the log files are parsed.
[0100] In some embodiments, collecting log information of a Workspace service of a computing server includes:
[0101] Confirm the log directory of the Workspace service of the computing server;
[0102] The Workspace service log in the log directory is transferred to the second temporary directory.
[0103] In the above embodiment, since the Workspace service log records the user's code execution and generates a large number of log files, the switch for recording logs in the Workspace service is turned off by default. In some implementations, the query request related configuration file of the computing server, such as the sasv9.cfg configuration file, can be modified to turn on the log switch of the above Workspace service.
[0104] For example, run the following command to modify the sasv9.cfg configuration file of each computing server and turn on the Workspace service log switch.
[0105] "sed-i--'s,logconfig.xml,logconfig.trace.xml,g' / sas / sas94 / config / Lev1 / SASAppXX / WorkspaceServer / sasv9.cfg"
[0106] In the above implementation, the log-related configuration file of the computing server may also be modified, for example, the logconfig.trace.xml configuration file, to add a date directory in a predetermined date format (such as YYYY-MM-DD format) as the parent directory for storing the above log files. Thus, the log files may be archived according to date.
[0107] For example, modify the logconfig.trace.xml configuration file of the computing server as follows:
[0108]
[0109] In the above implementation, each time a user logs into a SAS client, a log file is generated. The log file name format is SASAppXX_WorkspaceServer_%d_%S{hostname}_%S{pid}.log, where SASAppXX is the server name, hostname is the server machine name, and pid is the client process number.
[0110] In the embodiment of the present application, in order to record the log information of the ObjectSpawner service and the log information of the Workspace service respectively, a user log information table user_log_info for recording the log information of the ObjectSpawner service and an operation log information table opt_log_info for recording the log information of the Workspace service can be newly created.
[0111] In some embodiments, the user log information table user_log_inf includes one or a combination of the following fields: user name, group name, group name information, job name, server name, login time, last operation time, online duration, log path, and client application name. Table 1 below is an example of the user log information table user_log_info, showing the field information (field names) and descriptions of the user log information table user_log_info.
[0112] Field Name describe username username groupname Group Name groupdesc Group name information jobid Job Name hostname Server Name logindt Login time lastactiondt Last operation time onlinehours Online time logpath Log path clientappname Client application name
[0113] Table 1
[0114] In some embodiments, the operation log information table opt_log_info includes one or a combination of the following fields: user name, group name, group name information, job name, server name, operation type, operation submission time, operation end time, operation running time, CPU time consumption, relevant input table involved in the operation, relevant output table involved in the operation, number of variables and number of records of the relevant input table involved in the operation, number of variables and number of records of the relevant output table involved in the operation, and operation error information. Table 2 below is an example of the operation log information table opt_log_info, showing the field information (field name) and description of the operation log information table opt_log_info.
[0115] Field Name describe username username groupname Group Name groupdesc Group name information jobid Job Name hostname Server Name opttype Operation Type optsubmitdt Operation submission time optenddt Operation end time optruntime Operational running time optrcputime CPU Time optintables Related input tables involved in the operation optouttables Related output tables involved in the operation optintables_info The number of variables and records in the relevant input table involved in the operation optouttables_info The number of variables and records in the output table involved in the operation opterrinfo Operation error message
[0116] Table 2
[0117] Figure 6 is a flowchart of a specific example of step 401. Figure 6 As shown, the method includes:
[0118] 601: Confirm the log directory of the ObjectSpawner service;
[0119] 602: Confirm the log directory of the Workspace service;
[0120] 603: Copy the log files within three days from the above two log directories to the temporary directory at regular intervals every day;
[0121] 604: Create two new tables (user log information table user_log_info and operation log information table opt_log_info) (604) in advance to record the log information of the ObjectSpawner service and the log information of the Workspace service.
[0122] It should be noted that Figure 6The examples are just examples, and the log files can also be copied at intervals of other time units (days, hours, minutes, etc.), and the log files copied every day are not limited to three days, and can also be other time units (such as a week or a month, etc.).
[0123] In the above example, step 601 and step 602 are executed in parallel, but the present application is not limited thereto. Step 601 and step 602 may also be executed sequentially, for example, step 601 is executed first and then step 602, or step 602 is executed first and then step 601.
[0124] In the embodiment of the present application, in step 402, the log information of the ObjectSpawner service is extracted to the user log information table, which can be obtained by Figure 7 The method can be implemented, but the present application is not limited thereto. Figure 7 As shown, the method includes:
[0125] 701: traverse the ObjectSpawner service log in the first temporary directory, perform string processing on the log file name of the ObjectSpawner service log, and obtain a first data table;
[0126] 702: extracting data information from the first data table, and outputting the extracted data information to a first temporary data table;
[0127] 703: Associating the user-user group relationship table with the first temporary data table, and inserting the association result into the user log information table.
[0128] It is worth noting that the above Figure 7 The embodiments of the present application are only schematically described, but the present application is not limited thereto. For example, the execution order of the various operations can be appropriately adjusted, and other operations can be added or some operations can be reduced. Those skilled in the art can make appropriate modifications based on the above content, and are not limited to the above appended Figure 7 Records of.
[0129] Figure 8 yes Figure 7 A schematic diagram of a specific example of the method shown. Figure 8 As shown, the method includes:
[0130] 801: Traverse the ObjectSpawner service log files in the temporary directory;
[0131] 802: Extract key data and output to the temporary table Obj_log_info;
[0132] 803: users_groups is associated with Obj_log_info, and the result information is inserted into the user_log_info table.
[0133] In step 801, the ObjectSpawner service log in the first temporary directory is traversed, and then the log file name is string processed to obtain a data table (referred to as the first data table) with the log file name, file loading date, machine name, and ObjectSpawner service process ID as fields. Table 3 below is a specific example of the first data table.
[0134]
[0135] Table 3
[0136] In step 802, based on the field information of the file loading date and machine name in the first data table (such as Table 3), data information can be extracted from the log file three days ago every night at the server granularity according to relevant rules and output to the temporary data table Obj_log_info (called the first temporary data table).
[0137] Here, take "according to the field information of the file loading date and machine name in the first data table (such as Table 3), extract data information from the log file three days ago according to the server granularity every night according to relevant rules" as an example, but the present application is not limited to this, and data information can also be extracted according to other rules. For example, the first data table also includes other fields. In step 802, data information is extracted according to the other fields; for another example, the time for extracting data information is not limited to night, but can be a fixed time; for another example, the data information is not limited to the data information three days ago, but can also be one day ago or five days ago, and so on.
[0138] Table 4 below shows the meaning of keywords in the ObjectSpawner service log.
[0139] Keywords meaning New client connection...APPNAME=... A client creates a new connection Created process... Create a client process Process...has ended Ending a process
[0140] Table 4
[0141] Table 5 below is a specific example of the first temporary data table Obj_log_info, showing the field information (field names) and descriptions of the first temporary data table Obj_log_info.
[0142] Field Name describe username username jobid Job Name hostname Server Name logindt Login time lastactiondt Last operation time logpath Log path clientappname Client application name
[0143] Table 5
[0144] In some examples, pseudo code to extract information is as follows:
[0145]
[0146] In step 803, the user and user group relationship table users_groups can be associated with the first temporary data table Obj_log_info (such as Table 5) according to the primary key user field, and then the associated result information is inserted into the previously established user log information table user_log_info (such as Table 1). Here, "associating according to the primary key user field" is taken as an example, but the present application is not limited to this, and it can also be associated according to other fields, thereby obtaining log information for other fields.
[0147] Table 6 below is a specific example of the user-user-group relationship table users_groups, showing the field information (field names) and descriptions of the user-user-group relationship table users_groups.
[0148] Field Name describe username username groupname Group Name groupdesc Group name information
[0149] Table 6
[0150] In the embodiment of the present application, in step 403, the log information of the Workspace service is extracted to the user log information table, which can be obtained by Fig. 9 The method can be implemented, but the present application is not limited thereto. Fig. 9 As shown, the method includes:
[0151] 901: traverse the Workspace service logs in the second temporary directory, perform string processing on the log file names of the Workspace service logs, and obtain a second data table;
[0152] 902: Read the file content in the log file name from the second data table, and output the read file content to the second temporary data table;
[0153] 903: extracting data information from the second temporary data table, and outputting the extracted data information to a third temporary data table;
[0154] 904: Associating the user-user group relationship table with the third temporary data table, and inserting the association result into the operation log information table.
[0155] It is worth noting that the above Fig. 9 The embodiments of the present application are only schematically described, but the present application is not limited thereto. For example, the execution order of the various operations can be appropriately adjusted, and other operations can be added or some operations can be reduced. Those skilled in the art can make appropriate modifications based on the above content, and are not limited to the above appended Fig. 9 Records of.
[0156] Fig.10 yes Fig. 9 A schematic diagram of a specific example of the method shown. Fig.10 As shown, the method includes:
[0157] 1001: traverse the Workspace service log files in the temporary directory;
[0158] 1002: Read the log file content to generate a temporary data table Ws_log_tmp_info;
[0159] 1003: Extract the content of the text field of the table Ws_log_tmp_info and output it to the temporary table Ws_log_info;
[0160] 1004: users_groups is associated with Ws_log_info, and the result information is inserted into the opt_log_info table.
[0161] In step 1001, the Workspace service log in the second temporary directory is traversed, and then the log file name is string processed to obtain a data table (referred to as the second data table) with the log file name, login date, machine name, and client process ID as fields. Table 7 below is a specific example of the second data table.
[0162]
[0163] Table 7
[0164] In step 1002, the file content in the field log file name can be read according to the field information of the client process ID, login date, and machine name in the second data table (such as Table 7) and output to the temporary data table Ws_log_tmp_info (referred to as the second temporary data table).
[0165] Here, take "reading the file content in the field log file name according to the field information of the client process ID, login date, and machine name in the second data table (such as Table 7)" as an example, but the present application is not limited to this, and the content can also be read according to other rules. For example, the second data table also includes other fields. In step 1002, the file content is read according to the other fields, and so on.
[0166] Table 8 below is a specific example of the second temporary data table Ws_log_tmp_info, showing field information (field names) and descriptions of the second temporary data table Ws_log_tmp_info.
[0167] Field Name describe jobid Client process ID logindt Landing date hostname Machine Name text Log text content
[0168] Table 8
[0169] In step 1003, data information can be extracted from the text field content of the data table Ws_log_tmp_info according to the field information of the client process ID, login date, and machine name in the second temporary data table (such as Table 8) through relevant rules and output to the temporary data table Ws_log_info (called the third temporary data table).
[0170] Here, we take "extracting data information from the text field content of the data table Ws_log_tmp_info through relevant rules based on the field information of the client process ID, login date, and machine name in the second temporary data table (such as Table 8)" as an example, but the present application is not limited to this, and data information can also be extracted according to other rules. For example, the second temporary data table also includes other fields, and data information is extracted based on the other fields, and so on.
[0171] Table 9 below shows the meaning of keywords in the Workspace service log.
[0172]
[0173]
[0174] Table 9
[0175] Table 10 below is a specific example of the third temporary data table Ws_log_info, showing field information (field names) and descriptions thereof.
[0176] Field Name describe username username jobid Client process ID hostname Server Name logindt Login time opttype Operation Type optsubmitdt Operation submission time optenddt Operation end time optruntime Operational running time optrcputime CPU Time clientuserid User domain account clientusername User Name clientusermachinename User client machine name optintables Related input tables involved in the operation optouttables Related output tables involved in the operation optintables_info The number of variables and records in the relevant input table involved in the operation optouttables_info The number of variables and records in the output table involved in the operation optcode Executing Code opterrinfo Operation error message
[0177] Table 10
[0178] In some examples, pseudo code to extract information is as follows:
[0179]
[0180]
[0181] In step 1004, the user and user group relationship table users_groups (such as Table 6) can be associated with the above third temporary data table Ws_log_info (such as Table 10) according to the primary key user field, and then the associated result information is inserted into the previously established operation log information table opt_log_info (such as Table 2).
[0182] Here, "association based on the primary key user field" is taken as an example, but the present application is not limited to this, and association can also be performed based on other fields, thereby obtaining log information for other fields.
[0183] In the embodiment of the present application, in step 404, the user log information table and the operation log information table are associated, which can be that the user log information table and the operation log information table are associated according to the user name to obtain the login information and operation information of the user corresponding to the user name for each computing server of the SAS 9 system.
[0184] In the above embodiment, association based on user name (primary key user field) is taken as an example, but the present application is not limited thereto, and the above association can also be performed based on other fields, thereby obtaining user log information for different aspects for further analysis of user behavior.
[0185] Fig.11 is a schematic diagram of a specific example of user log behavior analysis, such as Fig.11 As shown, the user log behavior analysis module 1101 can use the method of the embodiment of the present application to obtain the user's login information and operation information for each computing server of the SAS 9 system, and then, through recording and calculation, the average query volume of each part of the user group and the average query volume of each share can be obtained. Based on the above two average values, the proportion of each user's query volume in the query volume under the department user group can be determined, and then through calculation, the maximum number of client connections supported by each user can be obtained.
[0186] According to the method of the embodiment of the present application, the operation information of the SAS 9 client user can be effectively captured, providing data guarantee for the targeted analysis of user behavior, and enhancing the security audit and behavior monitoring capabilities of the client user in the financial field.
[0187] Example 2
[0188] The embodiment of the present application also provides a user log behavior analysis device, which corresponds to the user log behavior analysis method in Example 1. Therefore, the implementation of the device can refer to the implementation of the user log behavior analysis method in Example 1, and the repeated parts will not be repeated.
[0189] Fig.12 A schematic diagram of a user log behavior analysis device according to an embodiment of the present application. Fig.12 As shown, the user log behavior analysis device 1200 of the embodiment of the present application includes:
[0190] The log collection and archiving unit 1201 collects the log information of the ObjectSpawner service and the Workspace service of the computing server, and establishes a user log information table and an operation log information table;
[0191] A first extraction unit 1202, which extracts the log information of the ObjectSpawner service to the user log information table;
[0192] A second extraction unit 1203 extracts the log information of the Workspace service to the operation log information table;
[0193] The associating unit 1204 associates the user log information table with the operation log information table to obtain the user's login information and operation information on the computing server.
[0194] In some embodiments, the log collection and archiving unit 1201 collects log information of the ObjectSpawner service of the computing server, including:
[0195] Confirm the log directory of the ObjectSpawner service of the computing server;
[0196] The ObjectSpawner service log under the log directory is transferred to the first temporary directory.
[0197] In some embodiments, the log collection and archiving unit 1201 collects log information of the Workspace service of the computing server, including:
[0198] Confirm the log directory of the Workspace service of the computing server;
[0199] The Workspace service log in the log directory is transferred to the second temporary directory.
[0200] In some embodiments, the log collection and archiving unit 1201 further modifies the query request related configuration file of the computing server and turns on the log switch of the Workspace service.
[0201] In some embodiments, the log collection and archiving unit 1201 further modifies the log-related configuration file of the computing server, and adds a date directory in a predetermined date format as a parent directory for storing the log file.
[0202] In some embodiments, the user log information table includes one or a combination of the following fields: user name, group name, group name information, job name, server name, login time, last operation time, online time, log path, and client application name.
[0203] In some embodiments, the operation log information table includes one or a combination of the following fields: user name, group name, group name information, job name, server name, operation type, operation submission time, operation end time, operation running time, CPU time consumed, relevant input tables involved in the operation, relevant output tables involved in the operation, the number of variables and the number of records in the relevant input tables involved in the operation, the number of variables and the number of records in the relevant output tables involved in the operation, and operation error information.
[0204] In some embodiments, the first extracting unit 1202 extracts the log information of the ObjectSpawner service to the user log information table, including:
[0205] Traversing the ObjectSpawner service log in the first temporary directory, performing string processing on the log file name of the ObjectSpawner service log to obtain a first data table;
[0206] Extracting data information from the first data table, and outputting the extracted data information to a first temporary data table;
[0207] The user-user group relationship table is associated with the first temporary data table, and the association result is inserted into the user log information table.
[0208] In some embodiments, the second extracting unit 1203 extracts the log information of the Workspace service to the operation log information table, including:
[0209] Traversing the Workspace service logs in the second temporary directory, performing string processing on the log file names of the Workspace service logs, and obtaining a second data table;
[0210] Read the file content in the log file name from the second data table, and output the read file content to the second temporary data table;
[0211] Extracting data information from the second temporary data table, and outputting the extracted data information to a third temporary data table;
[0212] The user-user group relationship table is associated with the third temporary data table, and the association result is inserted into the operation log information table.
[0213] In some embodiments, the associating unit 1204 associates the user log information table with the operation log information table, including:
[0214] The user log information table and the operation log information table are associated according to the user name to obtain the login information and operation information of the user corresponding to the user name on the computing server.
[0215] According to the device of the embodiment of the present application, the operation information of the SAS 9 client user can be effectively captured, providing data guarantee for the targeted analysis of user behavior, and enhancing the security audit and behavior monitoring capabilities of the client user in the financial field.
[0216] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.
[0217] The user information in the embodiments of the present application is obtained through legal and compliant channels, and the acquisition, storage, use, and processing of the user information are authorized and agreed by the customer.
[0218] Although the present application provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).
[0219] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, devices (systems) or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0220] The present application is described with reference to the flowcharts and / or block diagrams of the methods, apparatus (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0221] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0222] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0223] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The orientation or position relationship indicated by the terms "upper", "lower", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. Unless otherwise expressly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two components. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to the specific circumstances. It should be noted that the embodiments and features in the embodiments in this application can be combined with each other unless there is a conflict. The present application is not limited to any single aspect, nor to any single embodiment, nor to any combination and / or permutation of these aspects and / or embodiments. Moreover, each aspect and / or embodiment of the present application can be used alone or in combination with one or more other aspects and / or embodiments thereof.
[0224] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application.
Claims
1. A user log behavior analysis method, characterized in that: The method comprises: Collect log information of login request service and query request service of computing server, and establish user log information table and operation log information table; Extracting log information of the login request service to the user log information table; Extracting log information of the query request service to the operation log information table; Associating the user log information table with the operation log information table to obtain the user's login information and operation information on the computing server; Wherein, collecting the log information of the login request service of the computing server includes: confirming the log directory of the login request service of the computing server, and transferring the login request service log under the log directory to the first temporary directory; and extracting the log information of the login request service to the user log information table, including: traversing the login request service log in the first temporary directory, performing string processing on the log file name of the login request service log to obtain a first data table; extracting data information from the first data table, and outputting the extracted data information to the first temporary data table; associating the user and user group relationship table with the first temporary data table, and inserting the association result into the user log information table; Wherein, collecting log information of the query request service of the computing server includes: confirming the log directory of the query request service of the computing server, and transferring the query request service log under the log directory to the second temporary directory; and extracting the log information of the query request service to the operation log information table, including: traversing the query request service log in the second temporary directory, performing string processing on the log file name of the query request service log, and obtaining a second data table; reading the file content in the log file name from the second data table, and outputting the read file content to the second temporary data table; extracting data information from the second temporary data table, and outputting the extracted data information to the third temporary data table; associating the user and user group relationship table with the third temporary data table, and inserting the association result into the operation log information table.
2. The method according to claim 1, characterized in that The method further comprises: Modify the query request related configuration file of the computing server and turn on the log switch of the query request service.
3. The method according to claim 1, characterized in that The method further comprises: Modify the log-related configuration file of the computing server and add a date directory in a predetermined date format as a parent directory for storing log files.
4. The method according to claim 1, characterized in that: The user log information table includes one or a combination of the following fields: User name, group name, group name information, job name, server name, login time, last operation time, online time, log path, and client application name.
5. The method according to claim 1, characterized in that The operation log information table includes one or a combination of the following fields: User name, group name, group name information, job name, server name, operation type, operation submission time, operation end time, operation running time, CPU time consumed, relevant input tables involved in the operation, relevant output tables involved in the operation, the number of variables and records in the relevant input tables involved in the operation, the number of variables and records in the relevant output tables involved in the operation, and operation error information.
6. The method according to claim 1, characterized in that Associating the user log information table with the operation log information table, including: The user log information table and the operation log information table are associated according to the user name to obtain the login information and operation information of the user corresponding to the user name on the computing server.
7. A user log behavior analysis device, characterized in that: The device comprises: A log collection and archiving unit collects log information of login request services and query request services of computing servers, and establishes a user log information table and an operation log information table; A first extracting unit, which extracts the log information of the login request service to the user log information table; A second extraction unit, which extracts the log information of the query request service to the operation log information table; an associating unit, which associates the user log information table with the operation log information table to obtain the user's login information and operation information on the computing server; The log collection and archiving unit collects log information of the login request service of the computing server, including: confirming the log directory of the login request service of the computing server, and transferring the login request service log under the log directory to the first temporary directory; and the first extraction unit extracts the log information of the login request service to the user log information table, including: traversing the login request service log in the first temporary directory, performing string processing on the log file name of the login request service log to obtain a first data table; extracting data information from the first data table, and outputting the extracted data information to the first temporary data table; associating the user and user group relationship table with the first temporary data table, and inserting the association result into the user log information table; Among them, the log collection and archiving unit collects log information of the query request service of the computing server, including: confirming the log directory of the query request service of the computing server, and transferring the query request service log under the log directory to the second temporary directory; and the second extraction unit extracts the log information of the query request service to the operation log information table, including: traversing the query request service log in the second temporary directory, performing string processing on the log file name of the query request service log to obtain a second data table; reading the file content in the log file name from the second data table, and outputting the read file content to the second temporary data table; extracting data information from the second temporary data table, and outputting the extracted data information to the third temporary data table; associating the user and user group relationship table with the third temporary data table, and inserting the association result into the operation log information table.
