Data processing method, device, equipment and storage medium
By combining device detection data with depression scale data, using replacement relationship tables and data prediction models, the problem of low accuracy of existing depression assessment methods is solved, early identification and timely intervention are achieved, and the accuracy of depression assessment is improved. Sex and credibility.
Patent Information
- Application Number
- CN202410673582.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-05-28
AI Technical Summary
The existing depression assessment methods mainly rely on scales and questionnaires, which are difficult to identify and intervene in early stages. Due to high subjectivity, the accuracy of the test results is low, which affects the treatment effect.
By obtaining the device detection data and scale data of the target object, the replacement relationship table is used to replace the features in the scale data with device detection data, and combining the data prediction model to predict depression levels, reducing subjective impact and improving accuracy.
It improves the accuracy and credibility of depression assessment, can identify depressive symptoms early, intervene in a timely manner, and reduces the aggravation of the disease.
Smart Images

Figure CN118553408B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data processing method, device, equipment and storage medium. Background Art
[0002] Depression is a common disease characterized by significant and persistent low mood. In severe cases, patients may engage in aggressive behavior, which greatly affects their lives. Existing methods for evaluating depression generally use scales or questionnaires. Individuals at risk of depression or with depressive symptoms can only be identified when depression develops. Therefore, it is difficult to conduct early intervention and treatment, which affects the treatment time and worsens the condition. In addition, when using scales or questionnaires, overly subjective filling out will lead to low accuracy of test results. Summary of the invention
[0003] The present application provides a data processing method, apparatus, device and storage medium. In this solution, the device detection data is replaced into the scale data, so as to predict the depression level of the object according to the replaced scale data, avoid the influence of the subjective opinion of the target object, and improve the accuracy and credibility of the determination result.
[0004] In a first aspect, the present application provides a data processing method, which is applied to a server, wherein the server is connected to a terminal device, and the method comprises:
[0005] Acquire target scale data of the target object and multiple target device detection data in a first time period, the scale data includes multiple first feature data, and the device detection data includes multiple second feature data;
[0006] Determine a plurality of first feature data and a plurality of second feature data according to the plurality of target device detection data, wherein the first feature data represents a vector sequence composed of data corresponding to a single second feature in the plurality of target device detection data, and the second feature data represents an incremental relationship between every N adjacent data in the first feature data, where N is a positive integer;
[0007] Replacing the target first feature and the corresponding data in the target scale data with the target second feature and the corresponding data in the plurality of first feature data respectively according to the replacement relationship table, to obtain the replaced target scale data, wherein the replacement relationship table includes the association relationship between different first features to be replaced and different second features for replacement;
[0008] Calling a data prediction model to predict the replaced target scale data, the plurality of first feature data, and the plurality of second feature data to obtain a prediction label of the data prediction model, wherein the prediction label represents a predicted depression level of the target object;
[0009] The predicted label is sent to the terminal device.
[0010] In a second aspect, the present application provides a data processing device, the device comprising:
[0011] An acquisition unit, the acquisition module is used to acquire target scale data of the target object and multiple target device detection data in a first period, the scale data includes multiple first feature data, and the device detection data includes multiple second feature data;
[0012] A determination unit, the determination module is used to determine a plurality of first feature data and a plurality of second feature data according to the plurality of target device detection data, the first feature data represents a vector sequence composed of data corresponding to a single second feature in the plurality of target device detection data, and the second feature data represents an incremental relationship between every N adjacent data in the first feature data, where N is a positive integer;
[0013] A replacement unit, the replacement module is used to replace the target first feature and the corresponding data in the target scale data with the target second feature and the corresponding data in the plurality of first feature data according to a replacement relationship table, to obtain the replaced target scale data, wherein the replacement relationship table includes an association relationship between different first features to be replaced and different second features for replacement;
[0014] A calling unit, the calling module is used to call a data prediction model to predict the replaced target scale data, the plurality of first feature data and the plurality of second feature data, and obtain a prediction label of the data prediction model, wherein the prediction label represents the predicted depression level of the target object;
[0015] A sending unit, wherein the sending module is used to send the predicted label to the terminal device.
[0016] In a third aspect, an embodiment of the present application provides a terminal device, comprising at least one processor, a communication interface and a memory, wherein the communication interface is used to send and / or receive data, the memory is used to store a computer program, and the at least one processor is used to call the computer program stored in the memory to implement any method as described in the first aspect of the present application.
[0017] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a processor, a communication module, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any method of the first aspect of the present application.
[0018] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in any method of the first aspect of the embodiment of the present application.
[0019] In a sixth aspect, the present application provides a computer program, wherein the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the present application. The computer program may be a software installation package.
[0020] It can be seen that in the embodiment of the present application, the target scale data of the target object and the multiple target device detection data in the first time period are obtained; multiple first feature data and multiple second feature data are determined according to the multiple target device detection data, the first feature data represents a vector sequence composed of data corresponding to a single second feature in the multiple target device detection data, the second feature data represents the incremental relationship between every N adjacent data in the first feature data, the first feature data is continuous data in the first time period, and the second feature data reflects the incremental relationship of the feature data, and the prediction result is obtained through the first feature data and the second feature data to improve the accuracy of the prediction result; according to the replacement relationship table, the target first feature and the corresponding data in the target scale data are replaced with the target second feature and the corresponding data in the multiple first feature data, respectively, to obtain the replaced target scale data; call the data prediction model to predict the replaced target scale data, the multiple first feature data and the multiple second feature data, and obtain the prediction label of the data prediction model that represents the depression level; send the prediction label to the terminal device. Part of the data in the target scale data is replaced by the data in the terminal detection data, which reduces the subjective judgment of the target object and improves the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of a connection between a server and a terminal device provided in an embodiment of the present application;
[0024] Figure 3A flowchart of a data processing method provided in an embodiment of the present application;
[0025] Figure 4 A block diagram of the functional units of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0028] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0029] The relevant terms of this application are explained below.
[0030] Related terms:
[0031] The Hamilton Depression Rating Scale (HAMD) is the most commonly used scale for clinical assessment of depression.
[0032] See also Figure 1 , Figure 1 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device includes a processor and a memory, etc. Figure 1As shown, the memory is connected to the processor. The processor is the control center of the electronic device, which uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory, and calling data stored in the memory, so as to monitor the electronic device as a whole. The processor can be a central processing unit (CPU), a graphics processing unit (GPU) or a network processor (Neural-network Processing Unit, NPU).
[0033] Furthermore, the processor may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor.
[0034] The memory is used to store programs, and the processor executes various functional applications of the electronic device by running the software programs stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a software program required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0035] Based on the above Figure 1 The electronic devices described may include but are not limited to foldable mobile phones, upright mobile phones, tablet computers, PDAs, laptop computers, video matrix mobile Internet devices (MID, Mobile Internet Devices) or wearable devices with data processing functions, and are not specifically limited here.
[0036] For details, please refer to Figure 2 , Figure 2 A schematic diagram of a connection between a server and a terminal device provided in an embodiment of the present application. The server can be connected to at least one terminal device. Each of the at least one terminal device is connected to the server so that each terminal device can exchange data with the server through the network. Figure 2 As shown, the at least one terminal device may specifically include a first terminal device, a second terminal device, ..., an Nth terminal device.
[0037] Please combine the following Figure 3The method in the embodiment of the present application is described in detail:
[0038] See also Figure 3 , Figure 3 A flowchart of a data processing method provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the processing method is applied to a server, and the server is connected to a terminal device, including:
[0039] S301, obtaining target scale data of a target object and detection data of multiple target devices in a first period of time.
[0040] Among them, the scale data includes multiple first feature data, and the device detection data includes multiple second feature data. Obtain target scale data of the target object through the scale. Obtain multiple target device detection data of the target object within the first time period through the terminal device. The first time period can be set according to actual needs, for example, it can be set to a period within two weeks, and there is no specific restriction here. Specifically, the scale is the Hamilton Depression Rating Scale, which is the most commonly used scale for clinical assessment of depression. Its test results are more reliable and professional, thereby improving the credibility of the prediction results. The target scale data includes data of multiple first characteristics, and the first characteristics can be self-test characteristics such as "not deep sleep" and "difficulty falling asleep" in the scale. The device detection data includes data of multiple second characteristics. The terminal device can collect and analyze biomarkers or physiological electrical signals, such as heart rate, physical activity, sleep pattern and quality, blood oxygen and respiratory rate, etc. Physical activity data (for example, number of steps, calories, metabolic rate, etc.), sleep data (for example, duration and pattern), heart rate data (for example, heart rate, heart rate variability, heartbeat interval, etc.). Therefore, the second characteristics can be heart rate speed, sleep duration and number of exercise steps per day, etc., which are not limited here. It can be seen that the data in the first period is obtained to provide data support for subsequent data processing.
[0041] S302: Determine a plurality of first feature data and a plurality of second feature data according to the plurality of target device detection data.
[0042] Wherein, the first feature data represents a vector sequence composed of data corresponding to a single second feature in the multiple target device detection data, and the second feature data represents the incremental relationship between every N adjacent data in the first feature data, where N is a positive integer. Wherein, the type of the second feature included in each device detection data in the multiple target device detection data is the same, for example, the first target device detection data includes sleep duration, and the second target device detection data also includes sleep duration. Multiple first feature data are determined based on the multiple target device detection data, that is, the data corresponding to the sleep duration in each target device detection data is taken out, and arranged in sequence according to the time sequence of acquisition to generate a vector sequence, which is a first feature data. The second feature data represents the incremental relationship between every N adjacent data in the first feature data, for example, if the first feature data includes the first sleep duration: 8 hours; the second sleep duration: 7 hours; the third sleep duration: 9 hours; the fourth sleep duration: 6 hours. If N is 2, the first sleep duration is added to the second sleep duration, that is, 8+7=15. Similarly, the sum of the third sleep duration and the fourth sleep duration is 15 hours, and the increment is 0. It can be seen that determining the data representing the incremental relationship increases the type of data input to the model and improves the accuracy of the processing results.
[0043] It can be understood that the incremental relationship can also be the difference between the latest data and the historical data before the latest data. For example, if the first sleep time, the second sleep time, the third sleep time and the fourth sleep time are obtained in chronological order, the difference between the fourth sleep time and the first sleep time, the second sleep time and the third sleep time can be calculated, and the calculated difference represents the incremental relationship of the first characteristic data.
[0044] S303: According to the replacement relationship table, the target first feature and the corresponding data in the target scale data are replaced with the target second feature and the corresponding data in the plurality of first feature data, respectively, to obtain the replaced target scale data.
[0045] The replacement relationship table includes the association relationship between different first features to be replaced and different second features for replacement. The target first feature in the target scale data is determined according to the replacement relationship table, and the target second feature for replacement in multiple first feature data is determined according to the replacement relationship table, the target first feature is replaced with the target second feature, and the data corresponding to the target first feature is replaced with the data corresponding to the target second feature. The target first feature and the corresponding data in the target scale data are replaced with the features and data in the device detection data, respectively, to reduce the influence of the subjective opinions of the target object and improve the accuracy of the prediction results.
[0046] S304, calling a data prediction model to predict the replaced target scale data, the plurality of first feature data and the plurality of second feature data, and obtaining a prediction label of the data prediction model.
[0047] The prediction label represents the predicted depression level of the target object. The replaced target scale data, the plurality of first feature data and the plurality of second feature data are input into the data prediction model to obtain the prediction label.
[0048] S305: Send the predicted label to the terminal device.
[0049] The entire data processing process can be performed on the server, and the predicted labels can be sent to the terminal device through the server, saving the resources of the terminal device.
[0050] It can be seen that in this example, multiple first feature data and multiple second feature data are determined, so that the feature data type of the input data prediction model is more comprehensive, and some features and data in the target scale data are replaced with features and data in the terminal detection data, thereby reducing the influence of the subjective opinions of the target objects and improving the accuracy of the prediction results.
[0051] In a possible example, the method for determining the replacement relationship table includes: acquiring a plurality of first sample data, a second sample data, a plurality of first result labels and a second result label, wherein the first sample data includes a first reference scale data and a plurality of first reference device detection data within a second time period, the second sample data includes a second reference scale data and a plurality of second reference device detection data within a third time period, the result label represents a determined depression level, one first sample data corresponds to one first result label, and one second sample data corresponds to one second result label; pairing a first feature in the first reference scale data with a second feature in the first reference device detection data in pairs, and obtaining a pairing set consisting of a pairing relationship between the first feature in the first reference scale data and the second feature in the first reference device detection data, wherein the first feature in the pairing relationship represents a feature to be replaced, and the second feature in the pairing relationship represents a feature for replacement;
[0052] Perform the following operations on each of the first reference scale data: generate at least one updated scale data according to the pairing set, the first reference scale data and the plurality of first reference device detection data, one updated scale data corresponding to one pairing relationship; obtain a data set consisting of the updated scale data corresponding to the plurality of first sample data, the data set comprising a plurality of screening data groups, the screening data group consisting of the updated scale data corresponding to the same pairing relationship; respectively use each of the screening data groups in the plurality of screening data groups and the plurality of first result labels to train a screening model, to obtain a plurality of reference screening models, the screening model being a random forest model;
[0053] The following operations are performed on each of the reference screening models: determining the target pairing relationship corresponding to the reference screening model; obtaining the replaced second reference scale data based on the target pairing relationship, the second reference scale data and the multiple second reference device detection data; calling the reference screening model to predict the replaced second reference scale data to obtain the reference result label of the reference screening model; if the difference between the reference result label and the second result label is less than a preset difference, storing the target pairing relationship in a relationship table, which is the replacement relationship table.
[0054] In a specific example, a replacement relationship table is determined, and a plurality of first sample data are first obtained, the first sample data including first reference scale data and a plurality of first reference device detection data within a second time period. Specifically, the first reference scale data can be the most recently acquired reference scale data, so that the data is more convincing and the accuracy of the prediction results is improved. The second sample data includes second reference scale data and a plurality of second reference device detection data within a third time period. Each first feature in the first reference scale data is paired with the second feature in the first reference device detection data, that is, the first feature in the first reference scale data and the second feature in the first reference device detection data are paired in pairs to obtain a pairing set consisting of a pairing relationship.
[0055] At least one updated scale data is generated according to the pairing set, the first reference scale data and the plurality of first reference device detection data, specifically including: obtaining a plurality of seventh feature data according to the plurality of first reference device detection data, the seventh feature data representing a vector sequence composed of data corresponding to a single second feature in the plurality of first reference device detection data. Obtaining a first pairing relationship in the pairing set, determining the first feature to be replaced in the first reference scale data and the second feature to be replaced in the plurality of first reference device detection data according to the first pairing relationship, replacing the first feature and the corresponding data in the first reference scale data with the second feature and the corresponding data in the plurality of first reference device detection data, respectively, obtaining the replaced first reference scale data, and the replaced first reference scale data is the updated scale data. One pairing relationship corresponds to one updated scale data, until each pairing relationship in the pairing set obtains the corresponding updated scale data. For example, the first reference scale data packet features "difficulty falling asleep" and "feeling of reduced ability". The first reference device detection data includes the features "exercise data" and "heart rate data". Pair "difficulty falling asleep" with "exercise data" and "heart rate data" respectively to obtain two pairing relationships, and pair "feeling of reduced ability" with "exercise data" and "heart rate data" respectively to obtain two pairing relationships. Then the pairing set includes four pairing relationships, so four corresponding updated scale data are obtained.
[0056] Obtaining a data set consisting of updated scale data corresponding to multiple first sample data specifically includes: determining the updated scale data corresponding to each first sample data in the multiple first sample data, and forming a data set consisting of the updated scale data corresponding to each first sample data; determining the pairing relationship corresponding to each updated scale data in the data set, and forming a screening data set with the updated scale data corresponding to the same pairing relationship. The updated scale data in the same screening data group is used for model training. The updated scale data in the screening data group are all data that replace the same feature. Therefore, according to the trained model, it is quickly determined whether the corresponding first feature and the second feature are replaceable, thereby improving the efficiency and accuracy of screening. A screening model is trained using a screening data group and multiple first result labels to obtain a reference screening model, so multiple reference screening models can be obtained corresponding to multiple screening data groups.
[0057] After obtaining the reference screening model, determine the target pairing relationship corresponding to the reference screening model, and obtain the replaced second reference scale data according to the target pairing relationship, the second reference scale data, and multiple second reference device detection data; input the replaced second reference scale data into the reference screening model to obtain the reference result label of the reference screening model. Since the second result label corresponding to the first reference device detection data has been determined, the reference result label is compared with the second result label. If the difference between the reference result label and the second result label is less than the preset difference, the target pairing relationship is stored in the relationship table. The preset difference can be set according to actual needs, and is not specifically limited here. Similarly, determine the reference result label corresponding to each reference screening model, and determine whether to store the target pairing relationship in the relationship table based on the comparison result of the depression level corresponding to the reference result label and the depression level in the second result label with the preset difference.
[0058] In a possible example, the data prediction model generation process includes: acquiring a plurality of third sample data and a plurality of third result labels, wherein the third sample data is a plurality of third reference device detection data within a fourth time period, and one third sample data corresponds to one third result label;
[0059] The following operation is performed on each of the third sample data:
[0060] A plurality of third feature data and a plurality of fourth feature data are determined based on the plurality of third reference device detection data, the third feature data representing a vector sequence composed of data corresponding to a single second feature in the plurality of third reference device detection data, and the fourth feature data representing an incremental relationship between every P adjacent data in the third feature data, where P is a positive integer; a first calculation value is obtained based on the replacement relationship table, the plurality of fourth feature data and a first preset calculation formula; the third feature data and the fourth feature data corresponding to the plurality of third sample data are obtained; the data prediction model is generated based on the first calculation value, the plurality of third result labels, the third feature data and the fourth feature data corresponding to the plurality of third sample data, and the data analysis model is a random forest model.
[0061] Wherein, the first quantity value of the first feature in the replacement relationship table and the second quantity value of the fourth feature data in the plurality of fourth feature data are counted, and the first preset calculation formula includes: Wherein, X is the first calculated value, A is the first quantity value, and B is the second quantity value.
[0062] In a specific example, multiple third sample data and multiple third result labels are obtained. The third sample data includes multiple third reference device detection data within a fourth time period. Multiple third feature data and multiple fourth feature data are determined based on the multiple third reference device detection data. According to the replacement relationship table, the multiple fourth feature data, and a first predefined calculation formula, a first calculated value is obtained. Herein, the first predefined calculation formula calculates the first quantity value of the replaceable first feature within the replacement relationship table and the second quantity value of the fourth feature data within the multiple fourth feature data, and substitutes the one quantity value and the second quantity value into the first predefined calculation formula to obtain the first calculated value.
[0063] Since each third sample data includes multiple third reference device detection data, the third feature data and the fourth feature data corresponding to the multiple third sample data are obtained. A data prediction model is generated based on the first calculated value, the multiple third result labels, the third feature data and the fourth feature data corresponding to the multiple third reference device detection data. Specifically, it includes: randomly selecting M feature data from the third feature data and the fourth feature data corresponding to a single third sample data, where M has the same numerical value as the first calculated value and M is a positive integer. Selecting an optimal feature data from the M feature data as the splitting data. It can be understood that the optimal splitting feature data can be determined based on indicators such as impurity or exhaustive search methods, and specific details are not limited here. Obtaining the type of this feature data, and determining the target feature data of the same type among the third feature data and the fourth feature data corresponding to the multiple third sample data, and using the target feature data as the feature data for splitting.
[0064] Specifically, the process of building a regression tree includes:
[0065] First step: The set of possible values of the prediction variable space (X1, X2, X3, …, Xp) is partitioned into J non-overlapping regions {R1, R2, R3, …, RJ}; then, for each observation value falling into the region Rj, the same prediction is made, and the predicted value is equal to the arithmetic mean of the respective sample values on Rj in the training set.
[0066] Second step: When performing a binary split of the decision tree, select the prediction variable X j and the split point s, and divide the prediction variable space into two regions {X / X j < s} and {X / X j ≥ s}, so that the residual sum of squares is minimized as much as possible. Considering all the prediction variables X1, X2, …, Xp and all the values of the split point s corresponding to each prediction variable, then select the prediction variable and the split point s such that the constructed tree has the smallest residual sum of squares. That is, for j and s, define a pair of half-planes:
[0067] R1(j, s) = {X / Xj <s} and R2(j, s) = {X / X j ≥ s};
[0068] Find j and s to obtain the minimum value of the following calculation formula:
[0069]
[0070] where the y i represents the true result corresponding to the sample data, and the is the average response value of the training set in R1(j, s), is the average response value of the training set in R2(j, s).
[0071] Repeat the above first and second steps to find the optimal predictor variable and splitting point for further splitting the data set, so that the sum of squared residuals in the resulting region is minimized. At this time, the entire prediction space is no longer split, but one of the two previously determined regions. In this way, 3 regions are obtained; then split one of the 3 regions to minimize the sum of squared residuals, and so on, until the predetermined stopping condition is met, and then stop.
[0072] Build a random forest:
[0073] Let θ be the random parameter vector, and the corresponding decision tree is denoted as T(θ). Denote B as the domain of the feature set X. Each leaf node j = 1,..., J of the decision tree corresponds to a rectangular space of B. Denote the rectangular space of each leaf node j = 1,..., J as
[0074] Use the resampling technique method to resample, and randomly generate k training sets θ1, θ2,..., θ k ; Use each training set to generate the corresponding decision trees {T(x, θ1)}, {T(x, θ2)},..., {T(x, θ k )}.
[0075] Repeat the process of building the regression tree, and for the training sets θ1, θ2,..., θ k Select M features respectively for training to build k decision trees, and generate a random forest model.
[0076] It can be seen that in this example, the third feature data is a vector sequence composed of data, the fourth feature data represents the incremental relationship between data, the data analysis model is a random forest model, and the model is trained through the third feature data and the fourth feature data, so that the trained data analysis model has good generalization and robustness, and improves the accuracy of the prediction result of the data analysis model.
[0077] In a possible example, the data prediction model generation process includes: acquiring multiple fourth sample data and multiple fourth result labels, the fourth sample data including third reference scale data and multiple fourth reference device detection data acquired in a fifth time period, one fourth sample data corresponds to one fourth result label, and the third feature data represents the scale detection data acquired at the time point closest to the current time point;
[0078] The following operations are performed on each of the fourth sample data: a plurality of fifth feature data and a plurality of sixth feature data are determined according to the plurality of fourth reference device detection data, the fifth feature data representing a vector sequence composed of data corresponding to a single second feature in the plurality of fourth reference device detection data, and the sixth feature data representing an incremental relationship between every W adjacent data in the sixth sample data, where W is a positive integer; according to the replacement relationship table, the target first feature and the corresponding data of the third reference scale data are respectively replaced with the target second feature and the corresponding data in the plurality of fifth feature data to obtain the replaced third reference scale data; a second calculation value is calculated according to the replacement relationship table, the replaced third reference scale data, the plurality of sixth feature data and a second preset calculation formula; the fifth feature data and the sixth feature data corresponding to the plurality of fourth sample data are obtained; the data prediction model is generated using the second calculation value, the replaced third reference scale data, the plurality of fourth result labels, the fifth feature data and the sixth feature data corresponding to the plurality of fourth sample data, and the data analysis model is a random forest model.
[0079] The second calculated value is obtained by calculating according to the replacement relationship table, the replaced third reference scale data, the plurality of sixth feature data and the second preset calculation formula: the third quantity value of the first feature in the replacement relationship table, the fourth quantity value of the replaced third reference scale data and the fifth quantity value of the sixth feature data in the plurality of sixth feature data are counted, and the second preset calculation formula is:
[0080]
[0081] Among them, the L is the second calculated value, the J is the third quantity value, the 1 is the fourth value, and the K is the fifth quantity value.
[0082] In a specific example, multiple fourth sample data and multiple fourth result labels are obtained, the fourth sample data include third reference scale data and multiple fourth reference device detection data obtained in a fifth time period, multiple fifth feature data and multiple sixth feature data are determined based on the multiple fourth reference device detection data, and the target first feature and corresponding data of the third reference scale data are respectively replaced with the target second feature and corresponding data in the multiple fifth feature data according to the replacement relationship table to obtain the replaced third reference scale data.
[0083] The second calculated value is obtained by calculating according to the replacement relationship table, the replaced third reference scale data, the plurality of sixth characteristic data and the second preset calculation formula, wherein the second preset calculation formula is:
[0084]
[0085] The third quantitative value of the replaceable first feature in the statistical replacement relationship table, the fourth quantitative value of the replaced third reference scale data and the fifth quantitative value of the sixth feature data in multiple sixth feature data are substituted into the second preset calculation formula to obtain the second calculation value.
[0086] The fifth characteristic data and the sixth characteristic data corresponding to the multiple fourth sample data are obtained, and a data prediction model is generated according to the second calculated value, multiple fourth result labels, and the fifth characteristic data and the sixth characteristic data corresponding to multiple fourth reference device detection data. Specifically, it includes: randomly selecting F characteristic data from the replaced third reference scale data, the fifth characteristic data and the sixth characteristic data corresponding to a single fourth sample data, where F is the same as the value of the second calculated value, and F is a positive integer. An optimal characteristic data is selected from the F characteristic data as the splitting data. It can be understood that the optimal splitting characteristic data can be determined based on an impurity index or a traversal search method, and the specific method is not limited here.
[0087] It can be seen that in this example, the fifth feature data is a vector sequence composed of data, the sixth feature data represents the incremental relationship between data, and the data analysis model is a random forest model. The model is trained by replacing the third reference scale data, the fifth feature data and the sixth feature data to improve the accuracy of the prediction results of the data analysis model, and part of the replaced third reference scale data is replaced with data in the terminal measurement data to reduce the influence of the main intention of the detection object and improve the credibility of the output results. And the replaced third reference scale data is the scale detection data closest to the current time point, which improves the reliability of the training data and the credibility of the model output results.
[0088] In a possible example, after sending the prediction tag to the terminal device, the method further includes: if it is detected that the depression level of the target object in the prediction tag exceeds a preset level, obtaining an emergency contact method pre-stored in the terminal device; and sending a prompt message to the terminal device of the emergency contact method, wherein the prompt message is used to prompt that the depression level of the target object exceeds the preset level.
[0089] In a specific example, after the prediction tag is sent to the terminal device, it is detected whether the depression level of the target object in the prediction tag exceeds the preset level. If it exceeds the preset level, and it is detected that the terminal device has an emergency contact method pre-stored, a prompt message is sent to the terminal device of the emergency contact method to prompt the person corresponding to the emergency contact method, so as to provide help as soon as possible.
[0090] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0091] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0092] In the case of dividing each functional module according to each function, the following is combined Figure 4 A data processing device in an embodiment of the present application is described in detail. Figure 4 A block diagram of the functional units of a data processing device provided in an embodiment of the present application, a data processing device, the device comprising:
[0093] An acquisition unit 410, the acquisition module is used to acquire target scale data of the target object and multiple target device detection data in a first period, the scale data includes multiple first feature data, and the device detection data includes multiple second feature data;
[0094] A determination unit 420, the determination module is used to determine a plurality of first feature data and a plurality of second feature data according to the plurality of target device detection data, the first feature data represents a vector sequence composed of data corresponding to a single second feature in the plurality of target device detection data, and the second feature data represents an incremental relationship between every N adjacent data in the first feature data, where N is a positive integer;
[0095] A replacement unit 430, the replacement module is used to replace the target first feature and the corresponding data in the target scale data with the target second feature and the corresponding data in the plurality of first feature data according to a replacement relationship table, to obtain the replaced target scale data, wherein the replacement relationship table includes an association relationship between different first features to be replaced and different second features for replacement;
[0096] A calling unit 440, the calling module is used to call a data prediction model to predict the replaced target scale data, the plurality of first feature data and the plurality of second feature data, and obtain a prediction label of the data prediction model, wherein the prediction label represents the predicted depression level of the target object;
[0097] The sending unit 450 is used to send the predicted label to the terminal device.
[0098] In a possible example, the method for determining the replacement relationship table includes: acquiring a plurality of first sample data, a second sample data, a plurality of first result labels and a second result label, wherein the first sample data includes a first reference scale data and a plurality of first reference device detection data within a second time period, the second sample data includes a second reference scale data and a plurality of second reference device detection data within a third time period, the result label represents a determined depression level, one first sample data corresponds to one first result label, and one second sample data corresponds to one second result label; pairing a first feature in the first reference scale data with a second feature in the first reference device detection data in pairs, and obtaining a pairing set consisting of a pairing relationship between the first feature in the first reference scale data and the second feature in the first reference device detection data, wherein the first feature in the pairing relationship represents a feature to be replaced, and the second feature in the pairing relationship represents a feature for replacement;
[0099] And, performing the following operations on each of the first reference scale data: generating at least one updated scale data according to the pairing set, the first reference scale data and the plurality of first reference device detection data, one updated scale data corresponding to one pairing relationship; and obtaining a data set consisting of the updated scale data corresponding to the plurality of first sample data, the data set comprising a plurality of screening data groups, the screening data group consisting of the updated scale data corresponding to the same pairing relationship; and training a screening model using each of the plurality of screening data groups and the plurality of first result labels, respectively, to obtain a plurality of reference screening models, the screening model being a random forest model;
[0100] And, performing the following operations on each of the reference screening models: determining the target pairing relationship corresponding to the reference screening model; and obtaining the replaced second reference scale data based on the target pairing relationship, the second reference scale data and the multiple second reference device detection data; and calling the reference screening model to predict the replaced second reference scale data to obtain the reference result label of the reference screening model; and if the difference between the reference result label and the second result label is less than a preset difference, storing the target pairing relationship in a relationship table, which is the replacement relationship table.
[0101] In a possible example, the data prediction model generation process includes: acquiring a plurality of third sample data and a plurality of third result labels, wherein the third sample data is a plurality of third reference device detection data within a fourth time period, and one third sample data corresponds to one third result label;
[0102] And, performing the following operations on each of the third sample data: determining multiple third feature data and multiple fourth feature data based on the multiple third reference device detection data, the third feature data representing a vector sequence composed of data corresponding to a single second feature in the multiple third reference device detection data, and the fourth feature data representing the incremental relationship between every P adjacent data in the third feature data, where P is a positive integer; and obtaining a first calculation value based on the replacement relationship table, the multiple fourth feature data and a first preset calculation formula; and obtaining the third feature data and the fourth feature data corresponding to the multiple third sample data; and generating the data prediction model based on the first calculation value, the multiple third result labels, the third feature data and the fourth feature data corresponding to the multiple third sample data, and the data analysis model is a random forest model.
[0103] In a possible example, the step of calculating the first calculated value according to the replacement relationship table, the plurality of fourth feature data, and a first preset calculation formula includes: counting a first quantity value of the first feature in the replacement relationship table, and a second quantity value of the fourth feature data in the plurality of fourth feature data, wherein the first preset calculation formula includes:
[0104]
[0105] Wherein, X is the first calculated value, A is the first quantity value, and B is the second quantity value.
[0106] In a possible example, the data prediction model generation process includes:
[0107] Acquire a plurality of fourth sample data and a plurality of fourth result labels, wherein the fourth sample data include third reference scale data and a plurality of fourth reference device detection data acquired in a fifth time period, one fourth sample data corresponds to one fourth result label, and the third feature data represents the scale detection data acquired at a time point closest to the current time point;
[0108] And, performing the following operation on each of the fourth sample data:
[0109] A plurality of fifth feature data and a plurality of sixth feature data are determined according to the plurality of fourth reference device detection data, the fifth feature data representing a vector sequence composed of data corresponding to a single second feature in the plurality of fourth reference device detection data, and the sixth feature data representing an incremental relationship between every W adjacent data in the sixth sample data, wherein W is a positive integer; and according to the replacement relationship table, the target first feature and the corresponding data of the third reference scale data are respectively replaced with the target second feature and the corresponding data in the plurality of fifth feature data to obtain the replaced third reference scale data; and a second calculated value is calculated according to the replacement relationship table, the replaced third reference scale data, the plurality of sixth feature data and a second preset calculation formula; and the fifth feature data and the sixth feature data corresponding to the plurality of fourth sample data are obtained; and the data prediction model is generated using the second calculated value, the replaced third reference scale data, the plurality of fourth result labels, the fifth feature data and the sixth feature data corresponding to the plurality of fourth sample data, and the data analysis model is a random forest model.
[0110] In a possible example, the calculating and obtaining the second calculated value according to the replacement relationship table, the replaced third reference scale data, the plurality of sixth characteristic data, and the second preset calculation formula includes:
[0111] The third quantity value of the first feature in the replacement relationship table, the fourth quantity value of the replaced third reference scale data, and the fifth quantity value of the sixth feature data in the plurality of sixth feature data are counted, and the second preset calculation formula is:
[0112] Among them, the L is the second calculated value, the J is the third quantity value, the 1 is the fourth value, and the K is the fifth quantity value.
[0113] In a possible example, after sending the prediction tag to the terminal device, the method further includes: if it is detected that the depression level of the target object in the prediction tag exceeds a preset level, obtaining an emergency contact method pre-stored in the terminal device; and sending a prompt message to the terminal device of the emergency contact method, wherein the prompt message is used to prompt that the depression level of the target object exceeds the preset level.
[0114] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0115] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.
[0116] An embodiment of the present application further provides a computer program product, which includes a computer program. The computer program can be operated to enable a computer to execute part or all of the steps of any method recorded in the above method embodiments.
[0117] The computer program product may be a software installation package, and the computer includes an electronic device.
[0118] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0119] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and systems can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0121] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0122] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0123] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions without departing from the spirit and scope of the present invention, and can make various changes and modifications, including the combination of the above-mentioned different functions and implementation steps, including software and hardware implementation methods, all of which are within the scope of protection of the present invention.
Claims
1. A data processing method, It is characterized in that Applied to a server, the server is connected to a terminal device, and the method comprises: Acquire target scale data of the target object and multiple target device detection data in a first time period, the scale data includes multiple first feature data, and the device detection data includes multiple second feature data; Determine a plurality of first feature data and a plurality of second feature data according to the plurality of target device detection data, wherein the first feature data represents a vector sequence composed of data corresponding to a single second feature in the plurality of target device detection data, and the second feature data represents an incremental relationship between every N adjacent data in the first feature data, where N is a positive integer; Replacing the target first feature and the corresponding data in the target scale data with the target second feature and the corresponding data in the plurality of first feature data respectively according to the replacement relationship table, to obtain the replaced target scale data, wherein the replacement relationship table includes the association relationship between different first features to be replaced and different second features for replacement; The method for determining the replacement relationship table includes: Acquire a plurality of first sample data, a second sample data, a plurality of first result labels and a second result label, wherein the first sample data includes first reference scale data and a plurality of first reference device detection data within a second time period, the second sample data includes second reference scale data and a plurality of second reference device detection data within a third time period, the result label represents a determined depression level, one first sample data corresponds to one first result label, and one second sample data corresponds to one second result label; Pairing the first features in the first reference scale data with the second features in the first reference device detection data in pairs, to obtain a pairing set consisting of pairing relationships between the first features in the first reference scale data and the second features in the first reference device detection data, wherein the first features in the pairing relationship represent features to be replaced, and the second features in the pairing relationship represent features to be replaced; The following operations are performed on each of the first reference scale data: Generate at least one updated meter data according to the pairing set, the first reference meter data and the plurality of first reference device detection data, wherein one updated meter data corresponds to one pairing relationship; Acquire a data set consisting of the updated quantity table data corresponding to the plurality of first sample data, wherein the data set includes a plurality of screening data groups, and the screening data groups consist of the updated quantity table data corresponding to the same pairing relationship; Using each of the plurality of screening data sets and the plurality of first result labels to train a screening model respectively, to obtain a plurality of reference screening models, wherein the screening model is a random forest model; The following operations are performed for each of the reference screening models: Determining the target pairing relationship corresponding to the reference screening model; Acquire replaced second reference scale data according to the target pairing relationship, the second reference scale data and the plurality of second reference device detection data; Calling the reference screening model to predict the replaced second reference scale data to obtain a reference result label of the reference screening model; If the difference between the reference result label and the second result label is less than a preset difference, the target pairing relationship is stored in a relationship table, which is the replacement relationship table; Calling a data prediction model to predict the replaced target scale data, the plurality of first feature data, and the plurality of second feature data to obtain a prediction label of the data prediction model, wherein the prediction label represents a predicted depression level of the target object; Sending the predicted label to the terminal device; If it is detected that the depression level of the target object in the prediction tag exceeds a preset level, obtaining emergency contact information pre-stored in the terminal device; Sending a prompt message to the terminal device of the emergency contact information, wherein the prompt message is used to prompt that the depression level of the target object exceeds a preset level.
2. The method according to claim 1, It is characterized in that The data prediction model generation process includes: Acquire a plurality of third sample data and a plurality of third result labels, wherein the third sample data is a plurality of third reference device detection data within a fourth time period, and one third sample data corresponds to one third result label; The following operation is performed on each of the third sample data: Determine a plurality of third feature data and a plurality of fourth feature data according to the plurality of third reference device detection data, wherein the third feature data represents a vector sequence composed of data corresponding to a single second feature in the plurality of third reference device detection data, and the fourth feature data represents an incremental relationship between every P adjacent data in the third feature data, where P is a positive integer; Obtaining a first calculated value by calculation according to the replacement relationship table, the plurality of fourth characteristic data and a first preset calculation formula; Acquire the third feature data and the fourth feature data corresponding to the plurality of third sample data; The data prediction model is generated according to the first calculated value, the multiple third result labels, the third feature data corresponding to the multiple third sample data, and the fourth feature data, and the data analysis model is a random forest model.
3. The method according to claim 2, It is characterized in that The step of calculating the first calculated value according to the replacement relationship table, the plurality of fourth feature data and the first preset calculation formula includes: The first quantity value of the first feature in the replacement relationship table and the second quantity value of the fourth feature data in the plurality of fourth feature data are counted, and the first preset calculation formula includes: ; Wherein, X is the first calculated value, A is the first quantity value, and B is the second quantity value.
4. A terminal device, It is characterized in that The terminal device includes at least one processor, a communication interface and a memory, the communication interface is used to send and / or receive data, the memory is used to store computer programs, and the at least one processor is used to call the computer program stored in the memory to implement the method described in any one of claims 1-3.
5. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program runs on a processor, the method according to any one of claims 1 to 3 is implemented.
