A user data protection method and system for a human resources management platform
By establishing user portraits and similarity classification on the human resources management platform, the target random forest model is trained, which solves the problem of low algorithm efficiency when the platform monitors user behavior in real time, and improves abnormal behavior detection efficiency and system security.
Patent Information
- Application Number
- CN202411491619.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2044-10-24
AI Technical Summary
When the human resource management platform monitors user behavior in real time, its algorithm is inefficient and cannot quickly analyze and judge user abnormal behavior, resulting in an increase in platform security risks.
By obtaining user behavior data, establishing user portraits, performing similarity classification, multiple types of users are obtained, model training matrix is obtained, target random forest model is trained, and user abnormal behavior monitoring is performed.
It improves the efficiency of user abnormal behavior detection, reduces the system's safety hazards, and improves the system's safety factor.
Smart Images

Figure CN119475115B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data protection technology, and specifically relates to a user data protection method and system for a human resources management platform. Background Art
[0002] The human resource management platform involves recruitment management, employee information management, performance management, training and development, salary and benefits management, data analysis and reporting. The user data of the human resource management platform involves employee privacy and corporate information security, so the protection of user data of the human resource management platform is crucial. At present, the relevant technology is to detect abnormal user behavior, record and analyze user behavior, and promptly discover and deal with potential security risks.
[0003] However, when detecting abnormal user behavior in related technologies, since the human resources management platform involves a large amount of data, the algorithm efficiency is low when monitoring user behavior in real time, and it is impossible to quickly analyze and judge user abnormal behavior and obtain results, which increases the security risk of the platform. Summary of the invention
[0004] In order to solve the above problems, the embodiments of the present application provide a user data protection method and system for a human resources management platform.
[0005] According to a first aspect of an embodiment of the present application, a method for protecting user data of a human resources management platform is provided, the method comprising:
[0006] Obtaining behavioral data of users of the human resources management platform;
[0007] According to the user's behavior data, a user portrait of the user is established to obtain a portrait label of the user;
[0008] Based on the portrait tags, similarity classification is performed on the user portraits of all users to obtain multiple types of users;
[0009] According to the plurality of users of the type, a model training matrix is obtained;
[0010] According to the model training matrix, a target random forest model is trained;
[0011] The target random forest model is used to monitor abnormal user behavior and protect user data of the human resource management platform.
[0012] Optionally, establishing a user portrait of the user according to the user's behavior data and obtaining a portrait tag of the user includes:
[0013] Obtaining an access interval regularity index of the user;
[0014] Obtaining the user's access frequency regularity index;
[0015] Obtaining a regularity index of the user's access duration;
[0016] Obtaining a regularity index of the user's access address;
[0017] Obtaining an access device regularity index of the user;
[0018] According to the access interval regularity index, the access frequency regularity index, the access duration regularity index, the access address regularity index and the access device regularity index, a user portrait of the user is established and a portrait label of the user is obtained.
[0019] Optionally, the user portraits of all users are classified by similarity according to the portrait tags to obtain multiple types of users, including:
[0020] Obtain the difference between the portrait labels of any two users;
[0021] According to the difference between the portrait labels of any two users, a region growing algorithm is used to similarly merge the user portraits to obtain multiple types of users, wherein the difference between the portrait labels of any two users of the same type of users is less than or equal to 1.
[0022] Optionally, obtaining the model training matrix includes:
[0023] Obtaining the number of behavior sequences for training the random forest among any type of users;
[0024] Obtaining the preference level of any user among the users of the type;
[0025] The model training matrix is obtained according to the number of behavior sequences and the degree of optimization.
[0026] Optionally, obtaining the number of behavior sequences for training the random forest among any type of users includes:
[0027] Get the total number of users of the specified type;
[0028] Obtain the mean of the differences between the portrait labels of all users of the type of user;
[0029] According to the mean of the difference between the total number of users of the type and the portrait labels of all users of the type, the number of behavior sequences of the type of users used to train the random forest is obtained, wherein the type of users is any type of users.
[0030] Optionally, obtaining the preference level of any user among the type of users includes:
[0031] Obtaining the mean value of the differences between the portrait labels of all remaining users of the type after removing the user;
[0032] The preference degree of any user in the type of users is obtained according to the mean value of the difference between the portrait labels of all users of the type of users and the mean value of the difference between the portrait labels of all users remaining after removing the user from the type of users.
[0033] Optionally, obtaining the model training matrix includes:
[0034] According to the preference degree of any user in the type of users, the number of users with the aforementioned behavior sequence in the type of users is obtained in descending order, and the portrait vector of the type of users is obtained for training;
[0035] The portrait vectors of all the types of users are converted into a matrix form to obtain the model training matrix, wherein the portrait vector is a fifth-order row vector.
[0036] Optionally, the training to obtain the target random forest model according to the model training matrix includes:
[0037] According to the user portraits of all users, the first random forest model is established;
[0038] Obtaining a Gini coefficient of the feature in any decision tree in the first random forest model, wherein the feature comes from a user profile of the user;
[0039] Obtaining a mean value of the Gini coefficients of the feature in all decision trees in the first random forest model, where the mean value of the Gini coefficients is the weight of the feature;
[0040] Based on the model training matrix, the proportion of the weight of the feature in the sum of the weights of all features is used as the probability, the feature is randomly selected at the split node, a decision tree is constructed, and a second random forest model is obtained by training. The second random forest model is the target random forest model.
[0041] Optionally, the using the target random forest model to monitor abnormal user behavior and protect user data of the human resource management platform includes:
[0042] Using the target random forest model to monitor the portrait vectors of the type of users;
[0043] When the classification of the portrait vector of the type of user in the target random forest model changes, it is determined that there is an abnormal behavior user among the type of users;
[0044] Obtain the difference in user portrait labels among the type of users with abnormal behavior, and determine the user whose difference is greater than 1 as the abnormal behavior user;
[0045] The account permissions of the user with abnormal behavior are restricted to protect the user data.
[0046] According to a second aspect of an embodiment of the present application, a user data protection system for a human resources management platform is provided, the system comprising a human resources management platform, the human resources management platform comprising:
[0047] a memory having a computer program stored thereon;
[0048] A processor is used to execute the computer program in the memory to implement the steps of any one of the methods in the first aspect.
[0049] In summary, the embodiment of the present application provides a user data protection method for a human resource management platform, the method comprising: obtaining the behavior data of users of the human resource management platform; establishing a user portrait of the user based on the behavior data of the user, and obtaining a portrait label of the user; performing similarity classification on the user portraits of all users based on the portrait label to obtain multiple types of users; obtaining a model training matrix based on multiple types of users; training a target random forest model based on the model training matrix; and using the target random forest model to monitor abnormal user behavior to complete the protection of user data of the human resource management platform. The embodiment of the present application performs similarity classification on the user portraits of all users to obtain multiple types of users, and uses type users as basic samples for training and detection. Since the number of user samples is reduced, the efficiency of abnormal user behavior detection is improved, the potential safety hazards of the system are reduced, and the system safety factor is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the implementation scheme of the present application, the drawings required for use in the implementation scheme will be briefly introduced below. It should be understood that the drawings only show certain implementation schemes of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on the drawings without paying creative work.
[0051] Figure 1 The present invention is a flowchart of a method for protecting user data of a human resource management platform according to an exemplary embodiment.
[0052] Figure 2 The present invention is a flowchart of a method for obtaining a user portrait label according to an exemplary embodiment.
[0053] Figure 3 The figure is a flowchart of a method for obtaining multiple types of users according to an exemplary embodiment.
[0054] Figure 4 The figure is a flowchart of a method for obtaining a model training matrix according to an exemplary embodiment.
[0055] Figure 5 The present invention is a flowchart of a method for obtaining the number of behavior sequences of any type of users for training random forests according to an exemplary embodiment.
[0056] Figure 6 The figure is a flowchart showing a method for obtaining the preference level of any user among types of users according to an exemplary embodiment.
[0057] Figure 7 The figure is a flowchart of another method for obtaining a model training matrix according to an exemplary embodiment.
[0058] Figure 8 The figure is a flowchart of a method for obtaining a target random forest model according to an exemplary embodiment.
[0059] Fig. 9 It is a flowchart of a method for using a target random forest model to monitor abnormal user behavior and protect user data of a human resources management platform according to an exemplary embodiment.
[0060] Fig.10 It is a block diagram of a user data protection system of a human resources management platform according to an exemplary embodiment.
[0061] Fig.11 It is a block diagram of a human resource management platform according to an exemplary embodiment. DETAILED DESCRIPTION
[0062] In order to clearly illustrate the technical features of the present solution, the present application is described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0063] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.
[0064] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0065] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0066] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0067] It should be noted that the modifications of "one" and "multiple" mentioned in this application are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly indicated in the context, they should be understood as "one or more". In the description of this application, unless otherwise specified, "multiple" refers to two or more than two, and other quantifiers are similar; "at least one item (item)", "one (item) or multiple items (items)" or similar expressions refer to any combination of these items (items), including any combination of single items (items) or plural items (items). For example, at least one item (item) a can represent any number of a; for another example, one (item) or multiple items (items) of a, b and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple; "and / or" is a kind of association relationship that describes the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
[0068] Although the operations or steps are described in a specific order in the drawings in the embodiments of the present application, it should not be understood that it is required to perform these operations or steps in the specific order shown or in a serial order, or to perform all the operations or steps shown to obtain the desired results. In the embodiments of the present application, these operations or steps can be performed in series; these operations or steps can also be performed in parallel; or some of these operations or steps can be performed.
[0069] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0070] The application scenario of the present application is described below. The random forest algorithm model is a classifier that can produce high accuracy for a variety of information, so it is suitable for abnormal user behavior detection on the human resource management platform. Since the random forest algorithm in the related art is trained on the original data, the model is relatively large, and the classification requires a large amount of calculation and a long time. At the same time, the selectivity of the splitting nodes of each tree is random, which further leads to an increase in the amount of calculation. Therefore, the method of the present application performs type user processing on the original data, reduces the data dimension to reduce the amount of calculation, and increases the weight of the feature selection of the splitting node, which can more quickly detect whether the user has abnormal behavior.
[0071] To detect abnormal user behavior, it is first necessary to analyze the user's normal behavior. User profiling abstracts each specific behavior information of the user into labels, and uses these labels to concretize the user behavior, thereby providing users with targeted services. It is suitable for representing user behavior on the human resources management platform. At the same time, the labels simplify the user data set and can also be used as features of the random forest algorithm. Therefore, this method first classifies and labels user behavior, reduces the dimension of similar user data and uses it as the same monitoring point to reduce the monitoring amount. When the monitoring point shows abnormal performance, it further monitors the user data of several similar users, further reducing the amount of calculation and improving the algorithm detection efficiency. The application is described below in conjunction with specific embodiments.
[0072] Figure 1 FIG. 1 is a flow chart showing a method for protecting user data of a human resource management platform according to an exemplary embodiment. Figure 1 As shown, the embodiment of the present application provides a method for protecting user data of a human resources management platform, and the method may include the following steps:
[0073] In step S10, behavioral data of users of the human resource management platform is obtained.
[0074] In this step, the behavior data of users of the human resource management platform is obtained. For a single enterprise, the human resource management platform involves the overall organizational structure. People in different departments can view different contents on the human resource management platform, and people have different usage habits. To detect abnormal user behavior, you first need to obtain the user's behavior data. For example, you can first obtain the access time, access duration, access address, and access device information of several users on the human resource management platform within one year.
[0075] In step S20, a user portrait of the user is established based on the user's behavior data, and a portrait label of the user is obtained.
[0076] In this step, a user portrait of the user is established based on the user's behavior data, and a user portrait label is obtained. Exemplarily, the user's access interval regularity index, the user's access frequency regularity index, the user's access duration regularity index, the user's access address regularity index, the user's access device regularity index, and finally, the user portrait of the user is established based on the user's access interval regularity index, access frequency regularity index, access duration regularity index, access address regularity index, and access device regularity index, and the user portrait label is obtained. The label is a one-dimensional vector composed of the above five indicators.
[0077] In step S30, the user portraits of all users are similarly classified according to the portrait labels to obtain multiple types of users.
[0078] In this step, the user portraits of all users are similarly classified according to the portrait labels to obtain multiple types of users. Exemplarily, the difference between the portrait labels of any two users can be obtained first, and then the user portraits are similarly merged using a region growing algorithm according to the difference between the portrait labels of the any two users to obtain multiple types of users, wherein the difference between the portrait labels of any two users of the same type is less than or equal to 1.
[0079] In step S40, a model training matrix is obtained according to a plurality of users of the type.
[0080] In this step, a model training matrix is obtained based on multiple types of users. For example, the number of behavior sequences used to train the random forest in any type of user can be obtained first, and then the preference level of any user in the type of user can be obtained, and then the model training matrix can be obtained based on the number of behavior sequences and the preference level.
[0081] In step S50, a target random forest model is trained according to the model training matrix.
[0082] In this step, the target random forest model is trained according to the model training matrix. Exemplarily, a first random forest model can be established according to the user portraits of all users, and then the Gini coefficient of the feature in any decision tree in the first random forest model is obtained, wherein the feature comes from the user portrait of the user, and then the mean of the Gini coefficients of the feature in all decision trees in the first random forest model is obtained, and the mean of the Gini coefficients is the weight of the feature, and then based on the model training matrix, the weight of the feature is taken as the proportion of the sum of the weights of all features as the probability, the feature is randomly selected at the split node, a decision tree is constructed, and a second random forest model is obtained by training, and the second random forest model is the standard random forest model.
[0083] In step S60, the target random forest model is used to monitor abnormal user behavior to protect user data of the human resource management platform.
[0084] In this step, the target random forest model is used to monitor abnormal user behavior to protect the user data of the human resources management platform. Exemplarily, the target random forest model can be used to monitor the portrait vector of the type of user. When the classification of the portrait vector of the type of user in the target random forest model changes, it is determined that there are abnormal behavior users in the type of user. Then, the difference in user portrait labels among the type of users with abnormal behavior users is obtained, and users with differences greater than 1 are determined as abnormal behavior users. Then, the account permissions of the users with abnormal behavior are restricted to complete the protection of user data.
[0085] In summary, the embodiment of the present application provides a user data protection method for a human resource management platform, the method comprising: obtaining the behavior data of users of the human resource management platform; establishing a user portrait of the user based on the behavior data of the user, and obtaining a portrait label of the user; performing similarity classification on the user portraits of all users based on the portrait label to obtain multiple types of users; obtaining a model training matrix based on multiple types of users; training a target random forest model based on the model training matrix; and using the target random forest model to monitor abnormal user behavior to complete the protection of user data of the human resource management platform. The embodiment of the present application performs similarity classification on the user portraits of all users to obtain multiple types of users, and uses type users as basic samples for training and detection. Since the number of user samples is reduced, the efficiency of abnormal user behavior detection is improved, the potential safety hazards of the system are reduced, and the system safety factor is improved.
[0086] Figure 2 FIG. 1 is a flow chart showing a method for obtaining a user's portrait label according to an exemplary embodiment. Figure 2As shown, establishing a user portrait of the user based on the user's behavior data and obtaining the user's portrait label may include the following steps:
[0087] In step S201, the access interval regularity index of the user is obtained.
[0088] In this step, the user's access interval regularity index is obtained. Exemplarily, this step may include the following sub-steps:
[0089] Step S2011, obtaining the frequency of the normal access time interval of the user;
[0090] Step S2012, obtaining the frequency of the access time interval of the i-th access record of the user;
[0091] Step S2013, obtaining the access time interval of the i-th access record of the user;
[0092] Step S2014, obtaining the normal access time interval of the user;
[0093] Step S2015, obtaining an access interval regularity parameter of the user according to the frequency of the normal access time interval, the frequency of the access time interval of the ith access record, the access time interval of the ith access record and the normal access time interval;
[0094] Step S2016, determining the level of the access interval regularity parameter, the level including regular, relatively regular and irregular;
[0095] Step S2017, assigning quantization to the level to obtain the user's access interval regularity index.
[0096] The human resource management platform is a functional platform. It is not as highly sticky to users as a social media platform. Therefore, the main purpose of users when using the human resource management platform is to view personal information such as salary, performance, attendance, etc., and analyze their relevant information through the platform's data analysis and reporting functions. However, the usage situations of different users are not the same. For example, for users who often travel, although the access address changes frequently, it does not mean that the behavior is abnormal. Therefore, a user profile can be established through the data of the user's use of the platform. Specifically, the access record of any user can be set: {access time, access duration, access address, access device}, denoted as P = {P1, P2, ..., P i ,…,P n},P i ={t i ,L i ,S i ,W i}, where Pi represents the i-th access record of the user, t i ,L i ,S i ,W i They respectively represent the access time, access duration, access address, and access device of the i-th access record of the user.
[0097] Establish a behavior sequence of any user: {regularity of access time, regularity of access duration, regularity of access address, regularity of access device}, denoted as: H = {XT, XL, XS, XW}, where the access time regularity parameter XT includes the access interval regularity parameter XT1 and the access frequency regularity parameter XT2.
[0098] Perform forward difference on the access time series of any user to obtain the access time interval series (unit: hour) of the user, take 12 hours as the step length and 12 hours as the starting access time interval, obtain the access frequency of each access time interval, draw the access time interval-frequency histogram of the user, and obtain the access time interval with the largest frequency as the normal access time interval of the user; obtain the normal access time interval of all users, obtain the number of users in each normal access time interval, draw the normal access time interval-user number histogram, and obtain the normal access time interval with the largest number of users as the standard access time interval.
[0099] The user's access interval regularity parameter XT1 is obtained based on the user's time interval-frequency histogram and the difference between the user's normal access time interval and the standard access time interval.
[0100] Exemplarily, the user's access interval regularity parameter XT1 can be obtained by the following formula:
[0101]
[0102] Wherein, AT is the frequency of the normal access time interval of the user, n represents the number of visits of the user, and AT i represents the frequency of the access time interval of the i-th access record of the user, T i represents the access time interval of the i-th access record of the user, T ′ is the normal access time interval of the user, and exp is an exponential function with the natural number e as the base.
[0103] When XT1<0.3, the user's access time interval is considered irregular, and the index is assigned a value of 1. When 0.3≤XT1<0.6, the user's access time interval is considered relatively regular, and the index is assigned a value of 2. When XT1≥0.6, the user's access time interval is considered regular, and the index is assigned a value of 3, thereby obtaining the user's access time regularity index XT1′. That is, the value of XT1′ is 3, 2, or 1.
[0104] In step S202, the access frequency regularity index of the user is obtained.
[0105] In this step, the user's access frequency regularity index is obtained. Exemplarily, this step may include the following sub-steps:
[0106] Step S2021, obtaining the standard access time interval of the user;
[0107] Step S2022, obtaining the maximum value of the normal access time interval of the user;
[0108] Step S2023, obtaining an access frequency regularity parameter of the user according to the normal access time interval, the standard access time interval and the maximum value of the normal access time interval;
[0109] Step S2024, determining the level of the access frequency regularity parameter, wherein the level includes regular, relatively regular and irregular;
[0110] Step S2025, assigning quantization to the level to obtain the user's access frequency regularity index.
[0111] Exemplarily, the user's access frequency regularity parameter XT2 can be obtained by the following formula:
[0112]
[0113] Wherein, T″ is the standard access time interval, max(T′) is the maximum value of the normal access time interval, and dividing by max(T′) is the normalization process.
[0114] When XT2<-0.5, the user's access frequency is considered to be high, and the index is assigned a value of 3. When -0.5≤XT2≤0.5, the user's access frequency is considered to be normal, and the index is assigned a value of 2. When XT2>0.5, the user's access frequency is considered to be low, and the index is assigned a value of 1. Thus, the user's access frequency regularity index XT2′ is obtained. That is, the value of XT2′ is 3, 2, or 1.
[0115] In step S203, the regularity index of the user's access duration is obtained.
[0116] In this step, the regularity index of the user's access time is obtained. Exemplarily, this step may include the following sub-steps:
[0117] Step S2031, obtaining the frequency of the normal access duration of the user;
[0118] Step S2032, obtaining the frequency of the access duration of the i-th access record of the user;
[0119] Step S2033, obtaining the access duration of the i-th access record of the user;
[0120] Step S2034, obtaining the normal access duration of the user;
[0121] Step S2035, obtaining a regularity parameter of the user's access duration according to the frequency of the normal access duration, the frequency of the access duration of the i-th access record, the access duration of the i-th access record and the normal access duration;
[0122] Step S2036, determining the level of the access duration regularity parameter, wherein the level includes regular, relatively regular and irregular;
[0123] Step S2037, assigning quantization to the level to obtain a regularity index of the user's access duration.
[0124] Exemplarily, with a step length of 5 minutes and a starting access duration of 5 minutes, the access frequency of each access duration of the user is obtained, and a histogram of the user's access duration-frequency is drawn to obtain the access duration with the maximum frequency as the normal access duration of the user, and obtain the user's access duration regularity parameter XL. Exemplarily, the user's access duration regularity parameter XL can be obtained by the following formula:
[0125]
[0126] Where AL is the frequency of the normal access duration of the user, n represents the number of visits of the user, AL i represents the frequency of the access duration of the i-th access record of the user, L i represents the access duration of the i-th access record of the user, and L′ represents the normal access duration of the user.
[0127] It means multiplying the difference between all the access durations of the user and the normal access duration by the frequency ratio of the corresponding access duration. The larger the value is, the larger the frequency ratio of the access duration that is significantly different from the normal access duration is, and thus the smaller the regularity is.
[0128] When XL<0.3, the user's access time is considered irregular, and the index is assigned a value of 1. When 0.3≤XL<0.6, the user's access time is considered relatively regular, and the index is assigned a value of 2. When XL≥0.6, the user's access time is considered regular, and the index is assigned a value of 3. Thus, the user's access time regularity index XL' is obtained. That is, the value of XL' is 3, 2, or 1.
[0129] In step S204, the regularity index of the user's access address is obtained.
[0130] In this step, the user's access address regularity index is obtained. Exemplarily, this step may include the following sub-steps:
[0131] Step S2041, obtaining the average value of all access address serial numbers of the user;
[0132] Step S2042, obtaining the average of the access address serial numbers of all frequently used addresses of the user;
[0133] Step S2043, obtaining the maximum value of all access address serial numbers of the user;
[0134] Step S2044, obtaining an access address regularity parameter of the user according to the average value of all access address serial numbers, the mean value of the access address serial numbers of all frequently used addresses and the maximum value of all access address serial numbers;
[0135] Step S2045, determining the level of the access address regularity parameter, the level including regular, relatively regular and irregular;
[0136] Step S2046, assigning quantization to the level to obtain the user's access address regularity index.
[0137] Exemplarily, a coordinate system is constructed, with the horizontal axis being the access record number and the vertical axis being the access address number. The access address number of the first access record of the user is recorded as 1. When the access address number of the ith access record is different from the access address numbers of all previous access records, the access address number of the ith access record is recorded as the maximum value of the access address numbers of the previous access records + 1. This is repeated to obtain the access address numbers of all access records. A scatter plot of the user's access record-address number is drawn, which reflects the user's outings / business trips. The more access address numbers the user has and the more changes in the access address, the weaker the regularity of the user's access address. Thus, the user's access address regularity parameter XS can be calculated. All different access address numbers of the user are sorted according to the frequency of occurrence, and the first three access address numbers are recorded as the user's commonly used address numbers.
[0138] Obtain the user's access address regularity parameter XS. Exemplarily, the user's access address regularity parameter XS can be obtained by the following formula:
[0139]
[0140] in, represents the average value of all access address serial numbers of the user, represents the mean of the access address serial numbers of all the commonly used addresses of the user, max(C) represents the maximum value of all the access address serial numbers of the user, and represents the number of access addresses.
[0141] It indicates the difference between the average sequence number and the average sequence number of the commonly used addresses. The more records of uncommon addresses there are, the weaker the regularity of the user's access addresses. At the same time, the more the number of access addresses is, the more often the user goes out, and the weaker the regularity of the access addresses is.
[0142] When XS<0.3, the user's access address is considered irregular, and the index is assigned a value of 1. When 0.3≤XS<0.6, the user's access address is considered relatively regular, and the index is assigned a value of 2. When XS≥0.6, the user's access address is considered regular, and the index is assigned a value of 3. Thus, the user's access address regularity index XS′ is obtained. That is, the value of XS′ is 3, 2, or 1.
[0143] In step S205, the regularity index of the user's access device is obtained.
[0144] In this step, the user's access device regularity index is obtained. Exemplarily, this step may include the following sub-steps:
[0145] Step S2051, obtaining the average value of all access device serial numbers of the user;
[0146] Step S2052, obtaining the average of the access device serial numbers of all commonly used devices of the user;
[0147] Step S2053, obtaining the maximum value of all access device serial numbers of the user;
[0148] Step S2054, obtaining the access device regularity parameter of the user according to the average value of all access device serial numbers, the mean value of the access device serial numbers of all commonly used devices and the maximum value of all access device serial numbers;
[0149] Step S2055, determining the level of the regularity parameter of the access device, wherein the level includes regular, relatively regular and irregular;
[0150] Step S2056: quantify the level to obtain the user's access device regularity index.
[0151] For example, a scatter plot of the user's access record and device serial number is drawn in the same way, which reflects the situation of the user changing devices, and the user's access device regularity parameter XW is obtained. All different access device serial numbers of the user are sorted according to the frequency of occurrence, and the first two access device serial numbers are recorded as the user's commonly used device serial numbers. For example, the user's access device regularity parameter XW can be obtained by the following formula:
[0152]
[0153] in, represents the average value of all access device serial numbers of the user, represents the mean of the access device serial numbers of all commonly used devices of the user, max(D) represents the maximum value of all access device serial numbers of the user, and represents the number of access devices.
[0154] When XW<0.3, the user's access device is considered irregular, and the index is assigned a value of 1. When 0.3≤XW<0.6, the user's access device is considered relatively regular, and the index is assigned a value of 2. When XW≥0.6, the user's access device is considered regular, and the index is assigned a value of 3. Thus, the user's access device regularity index XW′ is obtained. That is, the value of XW′ is 3, 2, or 1.
[0155] In step S206, based on the access interval regularity index, the access frequency regularity index, the access duration regularity index, the access address regularity index and the access device regularity index, a user portrait of the user is established to obtain a portrait label of the user.
[0156] In this step, according to the access interval regularity index, the access frequency regularity index, the access time regularity index, the access address regularity index and the access device regularity index, the user portrait of the user is obtained to obtain the user portrait label. Exemplarily, the user portrait label can be a one-dimensional digital vector such as {access interval regularity index, access frequency regularity index, access time regularity index, access address regularity index, access device regularity index}, that is, {XT1′, XT2′, XL′, XS′, XW′}, for example, it can actually be {1,2,1,3,2}.
[0157] Figure 3 FIG. 1 is a flow chart showing a method for obtaining multiple types of users according to an exemplary embodiment. Figure 3As shown, the similarity classification of the user portraits of all users according to the portrait labels to obtain multiple types of users may include the following steps:
[0158] In step S301, the difference between the portrait labels of any two users is obtained.
[0159] In this step, we obtain the difference E between the portrait labels of any two users. s,t For example, the difference E between any two user portrait labels is s,t It can be obtained by the following formula:
[0160] E s,t =|XT 1,s ′-XT 1,t ′|+|XT 2,s ′-XT 2,t ′|+|XL s ′-XL t ′|+|XS s ′-XS t ′|+|XW s ′-XW t ′|Formula 6
[0161] Among them, XT 1,s ′, XT 1,t ′,XT 2,s ′, XT 2,t ′, XL s ', XL t ′, XS s ′, XS t ′,XW s ′, XW t ′, respectively represent the access interval regularity index, access frequency regularity index, access duration regularity index, access address regularity index, and access device regularity index of the s-th user and the t-th user.
[0162] In step S302, based on the difference between the portrait labels of any two users, a region growing algorithm is used to similarly merge the user portraits to obtain multiple types of users, wherein the difference between the portrait labels of any two users of the same type of users is less than or equal to 1.
[0163] In this step, according to the difference E between the portrait labels of any two users s,t, a region growing algorithm is used to merge user portraits by similarity, and multiple types of users are obtained, wherein the difference between the portrait labels of any two users of the same type is less than or equal to 1. Exemplarily, the first user can be used as a seed point, and the difference between the two user portraits is less than or equal to 1 as a growth condition. When the difference between the user portraits is greater than 1, the growth is stopped, and the preliminary classification is completed after traversing all users; all preliminary categories are merged, and the merging condition is that among all users of the two preliminary categories, the difference between any two user portraits is less than or equal to 1; each merged category is recorded as a user type.
[0164] Figure 4 FIG. 1 is a flow chart of a method for obtaining a model training matrix according to an exemplary embodiment. Figure 4 As shown, obtaining the model training matrix may include the following steps:
[0165] In step S401, the number of behavior sequences used to train the random forest among any type of users is obtained.
[0166] In this step, the number of behavior sequences used for training the random forest in any type of user is obtained. Exemplarily, the total number of users of this type of user can be obtained first, and then the mean of the difference between the portrait labels of all users of this type of user is obtained, and then the number of behavior sequences used for training the random forest in this type of user is obtained according to the total number of users of this type of user and the mean of the difference between the portrait labels of all users of this type of user, wherein this type of user is any type of user.
[0167] In step S402, the preference level of any user among the type of users is obtained.
[0168] In this step, the preference level of any user in the type of users is obtained. Exemplarily, the mean value of the difference between the portrait labels of all users of the type of users after removing the user can be obtained first, and then the preference level of the user in the type of users can be obtained based on the mean value of the difference between the portrait labels of all users of the type of users and the mean value of the difference between the portrait labels of all users of the type of users after removing the user.
[0169] In step S403, the model training matrix is obtained according to the number of behavior sequences and the degree of preference.
[0170] In this step, the model training matrix is obtained according to the number of behavior sequences and the degree of preference. For example, the degree of preference of all users of this type of users can be sorted in descending order, and the number of users with the first behavior sequences of this type of users can be obtained to obtain the portrait vector of this type of users for training, and then all the portrait vectors of this type of users can be converted into a matrix form to obtain the model training matrix, wherein the portrait vector is a fifth-order row vector, that is, a vector with 5 features.
[0171] Figure 5 FIG. 1 is a flowchart of a method for obtaining the number of behavior sequences for training a random forest in any type of user according to an exemplary embodiment. Figure 5 As shown, the obtaining of the number of behavior sequences for training the random forest among any type of users may include the following steps:
[0172] In step S4011, the total number of users of the type is obtained.
[0173] In this step, the total number f of users of the type is obtained.
[0174] In step S4012, the mean value of the differences between the portrait labels of all users of the type of users is obtained.
[0175] In this step, we obtain the mean of the differences between the portrait labels of all users of the type user.
[0176] In step S4013, the number of behavior sequences of users of the type used to train the random forest is obtained according to the mean of the difference between the total number of users of the type and the portrait labels of all users of the type, wherein the type of users is any type of users.
[0177] In this step, the total number of users of this type f and the mean of the difference between the portrait labels of all users of this type are calculated. Obtain the number P of behavior sequences used to train the random forest among the type of users, where the type of users is any type of user. Exemplarily, the number P of behavior sequences used to train the random forest among the type of users can be obtained by the following formula:
[0178]
[0179] Wherein, l is a preset value (can be 100, adjusted according to the user's order of magnitude); is the ceiling function.
[0180] It means that the more users of the type, the more behavior sequences are selected. At the same time, the differences between users of the type are used as weights. The greater the differences between all users of the type, the more behavior sequences should be selected for the type.
[0181] Figure 6 FIG. 1 is a flow chart showing a method for obtaining the preference level of any user among types of users according to an exemplary embodiment. Figure 6 As shown, the obtaining of the preference level of any user among the type of users may include the following steps:
[0182] In step S4021, the mean value of the differences between the portrait labels of all remaining users of the type of users after removing the user is obtained.
[0183] In this step, the mean value of the difference between the portrait labels of all remaining users of this type after removing this user is obtained.
[0184] In step S4022, the preference level of any user of the type of users is obtained based on the mean value of the difference between the portrait labels of all users of the type of users and the mean value of the difference between the portrait labels of all remaining users of the type of users after removing the user.
[0185] In this step, the mean of the differences between the profile labels of all users of this type of user is The mean of the difference between the portrait labels of all remaining users after removing this user from the user type Obtain the preference level Q of the user among the users of the type. Exemplarily, the preference level Q of the user among the users of the type can be obtained by the following formula:
[0186]
[0187] Among them, X N It represents the u-th index value of the user portrait label, which is also the characteristic value of the random forest, that is, the 5 characteristic indicators contained in the portrait vector in this embodiment.
[0188] Indicates the influence of the user on the portrait of all users of this type. The larger the value, the greater the influence of the user on the overall user type, and the more likely the user is to be selected for training. At the same time, the larger the sum of the index values of the user's portrait labels, the more regular the user's behavior is overall, the weaker the user's specificity is, and the lower the preference is.
[0189] Figure 7 FIG. 1 is a flowchart of another method for obtaining a model training matrix according to an exemplary embodiment. Figure 7As shown, obtaining the model training matrix may include the following steps:
[0190] In step S4031, the preference degree of any user in the type of users is sorted in descending order, and the number of users with the aforementioned behavior sequences in the type of users is obtained to obtain a portrait vector of the type of users for training.
[0191] In this step, the preference levels Q of all users of this type are sorted in descending order, P users of this type are obtained, and the portrait vector Y of this type of users is obtained for training.
[0192] In step S4032, the portrait vectors of all the types of users are converted into a matrix form to obtain the model training matrix, wherein the portrait vector is a fifth-order row vector.
[0193] In this step, the portrait vector Y of all types of users is converted into a matrix form to obtain the model training matrix Among them, the portrait vector Y is a fifth-order row vector. That is, it contains 5 characteristic indicators: access interval regularity indicator, access frequency regularity indicator, access duration regularity indicator, access address regularity indicator, and access device regularity indicator. For example, V represents the maximum number of user types, and the vth type has P S users for training, there are users for training.
[0194] Figure 8 FIG. 1 is a flow chart of a method for obtaining a target random forest model according to an exemplary embodiment. Figure 8 As shown, the training to obtain the target random forest model according to the model training matrix may include the following steps:
[0195] In step S501, a first random forest model is established based on the user portraits of all users.
[0196] In this step, a first random forest model is established based on the user portraits of all users. Exemplarily, establishing a random forest model is a prior art, and this application will not go into details here.
[0197] In step S502, the Gini coefficient of the feature in any decision tree in the first random forest model is obtained, wherein the feature comes from the user portrait of the user.
[0198] In this step, the Gini coefficient of the feature in any decision tree in the first random forest model is obtained, wherein the feature comes from the user profile of the user. Exemplarily, calculating the Gini coefficient of a feature is a prior art, and this application will not go into detail here. The Gini coefficient of each feature can be obtained by calculating the regularity feature of the access interval, the regularity feature of the access frequency, the regularity feature of the access duration, the regularity feature of the access address, and the regularity feature of the access device in sequence.
[0199] In step S503, the mean value of the Gini coefficients of the feature in all decision trees in the first random forest model is obtained, and the mean value of the Gini coefficients is the weight of the feature.
[0200] In this step, the mean of the Gini coefficients of the feature in all decision trees in the first random forest model is obtained, and the mean of the Gini coefficients is the weight of the feature. Exemplarily, the weight of each feature can be calculated in sequence.
[0201] In step S504, based on the model training matrix and taking the proportion of the feature weight in the sum of the weights of all features as the probability, the feature is randomly selected at the split node, a decision tree is constructed, and a second random forest model is obtained by training. The second random forest model is the target random forest model.
[0202] In this step, the model training matrix Based on the probability, the proportion of the feature weight in the sum of all feature weights is used as the probability, features are randomly selected at the splitting node, a decision tree is constructed, and the second random forest model is trained. The second random forest model is the target random forest model.
[0203] Fig. 9 FIG. 1 is a flowchart of a method for using a target random forest model to monitor abnormal user behavior and protect user data of a human resources management platform according to an exemplary embodiment. Fig. 9 As shown, the use of the target random forest model to monitor abnormal user behavior and protect user data of the human resources management platform may include the following steps:
[0204] In step S601, the target random forest model is used to monitor the portrait vector of the type of user.
[0205] In this step, the target random forest model is used to monitor the portrait vector Y of this type of user.
[0206] In step S602, when the classification of the portrait vector of the type of user in the target random forest model changes, it is determined that there is an abnormal behavior user among the type of users.
[0207] In this step, when the classification of the portrait vector of this type of user in the target random forest model changes, it is determined that there are users with abnormal behavior among this type of users.
[0208] In step S603, the difference in user portrait labels among the type of users with abnormal behavior is obtained, and the user whose difference is greater than 1 is determined as an abnormal behavior user.
[0209] In this step, the difference in user portrait labels among the type of users with abnormal behavior is obtained, and users with a difference greater than 1 are identified as abnormal behavior users.
[0210] In step S604, the account authority of the abnormal behavior user is restricted to protect the user data.
[0211] In this step, the account permissions of users with abnormal behavior are restricted, such as prohibiting them from logging into the system or limiting their operating permissions, in order to protect the platform user data.
[0212] In summary, the embodiment of the present application provides a user data protection method for a human resource management platform, the method comprising: obtaining the behavior data of users of the human resource management platform; establishing a user portrait of the user based on the behavior data of the user, and obtaining a portrait label of the user; performing similarity classification on the user portraits of all users based on the portrait label to obtain multiple types of users; obtaining a model training matrix based on multiple types of users; training a target random forest model based on the model training matrix; and using the target random forest model to monitor abnormal user behavior to complete the protection of user data of the human resource management platform. The embodiment of the present application performs similarity classification on the user portraits of all users to obtain multiple types of users, and uses type users as basic samples for training and detection. Since the number of user samples is reduced, the efficiency of abnormal user behavior detection is improved, the potential safety hazards of the system are reduced, and the system safety factor is improved.
[0213] The present application also provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the user data protection method for the human resources management platform provided by the present application.
[0214] Fig.10 FIG. 1 is a block diagram of a user data protection system of a human resource management platform according to an exemplary embodiment. Fig.10 As shown, an embodiment of the present application provides a user data protection system 1000 for a human resources management platform, including a human resources management platform 1100 .
[0215] Fig.111 is a block diagram of a human resource management platform according to an exemplary embodiment. For example, the human resource management platform 1100 may be provided as a server. Fig.11 The human resource management platform 1100 includes a processor 1122, which further includes one or more processors, and a memory resource represented by a memory 1132 for storing instructions executable by the processor 1122, such as an application. The application stored in the memory 1132 may include one or more modules, each corresponding to a set of instructions. In addition, the processor 1122 is configured to execute instructions to perform the user data protection method of the human resource management platform described above.
[0216] The human resource management platform 1100 may also include a power supply component 1126 configured to perform power management of the human resource management platform 1100, a wired or wireless communication component 1150 configured to connect the human resource management platform 1100 to a network, and an input / output interface 1158. The human resource management platform 1100 may operate based on an operating system stored in the memory 1132.
[0217] In another exemplary embodiment, a computer program product is also provided, which includes a computer program that can be executed by a programmable electronic device, and the computer program has a code portion for executing the user data protection method of the above-mentioned human resource management platform when executed by the programmable electronic device.
[0218] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application.
Claims
1. A user data protection method for a human resources management platform, characterized in that: The method comprises: Obtaining behavioral data of users of the human resources management platform; According to the user's behavior data, a user portrait of the user is established to obtain a portrait label of the user; Based on the portrait tags, similarity classification is performed on the user portraits of all users to obtain multiple types of users; According to the plurality of users of the types, a model training matrix is obtained, including: Obtain the total number of users of the type; obtain the mean of the differences between the portrait labels of all users of the type; obtain the number of behavior sequences of users of the type for training random forests according to the total number of users of the type and the mean of the differences between the portrait labels of all users of the type, wherein the type of users is any type of user; Obtaining the mean of the differences between the portrait labels of all users of the type of users after removing the user; obtaining the preference degree of any user of the type of users according to the mean of the differences between the portrait labels of all users of the type of users and the mean of the differences between the portrait labels of all users of the type of users after removing the user; According to the preference degree of any user in the type of users, the number of users with the aforementioned behavior sequence in the type of users is obtained in descending order, and the portrait vector of the type of users is obtained for training; the portrait vectors of all the type of users are converted into a matrix form to obtain the model training matrix, wherein the portrait vector is a fifth-order row vector; According to the model training matrix, a target random forest model is trained; The target random forest model is used to monitor abnormal user behavior and protect user data of the human resource management platform.
2. The user data protection method of the human resources management platform according to claim 1 is characterized in that: The step of establishing a user portrait of the user according to the user's behavior data and obtaining a portrait tag of the user includes: Obtaining an access interval regularity index of the user; Obtaining the user's access frequency regularity index; Obtaining a regularity index of the user's access duration; Obtaining a regularity index of the user's access address; Obtaining an access device regularity index of the user; According to the access interval regularity index, the access frequency regularity index, the access duration regularity index, the access address regularity index and the access device regularity index, a user portrait of the user is established and a portrait label of the user is obtained.
3. The user data protection method of the human resources management platform according to claim 1 is characterized in that: According to the portrait tags, the user portraits of all users are similarly classified to obtain multiple types of users, including: Obtain the difference between the portrait labels of any two users; According to the difference between the portrait labels of any two users, a region growing algorithm is used to similarly merge the user portraits to obtain multiple types of users, wherein the difference between the portrait labels of any two users of the same type of users is less than or equal to 1.
4. The user data protection method of the human resources management platform according to claim 1 is characterized in that: The step of training the target random forest model according to the model training matrix includes: According to the user portraits of all users, the first random forest model is established; Obtaining a Gini coefficient of a feature in any decision tree in the first random forest model, wherein the feature comes from a user profile of the user; Obtaining a mean value of the Gini coefficients of the feature in all decision trees in the first random forest model, where the mean value of the Gini coefficients is the weight of the feature; Based on the model training matrix, the proportion of the weight of the feature in the sum of the weights of all features is used as the probability, the feature is randomly selected at the split node, a decision tree is constructed, and a second random forest model is obtained by training. The second random forest model is the target random forest model.
5. The user data protection method of the human resources management platform according to claim 1 is characterized in that: The method of using the target random forest model to monitor abnormal user behavior and protect user data of the human resources management platform includes: Using the target random forest model to monitor the portrait vectors of the type of users; When the classification of the portrait vector of the type of user in the target random forest model changes, it is determined that there is an abnormal behavior user among the type of users; Obtain the difference in user portrait labels among the type of users with abnormal behavior, and determine the user whose difference is greater than 1 as the abnormal behavior user; The account permissions of the user with abnormal behavior are restricted to protect the user data.
6. A user data protection system for a human resources management platform, characterized in that: The system includes a human resources management platform, and the human resources management platform includes: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Image construction and classification method and system based on data dimension reduction method
CN115619245A
User state portrait anomaly monitoring method based on random forest
CN117692196A