A user data efficient storage method and system for security assessment system
By obtaining and optimizing psychological test scores in the psychological safety assessment system and constructing a dynamic change capture mechanism, the problem of difficulty in analyzing dynamic changes in the user's psychological state in the existing technology is solved, and a more accurate mental health assessment is achieved.
Patent Information
- Application Number
- CN202411170636.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-08-26
AI Technical Summary
The prior art is difficult to effectively capture and analyze the dynamic changes in the user's psychological state, resulting in the evaluation results being unable to accurately reflect the user's true mental health status.
By obtaining the test scores of each psychological safety test type at each sampling moment, a sample data sequence is constructed, and the score sensitivity factor and the state transition sensitivity factor are used for optimization, and the optimized sample data sequence is obtained and stored in clusters.
It achieves a more comprehensive and accurate capture of the complex dynamic changes in the user's psychological state, deeply explores the individual differences of each sample, and improves the accuracy of mental health assessment.
Smart Images

Figure CN118709004B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data analysis, and in particular to a method and system for efficiently storing user data for a security assessment system. Background Art
[0002] Psychological safety assessment systems usually use traditional data analysis methods to process and analyze users’ psychological state data. These methods mainly rely on the original test result data, through simple statistical analysis or basic machine learning algorithms ( This method can evaluate and classify the user's mental state based on the test score to a certain extent, providing basic support for mental health management.
[0003] The main problem with traditional methods when dealing with complex psychological state data is that it is difficult to effectively capture and analyze the dynamic changes in the user's psychological state. Directly using the original test scores for cluster analysis fails to explore the characteristics of the sample's psychological state changing over time, nor does it consider the individual differences between different samples. This results in the evaluation results being unable to accurately reflect the user's true mental health status. For example, the same score does not mean that the sample's psychological state is similar, and a score that fluctuates within the normal range cannot fully explain the sample's psychological safety.
[0004] Therefore, it is an urgent problem to propose a method and system for efficiently storing user data for a security assessment system to solve the difficulties existing in the prior art. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and system for efficiently storing user data for a security assessment system to solve the problem of inaccurate reflection of the user's mental health status.
[0006] In a first aspect, an embodiment of the present invention provides a method for efficiently storing user data for a security assessment system, the method comprising the following steps:
[0007] At each sampling moment, the test score corresponding to each psychological safety test type is obtained to form the sample data at the corresponding sampling moment, and all the sample data within a preset time period are formed into a sample data sequence;
[0008] For any sample data in the sample data sequence, a sample data window constructed with the sample data as the center is obtained, any psychological safety test type in the sample data window is taken as the target type, and according to the changes of all test scores belonging to the target type in the sample data window, a score sensitivity factor of the test score belonging to the target type in the sample data is obtained;
[0009] According to the data periodicity and data volatility corresponding to each psychological safety test type in the sample data sequence, a state transition sensitivity factor of the sample data sequence is obtained, and by using the state transition sensitivity factor, a score sensitivity factor of the test score of the target type in the sample data is factor-optimized to obtain an optimized score sensitivity factor of the test score of the target type in the sample data;
[0010] numerically optimizing the test scores of the target type in the sample data using the optimized score sensitivity factor to obtain an optimized test score, and obtaining an optimized sample data sequence according to the optimized test score corresponding to each test score of each sample data in the sample data sequence;
[0011] At least two of the optimized sample data sequences are obtained, all the optimized sample data sequences are clustered to obtain corresponding clustering results, and the data are classified and stored according to the clustering results.
[0012] Preferably, the step of obtaining the score sensitivity factor of the test score belonging to the target type in the sample data according to the changes of all test scores belonging to the target type in the sample data window includes:
[0013] Obtaining the first test score and the last test score corresponding to the target type in the sample data window, obtaining the score difference between the first test score and the last test score, and calculating the score ratio between the score difference and the first test score;
[0014] Obtaining a timestamp difference according to the timestamp of the first test score and the timestamp of the last test score, and performing negative mapping on the product of the timestamp difference and a preset time decay coefficient by using an exponential function with a natural constant as a base, to obtain a corresponding mapping value;
[0015] A multiplication result between the score ratio and the mapping value is obtained, and a sum of a constant 1 and the multiplication result is used as a score sensitivity factor of the test score belonging to the target type in the sample data.
[0016] Preferably, the step of obtaining the state transition sensitivity factor of the sample data sequence according to the data periodicity and data volatility corresponding to each psychological safety test type in the sample data sequence comprises:
[0017] Respectively obtaining an average value and a linear regression slope of all test scores of each psychological safety test type in the sample data sequence, and obtaining a long-term state change trend indicator of the sample data sequence according to the average value and the linear regression slope of all test scores of each psychological safety test type in the sample data sequence;
[0018] Respectively obtaining the standard deviation and the average value of all test scores of each psychological safety test type in the sample data sequence, and obtaining the state fluctuation intensity of the sample data sequence according to the standard deviation and the average value of all test scores of each psychological safety test type in the sample data sequence;
[0019] Respectively obtaining the autocorrelation functions of all test scores of each psychological safety test type in the sample data sequence, and obtaining the periodic pattern strength of the sample data sequence according to the autocorrelation functions of all test scores of each psychological safety test type in the sample data sequence;
[0020] The state transition sensitivity factor of the sample data sequence is obtained according to the long-term state change trend indicator, the state fluctuation intensity and the periodic pattern intensity.
[0021] Preferably, the long-term state change trend indicator of the sample data sequence is obtained according to the average value and linear regression slope of all test scores of each psychological safety test type in the sample data sequence, including:
[0022] For any psychological safety test type in the sample data sequence, obtaining a test score sequence corresponding to the psychological safety test type in the sample data sequence, calculating a test score mean and a linear regression slope of the test score sequence, and obtaining a first ratio of the test score mean and the linear regression slope;
[0023] According to the first ratio corresponding to each psychological safety test type in the sample data sequence, the first ratio mean is calculated, the first ratio mean is normalized, and the obtained result is used as the long-term state change trend indicator of the sample data sequence.
[0024] Preferably, obtaining the state fluctuation intensity of the sample data sequence according to the standard deviation and the average value of all test scores of each psychological safety test type in the sample data sequence comprises:
[0025] For any psychological safety test type in the sample data sequence, obtaining a test score sequence corresponding to the psychological safety test type in the sample data sequence, calculating a test score mean and a standard deviation of the test score sequence, and obtaining a second ratio of the test score mean to the standard deviation;
[0026] According to the second ratio corresponding to each psychological safety test type in the sample data sequence, the second ratio mean is calculated, the second ratio mean is normalized, and the obtained result is used as the state fluctuation intensity of the sample data sequence.
[0027] Preferably, obtaining the periodic pattern strength of the sample data sequence according to the autocorrelation function of all test scores of each psychological safety test type in the sample data sequence comprises:
[0028] For any psychological safety test type in the sample data sequence, obtaining a test score sequence corresponding to the psychological safety test type in the sample data sequence, calculating the autocorrelation coefficient of each test score in the test score sequence, and obtaining a maximum autocorrelation coefficient;
[0029] According to the maximum autocorrelation coefficient corresponding to each psychological safety test type in the sample data sequence, the mean of the maximum autocorrelation coefficient is calculated, the mean of the maximum autocorrelation coefficient is normalized, and the obtained result is used as the periodic pattern intensity of the sample data sequence.
[0030] Preferably, obtaining the state transition sensitivity factor of the sample data sequence according to the long-term state change trend indicator, the state fluctuation intensity and the periodic pattern intensity includes:
[0031] Calculate the addition result of the long-term state change trend index, the state fluctuation intensity and the periodic pattern intensity, obtain the ratio of the long-term state change trend index to the addition result as the weight coefficient of the long-term state change trend index, obtain the ratio of the state fluctuation intensity to the addition result as the weight coefficient of the state fluctuation intensity, and obtain the ratio of the periodic pattern intensity to the addition result as the weight coefficient of the periodic pattern intensity;
[0032] Obtain the subtraction result between the long-term state change trend index of a preset multiple and the constant 1, and perform weighted summation on the subtraction result, the state fluctuation intensity and the periodic pattern intensity according to the adaptive weight coefficients of the long-term state change trend index, the state fluctuation intensity and the periodic pattern intensity, and use the weighted summation result as the state transition sensitivity factor of the sample data sequence.
[0033] Preferably, the step of optimizing the score sensitivity factor of the test score of the target type in the sample data by using the state transition sensitivity factor to obtain the optimized score sensitivity factor of the test score of the target type in the sample data includes:
[0034] Obtain the added value between the state transition sensitivity factor and the constant 1, and use the product of the added value and the score sensitivity factor of the test score belonging to the target type in the sample data as the optimized score sensitivity factor of the test score belonging to the target type in the sample data.
[0035] Preferably, the step of numerically optimizing the test scores of the target type in the sample data using the optimized score sensitivity factor to obtain the optimized test scores includes:
[0036] The product of the optimized score sensitivity factor and the test score of the target type in the sample data is used as the optimized test score.
[0037] In a second aspect, an embodiment of the present invention further provides a system for efficiently storing user data for a security assessment system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, it implements a method for efficiently storing user data for a security assessment system as described in the first aspect.
[0038] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0039] The present invention obtains the test score corresponding to each psychological safety test type at each sampling moment to form the sample data of the corresponding sampling moment, and forms all the sample data within a preset time period into a sample data sequence; for any sample data in the sample data sequence, obtains a sample data window constructed with the sample data as the center, takes any psychological safety test type in the sample data window as the target type, and obtains the score sensitivity factor of the test score belonging to the target type in the sample data according to the changes of all test scores belonging to the target type in the sample data window; obtains the state transition factor of the sample data sequence according to the data periodicity and data volatility corresponding to each psychological safety test type in the sample data sequence. The state transition sensitivity factor is converted into a state transition sensitivity factor, and the score sensitivity factor of the test score of the target type in the sample data is optimized by using the state transition sensitivity factor to obtain the optimized score sensitivity factor of the test score of the target type in the sample data; the optimized score sensitivity factor is used to numerically optimize the test score of the target type in the sample data to obtain the optimized test score, and the optimized sample data sequence is obtained according to the optimized test score corresponding to each test score of each sample data in the sample data sequence; at least two optimized sample data sequences are obtained, and all optimized sample data sequences are clustered to obtain corresponding clustering results, and classified and stored according to the clustering results. Among them, the optimized sensitivity factor obtained by optimizing the score sensitivity factor by the obtained state transition sensitivity factor not only considers the short-term local characteristics of the sample data, but also considers the long-term global characteristics in the sample data, and adjusts the obtained psychological safety test data value by analyzing the short-term fluctuations and long-term state changes for different samples, and not only classifies the samples by the test score value, but also deeply explores the individual differences of each sample, so that the mental health assessment system can capture the complex dynamic changes of the user's psychological state more comprehensively and accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0041] Figure 1 This is a method flow chart of a method for efficiently storing user data in a security assessment system provided in Embodiment 1 of the present invention. DETAILED DESCRIPTION
[0042] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, but should not be understood as limiting the present disclosure.
[0043] It should be noted that the terms "first", "second", etc. in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure.
[0044] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0045] See also Figure 1 , is a method flow chart of a method for efficiently storing user data in a security assessment system provided by Embodiment 1 of the present invention, such as Figure 1 As shown, the method may include:
[0046] Step S101, at each sampling moment, the test score corresponding to each psychological safety test type is obtained to form the sample data at the corresponding sampling moment, and all the sample data within a preset time period are formed into a sample data sequence.
[0047] At each sampling moment, the test score corresponding to each psychological safety test type is obtained to form the sample data at the corresponding sampling moment, and all sample data within the preset time period are combined into a sample data sequence X, where X is expressed as: , where m represents the length of the sample data sequence (that is, the total number of sample data), , which represents a large set of test scores corresponding to n types of psychological safety tests. Indicates the first type of psychological safety test, Indicates the second type of psychological safety test, Indicates the nth psychological safety test type. Similarly, obtain at least two sample data sequences , i represents the sequence number of each sample data sequence.
[0048] It is worth noting that psychological safety test types include but are not limited to anxiety, depression, stress, social skills, sleep quality, life satisfaction, adaptability, etc. k represents a data point in the sample data sequence, which represents the set of test scores corresponding to all current psychological safety test types. Represents the timestamp data of the kth data point in the i-th sample data sequence, Indicates the time when the test was completed.
[0049] Step S102, for any sample data in the sample data sequence, obtain a sample data window constructed with the sample data as the center, take any psychological safety test type in the sample data window as the target type, and obtain the score sensitivity factor of the test score belonging to the target type in the sample data according to the changes of all test scores belonging to the target type in the sample data window.
[0050] In the process of clustering the sample data of psychological safety assessment, there is a problem that needs to be solved: how to capture and analyze the dynamic changes and potential risks of the user's psychological state. This problem involves distinguishing the combination of indicators that seem normal but are potentially risky.
[0051] The score sensitivity factor is obtained by obtaining the change rate and time decay coefficient of each psychological indicator in a small window. By analyzing the differences in individual sensitivity to different psychological indicators in the short term and using time decay numbers to emphasize the importance of recent data, we can more accurately evaluate the development trajectory of the user's psychological state.
[0052] Although short-term changes in mental state can be identified through individual sensitivity in a local window, it is necessary to combine long-term data to further quantify individual state fluctuations. For example, although some state transitions are not large in magnitude, they may indicate serious mental health risks; while other seemingly drastic fluctuations may just be normal emotional ups and downs. At the same time, this also shows that the tolerance or recovery degree of different sample individuals is different. Even if the same numerical score is obtained in the test, there are differences between individuals in the comprehensive analysis of the fluctuations of the entire test sequence. This is because the user's mental state is often affected by the complex interaction of multiple factors, not just by the changes in indicators. This complex interaction is not easy to understand in existing tests that use raw test results. difficult to fully capture in analysis.
[0053] In general, the user's psychological resilience and adaptability play a key role in the face of state changes, but these factors are not fully considered in the analysis of the scoring sensitivity factor. Based on the above problems, the obtained scoring sensitivity factor needs to be further optimized. The state transition sensitivity factor is used to measure the amplitude and frequency of state changes, and strengthens the attention to high-risk transition patterns. The state transition sensitivity factor can more accurately analyze the user's mental health trajectory, thereby achieving the purpose of improving the accuracy of mental state assessment.
[0054] In the classification of user data in the psychological safety assessment system, appropriate data analysis needs to be performed first. Since the psychological indicator data of the sample data series has the characteristics of multi-dimensionality, time series, high individual differences and data sparsity, these characteristics make it difficult for traditional data analysis methods to accurately capture and interpret the psychological health trajectory of the sample. For example, a type of psychological safety test has a test score within the normal range for most of the time in the long-term psychological safety test data. But at a certain period, the sample experienced a short and drastic mood swing. Traditional analysis methods will average or even ignore this fluctuation, resulting in different samples being classified into one category simply because the original test data is similar. In addition, the psychological indicators of some sample data series are all within the normal range individually, but the specific combination pattern of these indicators actually suggests hidden psychological stress risks. Traditional methods have difficulty identifying such complex relationships between indicators, resulting in the mental health problems of the sample data series being ignored, or even not discovered until the situation has significantly deteriorated.
[0055] In order to solve the above problems, the calculation of the distance metric DTW is optimized by obtaining the scoring sensitivity factor. First, dynamic time warping DTW is used as the basic distance metric. DTW can handle time series of unequal lengths, which solves the problem of inconsistent recording time of sample data. It allows comparison of changes in the psychological state of different samples throughout the observation period, even if their data recording frequency and duration are different. On this basis, the original data is enhanced by obtaining the scoring sensitivity factor. This takes into account that different samples have different sensitivities to various psychological indicators. For example, some samples are particularly sensitive to a certain type of psychological pressure, while others are more sensitive to other types of pressure. By introducing this factor, it is possible to more accurately explain which data of each sample's psychological state data is more representative of the sample, and highlight the psychological safety characteristics of the sample itself. Then the time decay term is introduced. This is based on the reality that recent data has a greater impact on the current psychological state, which allows us to pay more attention to the drastic emotional fluctuations in a specific period. At the same time, since the test time of each sample is not fixed, the introduction of the time decay term can well balance the contribution of data at different nodes and different periods to the sensitivity calculation.
[0056] Preferably, obtaining the score sensitivity factor of the test score belonging to the target type in the sample data according to the changes of all test scores belonging to the target type in the sample data window includes:
[0057] Obtaining the first test score and the last test score corresponding to the target type in the sample data window, obtaining the score difference between the first test score and the last test score, and calculating the score ratio between the score difference and the first test score;
[0058] Obtaining a timestamp difference according to the timestamp of the first test score and the timestamp of the last test score, and performing negative mapping on the product of the timestamp difference and a preset time decay coefficient by using an exponential function with a natural constant as a base, to obtain a corresponding mapping value;
[0059] A multiplication result between the score ratio and the mapping value is obtained, and a sum of a constant 1 and the multiplication result is used as a score sensitivity factor of the test score belonging to the target type in the sample data.
[0060] The calculation steps for obtaining the scoring sensitivity factor are:
[0061] For any data point k in the i-th sample data sequence, select the nearest consecutive data points as a small window of data point k , for small windows The first Calculate the change rate of the test scores corresponding to the psychological safety test types :
[0062]
[0063] in: Represents the small window corresponding to the data point k in the i-th sample data sequence Neidi The rate of change in test scores for each psychological safety test type, For small window Neidi The last test score of the psychological safety test type, It's a small window Neidi The first test score of the psychological safety test type, The sequence number representing the sample data sequence, Represents different psychological safety test types, Represents a data point in the sample data series.
[0064] Get the score sensitivity factor :
[0065]
[0066] in, represents the first data point k in the i-th sample data sequence The score sensitivity factor for the test scores of the psychological safety test type, is the time attenuation coefficient, e represents a natural constant, Indicates a small window Neidi The timestamp of the last test score of the psychological safety test type, is the time decay factor, Indicates a small window Neidi Timestamp of the first test score of this psychological safety test type, or 1 for a constant.
[0067] when , indicating an upward trend. >1, increase sensitivity; when , indicating a downward trend. <1, reduce sensitivity; when When , it indicates relative stability. ≈1, maintain the original sensitivity. is the time attenuation coefficient, which is set to 0.5 in this embodiment.
[0068] The scoring sensitivity factor is based on the different sensitivity of different samples to various psychological indicators. A sample is particularly sensitive to a certain type of psychological pressure, but less sensitive to other types of pressure. By introducing the scoring sensitivity factor, the psychological state data of each sample can be explained more accurately. Time decay factor Based on the reality that recent data has a greater impact on the current psychological state, the influence of data points with larger sampling intervals will gradually decrease, making the importance of short-term changes more important. The parameter controls the rate of attenuation and can be adjusted according to the specific application scenario.
[0069] Step S103, according to the data periodicity and data volatility corresponding to each psychological safety test type in the sample data sequence, obtain the state transition sensitivity factor of the sample data sequence, and use the state transition sensitivity factor to optimize the score sensitivity factor of the test score belonging to the target type in the sample data to obtain the optimized score sensitivity factor of the test score belonging to the target type in the sample data.
[0070] Preferably, the step of obtaining the state transition sensitivity factor of the sample data sequence according to the data periodicity and data volatility corresponding to each psychological safety test type in the sample data sequence comprises:
[0071] Respectively obtaining an average value and a linear regression slope of all test scores of each psychological safety test type in the sample data sequence, and obtaining a long-term state change trend indicator of the sample data sequence according to the average value and the linear regression slope of all test scores of each psychological safety test type in the sample data sequence;
[0072] Respectively obtaining the standard deviation and the average value of all test scores of each psychological safety test type in the sample data sequence, and obtaining the state fluctuation intensity of the sample data sequence according to the standard deviation and the average value of all test scores of each psychological safety test type in the sample data sequence;
[0073] Respectively obtaining the autocorrelation functions of all test scores of each psychological safety test type in the sample data sequence, and obtaining the periodic pattern strength of the sample data sequence according to the autocorrelation functions of all test scores of each psychological safety test type in the sample data sequence;
[0074] The state transition sensitivity factor of the sample data sequence is obtained according to the long-term state change trend indicator, the state fluctuation intensity and the periodic pattern intensity.
[0075] The score sensitivity factor is used to optimize each test result of each psychological safety test type. It can effectively capture the changes in psychological state in the short term but cannot fully reflect the long-term psychological state change pattern of the user. For example, the test results of some psychological safety test types show a relatively stable psychological state in the short term, but in the long run, their mental health may show a slow change trend. On the other hand, some psychological safety test types experience frequent mood swings but there is no obvious deterioration trend overall. Some users will show periodic changes in their psychological state, such as an increase in anxiety index at the end of the month when work pressure is high. These complex long-term change patterns and individual differences in psychological tolerance are ignored in local window analysis, which in turn affects the accuracy of psychological safety assessment clustering.
[0076] In order to solve the above problems, it is necessary to extract features from the overall data sequence of each type of psychological safety test and obtain the state transition sensitive factor Further optimize the scoring sensitivity factor. State transition sensitivity factor The acquisition is based on three key features: long-term state change trend indicators , State Fluctuation Intensity and the periodic pattern intensity By comprehensively analyzing these characteristics, we can more comprehensively capture the long-term change pattern of the sample's psychological state, and then optimize the details of the score sensitivity factor (short-term fluctuations) based on the long-term characteristics of the sample. The specific instructions are as follows:
[0077] Long-term state change trend indicator It reflects the overall direction and speed of change in the psychological state. For example, a college student may show a low stress level at the beginning of the semester, but as the final exam approaches, his stress index may show a gradual upward trend. And the same measurement value between different college student samples does not mean the same characteristic pattern, which includes individual differences. Therefore, by analyzing the difference in this long-term trend, the scoring sensitivity factor is adjusted to achieve the purpose of highlighting individual differences.
[0078] State Fluctuation Intensity It reflects the severity of changes in mental state. If some samples experience frequent mood swings, for example, a patient with bipolar disorder sometimes experiences multiple large mood swings in a short period of time. Although these fluctuations may be considered normal changes locally, from the overall data series, high-frequency large fluctuations indicate more serious mental health problems.
[0079] Periodic pattern strength Used to identify cyclical changes in mental states. For example, a professional is more likely to show high anxiety levels during the performance review period each month, but relatively calm at the beginning of the month. By identifying this cyclical pattern, the system can issue early warnings during specific periods and provide targeted support.
[0080] By combining these three features, we can obtain the state transition sensitivity factor It can provide a more comprehensive and dynamic perspective to evaluate the mental health status of different samples. For a user who has been in a high-pressure work environment for a long time, even if his daily psychological indicators do not fluctuate much, if the system detects that the stress index shows a slow but continuous upward trend, For a depressed patient who is receiving psychotherapy, if the system finds that the intensity of his mood swings is gradually decreasing and the frequency of periodic low moods is also decreasing, The value will decrease accordingly, reflecting the positive effect of treatment.
[0081] Therefore, by combining the score sensitivity factor with the global state transition sensitivity factor, an optimized adjustment vector is obtained that can reflect both short-term changes and capture long-term trends. This enables the psychological safety assessment system to more accurately distinguish the mental health status of each sample.
[0082] Preferably, the long-term state change trend indicator of the sample data sequence is obtained according to the average value and linear regression slope of all test scores of each psychological safety test type in the sample data sequence, including:
[0083] For any psychological safety test type in the sample data sequence, obtaining a test score sequence corresponding to the psychological safety test type in the sample data sequence, calculating a test score mean and a linear regression slope of the test score sequence, and obtaining a first ratio of the test score mean and the linear regression slope;
[0084] According to the first ratio corresponding to each psychological safety test type in the sample data sequence, the first ratio mean is calculated, the first ratio mean is normalized, and the obtained result is used as the long-term state change trend indicator of the sample data sequence.
[0085] The calculation steps for obtaining the state transition sensitivity factor are:
[0086] Long-term state change trend indicator of the i-th sample data sequence :
[0087]
[0088] in, A normalized function representing the maximum and minimum values; The linear regression slope of all test scores of the jth psychological safety test type in the i-th sample data sequence reflects the rate of change of the indicator over time; represents the average of all test scores of the jth psychological safety test type in the i-th sample data sequence, which is used for normalization to make indicators of different magnitudes comparable; n represents the number of psychological safety test types, Ensure different psychological safety test types, The range of values remains consistent, with positive T values indicating an overall upward trend, negative T values indicating an overall downward trend, and the absolute size of the T value reflecting the speed of change.
[0089] Preferably, the state fluctuation intensity of the sample data sequence is obtained according to the standard deviation and the average value of all test scores of each psychological safety test type in the sample data sequence, including:
[0090] For any psychological safety test type in the sample data sequence, obtaining a test score sequence corresponding to the psychological safety test type in the sample data sequence, calculating a test score mean and a standard deviation of the test score sequence, and obtaining a second ratio of the test score mean to the standard deviation;
[0091] According to the second ratio corresponding to each psychological safety test type in the sample data sequence, the second ratio mean is calculated, the second ratio mean is normalized, and the obtained result is used as the state fluctuation intensity of the sample data sequence.
[0092] The state fluctuation intensity of the i-th sample data sequence :
[0093]
[0094] in, is the standard deviation of all test scores of the j-th psychological safety test type in the ith sample data sequence, reflecting the degree of dispersion of the data. is the average of all test scores of the j-th psychological safety test type in the i-th sample data sequence, which is used for normalization.
[0095] This formula calculates the average coefficient of variation for all psychological indicators. , calculate the ratio of its standard deviation to the mean (i.e., coefficient of variation), and then average all indicators. Using the coefficient of variation instead of directly using the standard deviation can eliminate the dimensional differences between different indicators. A larger V value indicates a more volatile psychological state, while a smaller V value indicates a more volatile psychological state. The value indicates relative stability.
[0096] Preferably, obtaining the periodic pattern strength of the sample data sequence according to the autocorrelation function of all test scores of each psychological safety test type in the sample data sequence comprises:
[0097] For any psychological safety test type in the sample data sequence, obtaining a test score sequence corresponding to the psychological safety test type in the sample data sequence, calculating the autocorrelation coefficient of each test score in the test score sequence, and obtaining a maximum autocorrelation coefficient;
[0098] According to the maximum autocorrelation coefficient corresponding to each psychological safety test type in the sample data sequence, the mean of the maximum autocorrelation coefficient is calculated, the mean of the maximum autocorrelation coefficient is normalized, and the obtained result is used as the periodic pattern intensity of the sample data sequence.
[0099] The intensity of the periodic pattern of the i-th sample data sequence :
[0100]
[0101] in, represents the autocorrelation coefficient of any test score of the j-th psychological safety test type in the i-th sample data sequence, It represents the maximum autocorrelation coefficient corresponding to the j-th psychological safety test type in the i-th sample data sequence, reflecting the strongest periodic pattern in the time series.
[0102] This formula calculates the average maximum autocorrelation coefficients of all psychological safety test types (excluding autocorrelations when lag=0). The average of the maximum autocorrelation coefficients corresponding to all psychological safety test types is taken to obtain the overall strength of cyclicality. Larger P values indicate the presence of significant cyclical patterns, and smaller P values indicate that cyclicality is not significant.
[0103] Preferably, obtaining the state transition sensitivity factor of the sample data sequence according to the long-term state change trend indicator, the state fluctuation intensity and the periodic pattern intensity includes:
[0104] Calculate the addition result of the long-term state change trend index, the state fluctuation intensity and the periodic pattern intensity, obtain the ratio of the long-term state change trend index to the addition result as the weight coefficient of the long-term state change trend index, obtain the ratio of the state fluctuation intensity to the addition result as the weight coefficient of the state fluctuation intensity, and obtain the ratio of the periodic pattern intensity to the addition result as the weight coefficient of the periodic pattern intensity;
[0105] Obtain the subtraction result between the long-term state change trend index of a preset multiple and the constant 1, and perform weighted summation on the subtraction result, the state fluctuation intensity and the periodic pattern intensity according to the adaptive weight coefficients of the long-term state change trend index, the state fluctuation intensity and the periodic pattern intensity, and use the weighted summation result as the state transition sensitivity factor of the sample data sequence.
[0106] Adaptive weight coefficient:
[0107]
[0108]
[0109]
[0110] in, Long-term state change trend indicator The weight coefficient of is the state fluctuation intensity The weight coefficient of is the periodic pattern strength The weight coefficient of .
[0111] State transition sensitivity factor of the i-th sample data sequence calculate:
[0112]
[0113] State transition sensitivity factor The long-term trend, volatility and periodicity are combined to obtain an overall sensitivity factor. Will Map from [0, 1] to [-1, 1]. The time value is , remain neutral. A negative time value indicates a downward trend. A positive time value indicates an upward trend. : Increase sensitivity; : Reduce sensitivity; : Basically maintain the current sensitivity.
[0114] Preferably, using the state transition sensitivity factor, factor optimization is performed on the score sensitivity factor of the test score belonging to the target type in the sample data to obtain the optimized score sensitivity factor of the test score belonging to the target type in the sample data, including:
[0115] Obtain the added value between the state transition sensitivity factor and the constant 1, and use the product of the added value and the score sensitivity factor of the test score belonging to the target type in the sample data as the optimized score sensitivity factor of the test score belonging to the target type in the sample data.
[0116] Optimize the scoring sensitivity factor calculation:
[0117]
[0118] in, represents the first data point k in the i-th sample data sequence Optimized score sensitivity factors for test scores of psychological safety test types, is the state transition sensitivity factor of the i-th sample data sequence, is the kth data point in the i-th sample data sequence. Score sensitivity factor for test scores for each psychological safety test type, where 1 represents a constant.
[0119] It is an optimized scoring sensitivity factor that comprehensively considers short-term local features and long-term global features. By comprehensively analyzing long-term trends, fluctuation intensity and periodic patterns, it realizes the dynamic optimization of the original sensitivity factor, so that the mental health assessment system can capture the complex dynamic changes of the user's mental state more comprehensively and accurately.
[0120] Step S104, using the optimized score sensitivity factor to numerically optimize the test score belonging to the target type in the sample data to obtain an optimized test score, and obtaining an optimized sample data sequence based on the optimized test score corresponding to each test score of each sample data in the sample data sequence.
[0121] Preferably, numerically optimizing the test scores of the target type in the sample data using the optimized score sensitivity factor to obtain the optimized test scores includes:
[0122] The product of the optimized score sensitivity factor and the test score of the target type in the sample data is used as the optimized test score.
[0123] The optimization test scores are:
[0124]
[0125] in, represents the first data point k in the i-th sample data sequence Optimized test scoring for psychological safety test types, represents the first data point k in the i-th sample data sequence Optimized score sensitivity factors for test scores of psychological safety test types, is the kth data point in the i-th sample data sequence. Test scoring for the psychological safety test type.
[0126] Refer to the data point k in the above i-th sample data sequence A method for obtaining optimized test scores of psychological safety test types is provided, and the optimized test scores of each psychological safety test type of each data point in the i-th sample data sequence are obtained respectively, so as to form the i-th optimized sample data sequence. At this point, the optimization of the i-th sample data sequence is completed.
[0127] Step S105, obtaining at least two of the optimized sample data sequences, clustering all the optimized sample data sequences to obtain corresponding clustering results, and classifying and storing them according to the clustering results.
[0128] Referring to the method for obtaining the i-th optimized sample data sequence, multiple optimized sample data sequences are obtained respectively, and then all optimized sample data sequences are clustered using the k-means clustering algorithm to obtain multiple clusters, and the sample data in each cluster is classified and stored separately. The clustering process is:
[0129] (1) Perform DTW distance calculation on the optimized sample sequence to obtain the DTW distance between samples.
[0130] The final sample sequence is Calculate and use the similarity between samples as The distance metric of clustering, the data points in the two samples are multidimensional vectors, representing the psychological evaluation index at a certain moment. First, the distance matrix is constructed using the Euclidean distance, and then the similarity of the two samples is determined based on the minimum cost distance of the cumulative matrix. The distance between two samples used for clustering.
[0131] (2) Using the elbow function to determine the optimal number of clusters .
[0132] Using the elbow rule to determine the optimal number of clusters By calculating different The intra-cluster sum of squares corresponding to the value and the analysis of the intra-cluster sum of squares with The curve of the change is selected as the best curve "elbow" value.
[0133] (3) Obtained using the elbow rule The value and the obtained DTW distance between samples are used as the distance metric between samples to complete Cluster calculation.
[0134] Obtained using the elbow method The value and the obtained DTW distance between samples are used as the distance metric between samples. The algorithm randomly selects The initial center point is then iterated to perform sample allocation and center point update until convergence or the preset number of iterations is reached. Cluster calculation.
[0135] After clustering is completed, a unique identifier is assigned to each cluster, and the sample data belonging to the same cluster is stored together, so as to quickly retrieve similar sample groups, improve data access efficiency, and provide a basis for subsequent analysis.
[0136] In summary, the present invention obtains the test score corresponding to each psychological safety test type at each sampling moment to form the sample data of the corresponding sampling moment, and all the sample data within a preset time period form a sample data sequence; for any sample data in the sample data sequence, a sample data window constructed with the sample data as the center is obtained, and any psychological safety test type in the sample data window is taken as the target type, and according to the changes of all test scores belonging to the target type in the sample data window, the score sensitivity factor of the test score belonging to the target type in the sample data is obtained; according to the data periodicity and data volatility corresponding to each psychological safety test type in the sample data sequence, the score sensitivity factor of the sample data sequence is obtained. State transition sensitivity factor, using the state transition sensitivity factor, factor optimization is performed on the score sensitivity factor of the test score belonging to the target type in the sample data, and the optimized score sensitivity factor of the test score belonging to the target type in the sample data is obtained; using the optimized score sensitivity factor, numerical optimization is performed on the test score belonging to the target type in the sample data, and the optimized test score is obtained; according to the optimized test score corresponding to each test score of each sample data in the sample data sequence, the optimized sample data sequence is obtained; at least two of the optimized sample data sequences are obtained, and all the optimized sample data sequences are clustered to obtain corresponding clustering results, and classified and stored according to the clustering results. Among them, the optimized sensitivity factor obtained by optimizing the score sensitivity factor by the obtained state transition sensitivity factor not only considers the short-term local characteristics of the sample data, but also considers the long-term global characteristics in the sample data, and adjusts the obtained psychological safety test data value by analyzing short-term fluctuations and long-term state changes for different samples, and not only classifies the samples by the test score value, but also deeply explores the individual differences of each sample, so that the mental health assessment system can capture the complex dynamic changes of the user's psychological state more comprehensively and accurately.
[0137] Based on the same inventive concept as the above method, an embodiment of the present invention also provides a system for efficiently storing user data for a security assessment system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of any one of the above methods for efficiently storing user data for a security assessment system are implemented.
[0138] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A method for efficiently storing user data for a security assessment system, characterized in that: The method comprises: At each sampling moment, the test score corresponding to each psychological safety test type is obtained to form the sample data at the corresponding sampling moment, and all the sample data within a preset time period are formed into a sample data sequence; For any sample data in the sample data sequence, a sample data window constructed with the sample data as the center is obtained, any psychological safety test type in the sample data window is taken as the target type, and according to the changes of all test scores belonging to the target type in the sample data window, a score sensitivity factor of the test score belonging to the target type in the sample data is obtained; According to the data periodicity and data volatility corresponding to each psychological safety test type in the sample data sequence, a state transition sensitivity factor of the sample data sequence is obtained, and by using the state transition sensitivity factor, a score sensitivity factor of the test score of the target type in the sample data is factor-optimized to obtain an optimized score sensitivity factor of the test score of the target type in the sample data; Using the optimized score sensitivity factor, numerically optimize the test score of the target type in the sample data to obtain an optimized test score, and compose an optimized sample data sequence with the optimized test score corresponding to each test score of each sample data in the sample data sequence; Obtain at least two of the optimized sample data sequences, cluster all the optimized sample data sequences to obtain corresponding clustering results, and classify and store them according to the clustering results; The step of obtaining the score sensitivity factor of the test score belonging to the target type in the sample data according to the changes of all the test scores belonging to the target type in the sample data window includes: Obtaining the first test score and the last test score corresponding to the target type in the sample data window, obtaining the score difference between the first test score and the last test score, and calculating the score ratio between the score difference and the first test score; Obtaining a timestamp difference according to the timestamp of the first test score and the timestamp of the last test score, and performing negative mapping on the product of the timestamp difference and a preset time decay coefficient by using an exponential function with a natural constant as a base, to obtain a corresponding mapping value; Obtaining a multiplication result between the score ratio and the mapping value, and taking a sum of a constant 1 and the multiplication result as a score sensitivity factor of a test score belonging to the target type in the sample data; The step of obtaining the state transition sensitivity factor of the sample data sequence according to the data periodicity and data volatility corresponding to each psychological safety test type in the sample data sequence includes: Respectively obtaining an average value and a linear regression slope of all test scores of each psychological safety test type in the sample data sequence, and obtaining a long-term state change trend indicator of the sample data sequence according to the average value and the linear regression slope of all test scores of each psychological safety test type in the sample data sequence; Respectively obtaining the standard deviation and the average value of all test scores of each psychological safety test type in the sample data sequence, and obtaining the state fluctuation intensity of the sample data sequence according to the standard deviation and the average value of all test scores of each psychological safety test type in the sample data sequence; Respectively obtaining the autocorrelation functions of all test scores of each psychological safety test type in the sample data sequence, and obtaining the periodic pattern strength of the sample data sequence according to the autocorrelation functions of all test scores of each psychological safety test type in the sample data sequence; Obtaining a state transition sensitivity factor of the sample data sequence according to the long-term state change trend indicator, the state fluctuation intensity and the periodic pattern intensity; The step of optimizing the score sensitivity factor of the test score of the target type in the sample data by using the state transition sensitivity factor to obtain the optimized score sensitivity factor of the test score of the target type in the sample data includes: Obtaining a sum of the state transition sensitivity factor and a constant 1, and taking the product of the sum and the score sensitivity factor of the test score of the target type in the sample data as the optimized score sensitivity factor of the test score of the target type in the sample data; The step of numerically optimizing the test scores of the target type in the sample data by using the optimized score sensitivity factor to obtain the optimized test scores includes: The product of the optimized score sensitivity factor and the test score of the target type in the sample data is used as the optimized test score.
2. The method for efficiently storing user data for a security assessment system according to claim 1, characterized in that: The long-term state change trend indicator of the sample data sequence is obtained according to the average value and linear regression slope of all test scores of each psychological safety test type in the sample data sequence, including: For any psychological safety test type in the sample data sequence, obtaining a test score sequence corresponding to the psychological safety test type in the sample data sequence, calculating a test score mean and a linear regression slope of the test score sequence, and obtaining a first ratio of the test score mean and the linear regression slope; According to the first ratio corresponding to each psychological safety test type in the sample data sequence, the first ratio mean is calculated, the first ratio mean is normalized, and the obtained result is used as the long-term state change trend indicator of the sample data sequence.
3. The method for efficiently storing user data for a security assessment system according to claim 1, characterized in that: The step of obtaining the state fluctuation intensity of the sample data sequence according to the standard deviation and the average value of all test scores of each psychological safety test type in the sample data sequence comprises: For any psychological safety test type in the sample data sequence, obtaining a test score sequence corresponding to the psychological safety test type in the sample data sequence, calculating a test score mean and a standard deviation of the test score sequence, and obtaining a second ratio of the test score mean to the standard deviation; According to the second ratio corresponding to each psychological safety test type in the sample data sequence, the second ratio mean is calculated, the second ratio mean is normalized, and the obtained result is used as the state fluctuation intensity of the sample data sequence.
4. The method for efficiently storing user data for a security assessment system according to claim 1, characterized in that: The step of obtaining the periodic pattern strength of the sample data sequence according to the autocorrelation function of all test scores of each psychological safety test type in the sample data sequence comprises: For any psychological safety test type in the sample data sequence, obtaining a test score sequence corresponding to the psychological safety test type in the sample data sequence, calculating the autocorrelation coefficient of each test score in the test score sequence, and obtaining a maximum autocorrelation coefficient; According to the maximum autocorrelation coefficient corresponding to each psychological safety test type in the sample data sequence, the mean of the maximum autocorrelation coefficient is calculated, the mean of the maximum autocorrelation coefficient is normalized, and the obtained result is used as the periodic pattern intensity of the sample data sequence.
5. The method for efficiently storing user data for a security assessment system according to claim 1, characterized in that: The step of obtaining the state transition sensitivity factor of the sample data sequence according to the long-term state change trend indicator, the state fluctuation intensity and the periodic pattern intensity includes: Calculate the addition result of the long-term state change trend index, the state fluctuation intensity and the periodic pattern intensity, obtain the ratio of the long-term state change trend index to the addition result as the weight coefficient of the long-term state change trend index, obtain the ratio of the state fluctuation intensity to the addition result as the weight coefficient of the state fluctuation intensity, and obtain the ratio of the periodic pattern intensity to the addition result as the weight coefficient of the periodic pattern intensity; Obtain the subtraction result between the long-term state change trend index of a preset multiple and the constant 1, and perform weighted summation on the subtraction result, the state fluctuation intensity and the periodic pattern intensity according to the adaptive weight coefficients of the long-term state change trend index, the state fluctuation intensity and the periodic pattern intensity, and use the weighted summation result as the state transition sensitivity factor of the sample data sequence.
6. A user data efficient storage system for a security assessment system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of a method for efficiently storing user data for a security assessment system as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Intelligent storage method for data of rehabilitation information platform for disabled children
CN118012876A
Film and television content optimization recommendation method based on big data
CN118245634A