Data processing methods and related products

By automatically comparing and deleting expired data in the RocksDB storage engine and merging the remaining data, the problem of deleting expired data in the existing technology affecting online service efficiency, and intelligent deletion and efficient service are achieved.

CN115004167BActive Publication Date: 2025-03-14SHENZHEN HEYTAP TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080094736.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-09
Publication Date
2025-03-14
Estimated Expiration
2040-03-09

AI Technical Summary

Technical Problem

When the prior art deletes expired data, it is easy to affect the efficiency of online services, and there is a risk of automatically deleting data during low peak periods.

Method used

When the RocksDB storage engine is running, the current timestamp is obtained and the timestamp corresponding to each data in the data is compared, the expired data is automatically deleted, and the remaining data is merged to achieve intelligent deletion of the data.

Benefits of technology

It improves the intelligence of expired data deletion, reduces the impact on online services, avoids the risk of automatic data deletion during low peak periods, and improves the efficiency of online services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115004167B_ABST
    Figure CN115004167B_ABST
Patent Text Reader

Abstract

A data processing method and related products are applied to electronic devices, the method comprising: obtaining a data set to be processed, the data set to be processed comprising multiple data, each data corresponding to a timestamp (101); when the RocksDB storage engine is running, obtaining a current timestamp (102); comparing the current timestamp with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp (103); deleting the data corresponding to the at least one target timestamp, and merging the remaining data in the multiple data to obtain a target data set (104). The method can improve data deletion efficiency and help improve system performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method and related products. Background Art

[0002] With the widespread application of electronic devices (such as mobile phones, tablet computers, etc.), electronic devices can support more and more applications and have more and more powerful functions. Electronic devices are developing in a diversified and personalized direction and have become indispensable electronic products in users' lives.

[0003] At present, it is necessary to delete expired data in time through business logic, and it is necessary to combine the business operation status, such as deleting data during the off-peak period of business to avoid affecting online services. The main disadvantages are as follows: centralized deletion affects the business reading and writing during the deletion period, which will cause the reading and writing delay to increase; the off-peak period of business is generally in the early morning, and large-scale data deletion without human supervision has certain risks. Therefore, how to reasonably delete expired data to improve the efficiency of online services needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present application provide a data processing method and related products, which can improve the intelligence of deleting expired data and help improve the efficiency of online services.

[0005] In a first aspect, an embodiment of the present application provides a data processing method, applied to an electronic device, comprising:

[0006] Acquire a data set to be processed, wherein the data set to be processed includes a plurality of data, and each data corresponds to a timestamp;

[0007] When the RocksDB storage engine is running, get the current timestamp;

[0008] Compare the current timestamp with the timestamp corresponding to each data in the plurality of data to obtain at least one target timestamp;

[0009] The data corresponding to the at least one target timestamp is deleted, and the remaining data in the plurality of data are merged to obtain a target data set.

[0010] In a second aspect, an embodiment of the present application provides a data processing device, which is applied to an electronic device, and the device includes: a first acquisition unit, a second acquisition unit, a comparison unit, and a deletion unit, wherein:

[0011] The first acquisition unit is used to acquire a data set to be processed, wherein the data set to be processed includes a plurality of data, and each data corresponds to a timestamp;

[0012] The second acquisition unit is used to acquire the current timestamp when the RocksDB storage engine is running;

[0013] The comparison unit is used to compare the current timestamp with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp;

[0014] The deleting unit is used to delete the data corresponding to the at least one target timestamp, and merge the remaining data in the plurality of data to obtain a target data set.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, 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 in the first aspect of the embodiment of the present application.

[0016] In a fourth 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 the first aspect of the embodiment of the present application.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application. The computer program product may be a software installation package. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The following is a brief introduction to the drawings required for describing the embodiments or the prior art.

[0019] 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.

[0020] Figure 1A It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0021] Figure 1B It is a flowchart of a data processing method disclosed in an embodiment of the present application;

[0022] Figure 1CIt is a schematic diagram demonstrating the principle of merging implementation disclosed in the embodiment of the present application;

[0023] Figure 2 It is a flowchart of another data processing method disclosed in an embodiment of the present application;

[0024] Figure 3 It is a flowchart of another data processing method disclosed in an embodiment of the present application;

[0025] Figure 4 is a schematic diagram of the structure of another electronic device disclosed in an embodiment of the present application;

[0026] Figure 5A is a structural schematic diagram of a data processing device disclosed in an embodiment of the present application;

[0027] Figure 5B is a structural schematic diagram of another data processing device disclosed in an embodiment of the present application;

[0028] Figure 5C is a structural schematic diagram of another data processing device disclosed in an embodiment of the present application;

[0029] Figure 5D It is a structural schematic diagram of another data processing device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0030] 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.

[0031] 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.

[0032] 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.

[0033] The electronic devices involved in the embodiments of the present application may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile stations (MS), terminal devices, etc. For the convenience of description, the above-mentioned devices are collectively referred to as electronic devices, and the above-mentioned electronic devices may also be servers, service platforms, etc.

[0034] The embodiments of the present application are described in detail below.

[0035] See also Figure 1A , Figure 1A 1 is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. The electronic device 100 may include a control circuit, and the control circuit may include a storage and processing circuit 110. The storage and processing circuit 110 may be a memory, such as a hard disk drive memory, a non-volatile memory (such as a flash memory or other electronic programmable read-only memory for forming a solid-state drive, etc.), a volatile memory (such as a static or dynamic random access memory, etc.), etc., and the embodiment of the present application is not limited. The processing circuit in the storage and processing circuit 110 can be used to control the operation of the electronic device 100. The processing circuit can be implemented based on one or more microprocessors, microcontrollers, baseband processors, power management units, audio codec chips, application-specific integrated circuits, display driver integrated circuits, etc.

[0036] The storage and processing circuit 110 may be used to run software in the electronic device 100, such as an Internet browsing application, a voice over internet protocol (VOIP) phone call application, an email application, a media playback application, operating system functions, etc. These software may be used to perform some control operations, such as image acquisition based on a camera, ambient light measurement based on an ambient light sensor, proximity sensor measurement based on a proximity sensor, information display functions implemented based on status indicators such as status indicators of light-emitting diodes, touch event detection based on a touch sensor, functions associated with displaying information on multiple (e.g., layered) displays, operations associated with performing wireless communication functions, operations associated with collecting and generating audio signals, control operations associated with collecting and processing button press event data, and other functions in the electronic device 100, etc., which are not limited by the embodiments of the present application.

[0037] The electronic device 100 may further include an input-output circuit 150. The input-output circuit 150 may be used to enable the electronic device 100 to input and output data, that is, to allow the electronic device 100 to receive data from an external device and also to allow the electronic device 100 to output data from the electronic device 100 to an external device. The input-output circuit 150 may further include a sensor 170. The sensor 170 may include an ambient light sensor, a proximity sensor based on light and capacitance, a touch sensor (e.g., based on a light touch sensor and / or a capacitive touch sensor, wherein the touch sensor may be part of a touch display screen or may be used independently as a touch sensor structure), an acceleration sensor, a gravity sensor, and other sensors.

[0038] The input-output circuit 150 may also include one or more displays, such as a display 130. The display 130 may include a liquid crystal display, an organic light-emitting diode display, an electronic ink display, a plasma display, a display using other display technologies, or a combination of several of them. The display 130 may include a touch sensor array (i.e., the display 130 may be a touch display screen). The touch sensor may be a capacitive touch sensor formed by an array of transparent touch sensor electrodes (e.g., indium tin oxide (ITO) electrodes), or may be a touch sensor formed using other touch technologies, such as sonic touch, pressure-sensitive touch, resistive touch, optical touch, etc., which is not limited in the embodiments of the present application.

[0039] The audio component 140 may be used to provide audio input and output functions for the electronic device 100. The audio component 140 in the electronic device 100 may include a speaker, a microphone, a buzzer, a tone generator, and other components for generating and detecting sound.

[0040] The communication circuit 120 can be used to provide the electronic device 100 with the ability to communicate with external devices. The communication circuit 120 may include analog and digital input-output interface circuits, and wireless communication circuits based on radio frequency signals and / or optical signals. The wireless communication circuit in the communication circuit 120 may include a radio frequency transceiver circuit, a power amplifier circuit, a low noise amplifier, a switch, a filter, and an antenna. For example, the wireless communication circuit in the communication circuit 120 may include a circuit for supporting near field communication (NFC) by transmitting and receiving near field coupled electromagnetic signals. For example, the communication circuit 120 may include a near field communication antenna and a near field communication transceiver. The communication circuit 120 may also include a cellular phone transceiver and antenna, a wireless local area network transceiver circuit and antenna, etc.

[0041] The electronic device 100 may further include a battery, power management circuits and other input-output units 160. The input-output units 160 may include buttons, joysticks, click wheels, scroll wheels, touch pads, keypads, keyboards, cameras, light emitting diodes and other status indicators, etc.

[0042] A user may input commands through input-output circuitry 150 to control the operation of electronic device 100 , and may use output data of input-output circuitry 150 to enable receiving status information and other outputs from electronic device 100 .

[0043] See also Figure 1B , Figure 1B is a flow chart of a data processing method provided in an embodiment of the present application. The data processing method described in this embodiment is applied to Figure 1A An electronic device, the data processing method comprising:

[0044] 101. Obtain a data set to be processed, where the data set to be processed includes multiple data, and each data corresponds to a timestamp.

[0045] In the embodiment of the present application, the data set to be processed may include multiple data, and the data may be at least one of the following: text data, video data, audio data, cache data, compressed package, folder, etc., which are not limited here. Each data may correspond to a key-value pair, and each data corresponds to a timestamp, which is used to record the generation time or expiration time of the data. The timestamp field corresponding to the timestamp may be located at the end of the key-value pair.

[0046] 102. When the RocksDB storage engine is running, get the current timestamp.

[0047] Among them, in the embodiment of the present application, the RocksDB storage engine is a persistent KV storage engine, which is a log-structured database and is optimized for fast storage.

[0048] In a specific implementation, the electronic device can obtain a current timestamp when the RocksDB storage engine is running, and the current timestamp records the current time.

[0049] 103. Compare the current timestamp with a timestamp corresponding to each data in the multiple data to obtain at least one target timestamp.

[0050] The electronic device compares the current timestamp with the timestamp corresponding to each of the multiple data to obtain at least one target timestamp. The data corresponding to the target timestamp can be used as data to be deleted. In this way, expired data can be selected.

[0051] In a possible example, the above step 103, comparing the current timestamp with the timestamp corresponding to each of the multiple data to obtain at least one target timestamp, may include the following steps:

[0052] The current timestamp is compared with a timestamp corresponding to each of the multiple data through a hook function in the RocksDB storage engine to obtain at least one target timestamp.

[0053] Among them, the RocksDB storage engine of the electronic device may include a hook function, through which the current timestamp is compared with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp. The data corresponding to the timestamp can be used as the data to be deleted. In this way, expired data can be selected.

[0054] In a possible example, the timestamp of each data in the multiple data is used to record the existence time corresponding to the data. The above step 103, comparing the current timestamp with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp, may include the following steps:

[0055] A31, determining the time length between the current timestamp and the timestamp corresponding to each of the multiple data and the current timestamp, to obtain multiple time lengths;

[0056] A32. Selecting a time length greater than a preset threshold from the multiple time lengths to obtain at least one target time length;

[0057] A33. Use the timestamp of the data corresponding to the at least one target time length as the at least one target timestamp.

[0058] In the embodiment of the present application, the preset threshold value can be set by the user or by the system default. The timestamp of each data in the multiple data is used to record the existence time corresponding to the data, and the existence time can be understood as the generation time or storage time of the data.

[0059] In a specific implementation, the electronic device can determine the time length between the current timestamp and the timestamp corresponding to each of the multiple data and the current timestamp to obtain multiple time lengths, and then, can select a time length greater than a preset threshold from the multiple time lengths to obtain at least one target time length, and can use the timestamp of the data corresponding to at least one target time length as at least one target timestamp, so that some timestamps that have existed for a longer time can be selected.

[0060] Furthermore, in a possible example, before the above step A31, the following steps may also be included:

[0061] A34. Obtaining a target CPU usage rate of the electronic device;

[0062] A35. Determine the preset threshold corresponding to the target CPU usage according to the mapping relationship between the preset CPU usage and the threshold.

[0063] Among them, the electronic device can pre-store a mapping relationship between a preset CPU usage rate and a threshold value. In a specific implementation, the electronic device can obtain the target CPU usage rate of the electronic device, and determine the preset threshold value corresponding to the target CPU usage rate according to the mapping relationship between the preset CPU usage rate and the threshold value. In this way, dynamic adjustment of the threshold value can be achieved. For example, when the CPU usage rate is high, more data can be deleted, and when the CPU usage rate is low, less data can be deleted.

[0064] In a possible example, the timestamp of each data in the multiple data is used to record the expiration time corresponding to the data. The above step 103, comparing the current timestamp with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp, may include the following steps:

[0065] B31. Obtain a timestamp corresponding to each of the multiple data to obtain multiple timestamps;

[0066] B32. Determine the timestamps of the multiple timestamps that are earlier than the current timestamp, and obtain the at least one target timestamp.

[0067] In a specific implementation, the timestamp of each of the multiple data is used to record the expiration time corresponding to the data. The electronic device can obtain the timestamp corresponding to each of the multiple data, obtain multiple timestamps, determine the timestamp that is earlier than the current timestamp, and obtain at least one target timestamp.

[0068] 104. Delete data corresponding to the at least one target timestamp, and merge remaining data in the plurality of data to obtain a target data set.

[0069] In the embodiment of the present application, merging: can also be called compression, which is used to organize and merge existing data, thereby deleting some no longer valid data (for example, expired data), reducing the data size and the number of files, and speeding up the reading speed. The merging process may include a compaction (also called a major compaction) process. The compaction process is to store files from a low level to a high level. Figure 1C As shown, when the electronic device can merge the data of Level 1 (first layer) with the data of Level 2 (second layer), it will call the hook function that satisfies the compaction filter mechanism, thereby removing the expired data in Level 1 and no longer merging it into the files in Level 2.

[0070] In the specific implementation, the embodiment of the present application combines the existing characteristics of RocksDB and uses the RocksDB compaction filter mechanism to automatically clear expired data. In this way, Rocksdb can automatically delete expired data and no longer need to clear data manually. Specifically, when writing a key-value data pair, a 4-byte timestamp field can be added to the end of each value through program logic. The timestamp can indicate the expiration time of the key; RocksDB exposes a hook function (an interface function exposed by RocksDB) Filter to the outside world. When RocksDB is running, the hook function Filter will be automatically called every time data is merged; in the hook function, it is determined whether the current timestamp is greater than the timestamp stored in the key-value. If the current timestamp is greater than the expiration time stored at the end of the value, it means that the key-value pair has expired and needs to be deleted. Then, it will not be merged into the new file, thereby achieving the purpose of automatically clearing expired data.

[0071] Based on the above embodiments of the present application, the electronic device can implement the expired deletion hook function through the compaction filter mechanism of RocksDB, thereby automatically recovering expired data without the need for manual intensive data deletion through business logic. The data deletion process is evenly distributed to each merging process of Rocksdb to smoothly delete data.

[0072] In a possible example, the above step 104, deleting the data corresponding to the at least one target timestamp, may include the following steps:

[0073] 41. Determine the number of target timestamps corresponding to the at least one target timestamp;

[0074] 42. Determine the target number of threads corresponding to the at least one target timestamp according to a preset mapping relationship between the number of timestamps and the number of threads;

[0075] 43. Perform thread loading according to the target number of threads, and delete data corresponding to the at least one target timestamp according to the loaded threads, wherein each data corresponding to the target timestamp corresponds to one thread.

[0076] Among them, in an embodiment of the present application, a mapping relationship between a preset number of timestamps and a number of threads can be pre-stored in the electronic device. Furthermore, in a specific implementation, the electronic device can determine the target number of timestamps corresponding to at least one target timestamp, and according to the mapping relationship between the preset number of timestamps and the number of threads, determine the target number of threads corresponding to at least one target timestamp, and load threads according to the target number of threads, and delete data corresponding to at least one target timestamp according to the loaded threads. Each data corresponding to a target timestamp corresponds to a thread. In this way, a corresponding number of threads can be configured to delete data according to the number of data to be deleted, which helps to improve data deletion efficiency and improve system performance.

[0077] In a possible example, the following steps may also be included:

[0078] C1, receiving data clearing instruction;

[0079] C2. In response to the data clearing instruction, execute the step of obtaining the current timestamp.

[0080] In a specific implementation, the electronic device may receive a data clearing instruction input by a user, and then may respond to the data clearing instruction, and then may execute the step of obtaining a current timestamp.

[0081] In a possible example, the following steps may also be included:

[0082] D1. Obtain operating environment parameters;

[0083] D2. When the operating environment parameters meet the preset conditions, execute the step of obtaining the current timestamp.

[0084] Among them, the preset conditions can be set by the user or by the system default. Among them, the operating environment parameters include at least one of the following: touch parameters, operating time, geographical location, external environmental parameters, CPU temperature, CPU usage, memory occupancy, etc., which are not limited here. Among them, the touch parameters can be at least one of the following: touch strength of the touch touch screen, touch area of ​​the touch touch screen, touch duration of the touch touch screen, number of touches of the touch touch screen, touch temperature of the touch touch screen, etc., which are not limited here, and the environmental parameters can be at least one of the following: ambient light brightness, ambient temperature, ambient humidity, magnetic field interference intensity, etc., which are not limited here. For example, the step of obtaining the current timestamp needs to be executed only when the operating time is a specified time; for another example, the step of obtaining the current timestamp needs to be executed only when the geographical location is a specified location.

[0085] In a possible example, before the above step D1, the following steps may also be included:

[0086] D3, determining the memory size of the data set to be processed;

[0087] D4. When the memory size is greater than the preset memory size, execute the step of obtaining the operating environment parameters.

[0088] In a specific implementation, the preset memory size can be set by the user or by the system default. The electronic device can determine the memory size of the data set to be processed, and when the memory size is greater than the preset memory size, the step of obtaining the operating environment parameter is performed; otherwise, when the memory size is less than or equal to the preset memory size, the subsequent steps may not be performed, so that data cleaning can be performed only when there is a certain amount of memory.

[0089] In a possible example, before step 101, the following steps may also be included:

[0090] E21. Obtaining the user's target physiological state parameters;

[0091] E22, determining the target emotion type corresponding to the target physiological state parameter;

[0092] E23. When the target emotion type is a preset emotion type, execute the step of obtaining the data set to be processed.

[0093] Among them, in the embodiment of the present application, the physiological state parameter can be various parameters used to reflect the physiological function of the user, and the physiological state parameter can be at least one of the following: heart rate, blood pressure, blood temperature, blood lipid content, blood sugar content, thyroxine content, adrenaline content, platelet content, blood oxygen content, etc., which are not limited here. The preset emotion type can be set by the user or by system default. The preset emotion type can be at least one of the following: dull, crying, calm, irritable, excited, depressed, etc., which are not limited here.

[0094] In a specific implementation, the electronic device can obtain the user's target physiological state parameters through a wearable device that can communicate with the electronic device. Different physiological state parameters reflect the user's emotion type. The electronic device can pre-store a mapping relationship between the physiological state parameters and the emotion type. Then, the target emotion type corresponding to the target physiological state parameter can be determined based on the mapping relationship. Then, when the target emotion type is a preset emotion type, step 101 can be executed; otherwise, step 101 can be omitted.

[0095] In a possible example, when the target physiological state parameter is a heart rate change curve within a specified time period, the above step E22, determining the target emotion type corresponding to the target physiological state parameter, can be implemented as follows:

[0096] E221. Sampling the heart rate variation curve to obtain a plurality of heart rate values;

[0097] E222, performing an average operation on the multiple heart rate values ​​to obtain an average heart rate value;

[0098] E223, determining a target heart rate level corresponding to the average heart rate value;

[0099] E224. Determine a target first emotion value corresponding to the target heart rate level according to a preset mapping relationship between the heart rate level and the first emotion value;

[0100] E225, performing mean square error calculation according to the multiple heart rate values ​​to obtain a target mean square error;

[0101] E226. Determine the target second emotion value corresponding to the target mean square deviation according to a preset mapping relationship between the mean square deviation and the second emotion value;

[0102] E227. Determine a target weight pair corresponding to the target heart rate level according to a preset mapping relationship between the heart rate level and the weight pair, wherein the weight pair includes a first weight and a second weight, wherein the first weight is a weight corresponding to the first emotion value, and the second weight is a weight corresponding to the second emotion value;

[0103] E228, performing a weighted operation on the target first emotion value, the target second emotion value and the target weight value to obtain a final emotion value;

[0104] E229. Determine the target emotion type corresponding to the target emotion value according to a preset mapping relationship between the emotion value and the emotion type.

[0105] Among them, the designated time period can be set by the user or by the system default, and the electronic device can pre-store the mapping relationship between the preset heart rate level and the first emotion value, the mapping relationship between the preset mean square error and the second emotion value, and the mapping relationship between the preset heart rate level and the weight pair, and the mapping relationship between the preset emotion value and the emotion type. The above-mentioned weight pair may include a first weight and a second weight, the first weight is the weight corresponding to the first emotion value, and the second weight is the weight corresponding to the second emotion value, wherein the sum of the first weight and the second weight can be 1, and the value ranges of the first weight and the second weight are both 0 to 1. In the embodiment of the present application, emotions can be evaluated by the heart rate change curve.

[0106] In a specific implementation, the electronic device can sample the heart rate change curve, and the specific sampling method can be: uniform sampling or random sampling to obtain multiple heart rate values, and the average operation can be performed based on the multiple heart rate values ​​to obtain the average heart rate value. The electronic device can pre-store the mapping relationship between the heart rate value and the heart rate level, and then, the target heart rate level corresponding to the average heart rate value can be determined based on the mapping relationship, and then, the target first emotion value corresponding to the target heart rate level can be determined according to the above-mentioned preset mapping relationship between the heart rate level and the first emotion value, and then, the mean square error operation can be performed based on the multiple heart rate values ​​to obtain the target mean square error, and the target second emotion value corresponding to the target mean square error can be determined according to the mapping relationship between the preset mean square error and the second emotion value.

[0107] Furthermore, the electronic device may also determine a target weight pair corresponding to the target heart rate level according to the above-mentioned preset mapping relationship between the heart rate level and the weight pair, and the target weight pair may include a target first weight and a target second weight, the target first weight is the weight corresponding to the target first emotion value, and the target second weight is the weight corresponding to the target second emotion value. Then, the electronic device may perform a weighted operation based on the target first emotion value, the target second emotion value, the target first weight and the target second weight to obtain a final emotion value. The specific calculation formula is as follows:

[0108] Final emotion value = target first emotion value * target first weight + target second emotion value * target second weight

[0109] Furthermore, the target emotion type corresponding to the target emotion value can be determined according to the mapping relationship between the preset emotion value and the emotion type. The average heart rate reflects the user's heart rate value, and the mean square error of the heart rate reflects the heart rate stability. The user's emotions are reflected by the two dimensions of the average heart rate and the mean square error, and the user's emotion type can be accurately determined.

[0110] It can be seen that the data processing method described in the above embodiment of the present application is applied to an electronic device to obtain a data set to be processed, which includes multiple data, each of which corresponds to a timestamp. When the RocksDB storage engine is running, the current timestamp is obtained, and the current timestamp is compared with the timestamp corresponding to each of the multiple data to obtain at least one target timestamp, and the data corresponding to at least one target timestamp is deleted, and the remaining data in the multiple data to be processed are merged to obtain the target data set. Expired data can be automatically recycled through RocksDB without manual intervention or intensive data deletion. In addition, the deletion process is amortized to each merging stage, which has very little impact on the reading and writing of online business. The entire deletion process is very smooth, which helps to improve system performance and online service efficiency.

[0111] Consistent with the above, see Figure 2 , Figure 2 is a flow chart of another data processing method provided in an embodiment of the present application. The data processing method described in this embodiment is applied to Figure 1A The electronic device shown, the method may include the following steps:

[0112] 201. Obtain a data set to be processed, where the data set to be processed includes multiple data, and each data corresponds to a timestamp.

[0113] 202. When the RocksDB storage engine is running, a data clearing instruction is received.

[0114] 203. Respond to the data clearing instruction and obtain a current timestamp.

[0115] 204. Compare the current timestamp with a timestamp corresponding to each data in the multiple data to obtain at least one target timestamp.

[0116] 205. Delete the data corresponding to the at least one target timestamp, and merge the remaining data in the plurality of data to obtain a target data set.

[0117] The specific implementation process of the above steps 201-205 can be referred to Figure 1B The corresponding description in the method shown will not be repeated here.

[0118] It can be seen that the data processing method described in the above embodiment of the present application is applied to an electronic device to obtain a data set to be processed, the data set to be processed includes multiple data, each data corresponds to a timestamp, and when the RocksDB storage engine is running, a data clearing instruction is received, and the data clearing instruction is responded to, and the current timestamp is obtained, and the current timestamp is compared with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp, and the data corresponding to at least one target timestamp is deleted, and the remaining data in the multiple data to be processed are merged to obtain the target data set, and expired data can be automatically recycled through RocksDB, and user instructions can be received to realize data clearing without intensive data deletion. In addition, the deletion process is amortized to each merging stage, and the read and write impact on online business is very small. The entire deletion process is very smooth, which helps to improve system performance and also helps to improve online service efficiency.

[0119] Consistent with the above, see Figure 3 , is a flow chart of another data processing method provided in an embodiment of the present application. The data processing method described in this embodiment is applied to Figure 1A The electronic device may include the following steps:

[0120] 301. Obtain a data set to be processed, where the data set to be processed includes multiple data, and each data corresponds to a timestamp.

[0121] 302. When the RocksDB storage engine is running, obtain the operating environment parameters.

[0122] 303. When the operating environment parameters meet preset conditions, obtain a current timestamp.

[0123] 304. Compare the current timestamp with a timestamp corresponding to each data in the multiple data to obtain at least one target timestamp.

[0124] 305 : Delete the data corresponding to the at least one target timestamp, and merge the remaining data in the plurality of data to be collected to obtain a target data set.

[0125] The specific implementation process of the above steps 301-305 can be referred to Figure 1B The corresponding description in the method shown will not be repeated here.

[0126] It can be seen that the data processing method described in the above embodiment of the present application is applied to an electronic device to obtain a data set to be processed, the data set to be processed includes multiple data, each data corresponds to a timestamp, and when the RocksDB storage engine is running, the operating environment parameters are obtained, and when the operating environment parameters meet the preset conditions, the current timestamp is obtained, and the current timestamp is compared with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp, and the data corresponding to at least one target timestamp is deleted, and the remaining data in the multiple data to be processed are merged to obtain the target data set, which can automatically recycle expired data through RocksDB without manual intervention, and can achieve data deletion when the operating environment parameters meet certain conditions, and there is no need to delete data intensively. In addition, the deletion process is amortized to each merging stage, which has very little impact on the reading and writing of online business, and the entire deletion process is very smooth, which helps to improve system performance and also helps to improve online service efficiency.

[0127] Consistent with the above, see Figure 4 , Figure 4 An electronic device provided by an embodiment of the present application includes: a processor and a memory; 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 following steps:

[0128] Acquire a data set to be processed, wherein the data set to be processed includes a plurality of data, and each data corresponds to a timestamp;

[0129] When the RocksDB storage engine is running, get the current timestamp;

[0130] Compare the current timestamp with the timestamp corresponding to each data in the plurality of data to obtain at least one target timestamp;

[0131] The data corresponding to the at least one target timestamp is deleted, and the remaining data in the plurality of data are merged to obtain a target data set.

[0132] It can be seen that the electronic device described in the above embodiment of the present application obtains a data set to be processed, which includes multiple data, each of which corresponds to a timestamp. When the RocksDB storage engine is running, it obtains the current timestamp, compares the current timestamp with the timestamp corresponding to each of the multiple data, obtains at least one target timestamp, deletes the data corresponding to at least one target timestamp, and merges the remaining data in the multiple data to obtain the target data set. It can automatically recycle expired data through RocksDB without manual intervention or intensive data deletion. In addition, the deletion process is distributed to each merging stage, which has little impact on the reading and writing of online services. The entire deletion process is very smooth, which helps to improve system performance and online service efficiency.

[0133] In a possible example, the timestamp of each data in the plurality of data is used to record the existence time corresponding to the data, and in the aspect of comparing the current timestamp with the timestamp corresponding to each data in the plurality of data to obtain at least one target timestamp, the program includes instructions for performing the following steps:

[0134] Determine the time length between the current timestamp and the timestamp corresponding to each of the multiple data and the current timestamp to obtain multiple time lengths;

[0135] Selecting a time length greater than a preset threshold from the multiple time lengths to obtain at least one target time length;

[0136] The timestamp of the data corresponding to the at least one target time length is used as the at least one target timestamp.

[0137] In one possible example, the program further includes instructions for executing the following steps:

[0138] Obtaining a target CPU usage rate of the electronic device;

[0139] According to the mapping relationship between the preset CPU usage and the threshold, the preset threshold corresponding to the target CPU usage is determined.

[0140] In a possible example, the timestamp of each of the plurality of data is used to record the expiration time corresponding to the data, and in comparing the current timestamp with the timestamp corresponding to each of the plurality of data to obtain at least one target timestamp, the program includes instructions for performing the following steps:

[0141] Obtaining a timestamp corresponding to each of the multiple data to obtain multiple timestamps;

[0142] Determine the timestamps of the multiple timestamps that are earlier than the current timestamp to obtain the at least one target timestamp.

[0143] In a possible example, in the aspect of comparing the current timestamp with the timestamp corresponding to each of the plurality of data to obtain at least one target timestamp, the program includes instructions for performing the following steps:

[0144] The current timestamp is compared with a timestamp corresponding to each of the multiple data through a hook function in the RocksDB storage engine to obtain at least one target timestamp.

[0145] In a possible example, in terms of deleting the data corresponding to the at least one target timestamp, the program includes instructions for performing the following steps:

[0146] determining a number of target timestamps corresponding to the at least one target timestamp;

[0147] Determine the target number of threads corresponding to the at least one target timestamp according to a preset mapping relationship between the number of timestamps and the number of threads;

[0148] Thread loading is performed according to the target number of threads, and data corresponding to the at least one target timestamp is deleted according to the loaded threads, and each data corresponding to the target timestamp corresponds to one thread.

[0149] In one possible example, the program further includes instructions for executing the following steps:

[0150] receiving a data clearing instruction;

[0151] In response to the data clearing instruction, the step of obtaining the current timestamp is executed.

[0152] In one possible example, the program further includes instructions for executing the following steps:

[0153] Get the operating environment parameters;

[0154] When the operating environment parameters meet the preset conditions, the step of obtaining the current timestamp is performed.

[0155] In one possible example, the program further includes instructions for executing the following steps:

[0156] Determining the memory size of the data set to be processed;

[0157] When the memory size is greater than the preset memory size, the step of obtaining the operating environment parameters is performed.

[0158] 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.

[0159] 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.

[0160] See also Figure 5A , Figure 5A is a schematic diagram of the structure of a data processing device provided in this embodiment. The data processing device is applied to Figure 1A The electronic device shown in the figure, the data processing device includes: a first acquisition unit 501, a second acquisition unit 502, a comparison unit 503 and a deletion unit 504, wherein:

[0161] The first acquisition unit 501 is used to acquire a data set to be processed, where the data set to be processed includes a plurality of data, each data corresponding to a timestamp;

[0162] The second acquisition unit 502 is used to acquire the current timestamp when the RocksDB storage engine is running;

[0163] The comparison unit 503 is used to compare the current timestamp with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp;

[0164] The deleting unit 504 is used to delete the data corresponding to the at least one target timestamp, and merge the remaining data in the plurality of data to obtain a target data set.

[0165] It can be seen that the data processing device described in the above embodiment of the present application is applied to an electronic device to obtain a data set to be processed, which includes multiple data, each data corresponds to a timestamp, and when the RocksDB storage engine is running, the current timestamp is obtained, and the current timestamp is compared with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp, and the data corresponding to at least one target timestamp is deleted, and the remaining data in the multiple data to be processed are merged to obtain the target data set, which can automatically recycle expired data through RocksDB without manual intervention or intensive data deletion. In addition, the deletion process is distributed to each merging stage, which has very little impact on the reading and writing of online business, and the entire deletion process is very smooth, which helps to improve system performance and online service efficiency.

[0166] In a possible example, the timestamp of each data in the multiple data is used to record the existence time corresponding to the data. In the aspect of comparing the current timestamp with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp, the comparing unit 503 is specifically used to:

[0167] Determine the time length between the current timestamp and the timestamp corresponding to each of the multiple data and the current timestamp to obtain multiple time lengths;

[0168] Selecting a time length greater than a preset threshold from the multiple time lengths to obtain at least one target time length;

[0169] The timestamp of the data corresponding to the at least one target time length is used as the at least one target timestamp.

[0170] In a possible example, the comparing unit 503 is further specifically configured to:

[0171] Obtaining a target CPU usage rate of the electronic device;

[0172] According to the mapping relationship between the preset CPU usage and the threshold, the preset threshold corresponding to the target CPU usage is determined.

[0173] In a possible example, the timestamp of each data in the multiple data is used to record the expiration time corresponding to the data. In the aspect of comparing the current timestamp with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp, the comparing unit 503 is specifically used to:

[0174] Obtaining a timestamp corresponding to each of the multiple data to obtain multiple timestamps;

[0175] Determine the timestamps of the multiple timestamps that are earlier than the current timestamp to obtain the at least one target timestamp.

[0176] In a possible example, in comparing the current timestamp with the timestamp corresponding to each of the multiple data to obtain at least one target timestamp, the comparing unit 503 is specifically configured to:

[0177] The current timestamp is compared with a timestamp corresponding to each of the multiple data through a hook function in the RocksDB storage engine to obtain at least one target timestamp.

[0178] In a possible example, in terms of deleting the data corresponding to the at least one target timestamp, the deleting unit 504 is specifically configured to:

[0179] determining a number of target timestamps corresponding to the at least one target timestamp;

[0180] Determine the target number of threads corresponding to the at least one target timestamp according to a preset mapping relationship between the number of timestamps and the number of threads;

[0181] Thread loading is performed according to the target number of threads, and data corresponding to the at least one target timestamp is deleted according to the loaded threads, and each data corresponding to the target timestamp corresponds to one thread.

[0182] In one possible example, Figure 5B As shown, Figure 5B for Figure 5A Another variant structure of the data processing device shown in FIG. Figure 5A In comparison, it may also include: a receiving unit 505, wherein:

[0183] The receiving unit 505 is used to receive a data clearing instruction;

[0184] The second acquisition unit 502 responds to the data clearing instruction to execute the step of acquiring the current timestamp.

[0185] In one possible example, Figure 5C As shown, Figure 5C for Figure 5A Another variant structure of the data processing device shown in FIG. Figure 5A In comparison, the device may further include: the device may further include: a third acquisition unit 506, wherein:

[0186] The third acquisition unit 506 is used to acquire operating environment parameters;

[0187] The second acquisition unit 502 executes the step of acquiring the current timestamp when the operating environment parameter meets a preset condition.

[0188] In one possible example, Figure 5D As shown, Figure 5D for Figure 5C Another variant structure of the data processing device shown in FIG. Figure 5C In comparison, the method may further include: a determining unit 507, wherein:

[0189] The determining unit 507 is used to determine the memory size of the data set to be processed;

[0190] The third acquisition unit 506 executes the step of acquiring the operating environment parameters when the memory size is greater than the preset memory size.

[0191] It can be understood that the functions of each program module of the data processing device of this embodiment can be specifically implemented according to the method in the above method embodiment, and its specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0192] 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, and the computer program enables a computer to execute part or all of the steps of any data processing method recorded in the above method embodiments.

[0193] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any data processing method recorded in the above method embodiments.

[0194] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0195] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0196] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as 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, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.

[0197] 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.

[0198] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software program module.

[0199] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.

[0200] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the relevant hardware through a program, and the program may be stored in a computer-readable memory, which may include a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0201] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data processing method, characterized in that: Used in electronic equipment, including: Obtaining target physiological state parameters of the user; Determining a target emotion type corresponding to the target physiological state parameter; When the target emotion type is a preset emotion type, obtaining a data set to be processed, the data set to be processed includes a plurality of data, each data corresponding to a timestamp; When the RocksDB storage engine is running, obtain the operating environment parameters; When the operating environment parameters meet the preset conditions, obtaining the current timestamp; Compare the current timestamp with the timestamp corresponding to each data in the plurality of data to obtain at least one target timestamp; Delete the data corresponding to the at least one target timestamp, and merge the remaining data in the multiple data to obtain a target data set, wherein the merging includes compression, which is used to sort and merge the existing data, thereby deleting some no longer valid data, reducing the data size and the number of files, and speeding up the reading speed; When the target physiological state parameter is a heart rate change curve within a specified time period, determining the target emotion type corresponding to the target physiological state parameter includes: Sampling the heart rate change curve to obtain multiple heart rate values; Performing an average operation on the multiple heart rate values ​​to obtain an average heart rate value; Determine a target heart rate level corresponding to the average heart rate value; Determining a target first emotion value corresponding to the target heart rate level according to a preset mapping relationship between the heart rate level and the first emotion value; Performing a mean square error calculation based on the multiple heart rate values ​​to obtain a target mean square error; According to a preset mapping relationship between the mean square error and the second emotion value, determining a target second emotion value corresponding to the target mean square error; Determine a target weight pair corresponding to the target heart rate level according to a preset mapping relationship between the heart rate level and the weight pair, wherein the weight pair includes a first weight and a second weight, wherein the first weight is a weight corresponding to the first emotion value, and the second weight is a weight corresponding to the second emotion value; Performing a weighted operation on the target first emotion value, the target second emotion value and the target weight value to obtain a final emotion value; According to a preset mapping relationship between emotion values ​​and emotion types, the target emotion type corresponding to the target emotion value is determined.

2. The method according to claim 1, characterized in that The timestamp of each data in the plurality of data is used to record the existence time corresponding to the data, and the comparing the current timestamp with the timestamp corresponding to each data in the plurality of data to obtain at least one target timestamp includes: Determine the time length between the current timestamp and the timestamp corresponding to each of the multiple data and the current timestamp to obtain multiple time lengths; Selecting a time length greater than a preset threshold from the multiple time lengths to obtain at least one target time length; The timestamp of the data corresponding to the at least one target time length is used as the at least one target timestamp.

3. The method according to claim 2, characterized in that The method further comprises: Obtaining a target CPU usage rate of the electronic device; According to the mapping relationship between the preset CPU usage and the threshold, the preset threshold corresponding to the target CPU usage is determined.

4. The method according to claim 1, characterized in that The timestamp of each data in the plurality of data is used to record the expiration time corresponding to the data, and the comparing the current timestamp with the timestamp corresponding to each data in the plurality of data to obtain at least one target timestamp includes: Obtaining a timestamp corresponding to each of the multiple data to obtain multiple timestamps; Determine the timestamps of the multiple timestamps that are earlier than the current timestamp to obtain the at least one target timestamp.

5. The method according to any one of claims 1 to 4, characterized in that: The comparing the current timestamp with the timestamp corresponding to each of the plurality of data to obtain at least one target timestamp includes: The current timestamp is compared with a timestamp corresponding to each of the multiple data through a hook function in the RocksDB storage engine to obtain at least one target timestamp.

6. The method according to any one of claims 1 to 4, characterized in that: The deleting the data corresponding to the at least one target timestamp includes: determining a number of target timestamps corresponding to the at least one target timestamp; Determine the target number of threads corresponding to the at least one target timestamp according to a preset mapping relationship between the number of timestamps and the number of threads; Thread loading is performed according to the target number of threads, and data corresponding to the at least one target timestamp is deleted according to the loaded threads, and each data corresponding to the target timestamp corresponds to one thread.

7. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: receiving a data clearing instruction; In response to the data clearing instruction, the step of obtaining the current timestamp is executed.

8. The method according to claim 1, characterized in that The method further comprises: Determining the memory size of the data set to be processed; When the memory size is greater than the preset memory size, the step of obtaining the operating environment parameters is performed.

9. A data processing device, characterized in that: Applied to electronic equipment, the device comprises: a first acquisition unit, a second acquisition unit, a comparison unit and a deletion unit, wherein: The first acquisition unit is used to acquire a target physiological state parameter of the user; determine a target emotion type corresponding to the target physiological state parameter; when the target emotion type is a preset emotion type, acquire a data set to be processed, the data set to be processed includes a plurality of data, each data corresponding to a timestamp; The second acquisition unit is used to acquire the operating environment parameters when the RocksDB storage engine is running; when the operating environment parameters meet the preset conditions, acquire the current timestamp; The comparison unit is used to compare the current timestamp with the timestamp corresponding to each data in the multiple data to obtain at least one target timestamp; The deleting unit is used to delete the data corresponding to the at least one target timestamp, and merge the remaining data in the multiple data to obtain a target data set, wherein the merging includes compression, which is used to sort and merge the existing data, thereby deleting some no longer valid data, reducing the data size and the number of files, and speeding up the reading speed; When the target physiological state parameter is a heart rate change curve within a specified time period, determining the target emotion type corresponding to the target physiological state parameter includes: Sampling the heart rate change curve to obtain multiple heart rate values; Performing an average operation on the multiple heart rate values ​​to obtain an average heart rate value; Determine a target heart rate level corresponding to the average heart rate value; Determining a target first emotion value corresponding to the target heart rate level according to a preset mapping relationship between the heart rate level and the first emotion value; Performing a mean square error calculation based on the multiple heart rate values ​​to obtain a target mean square error; According to a preset mapping relationship between the mean square error and the second emotion value, determining a target second emotion value corresponding to the target mean square error; Determine a target weight pair corresponding to the target heart rate level according to a preset mapping relationship between the heart rate level and the weight pair, wherein the weight pair includes a first weight and a second weight, wherein the first weight is a weight corresponding to the first emotion value, and the second weight is a weight corresponding to the second emotion value; Performing a weighted operation on the target first emotion value, the target second emotion value and the target weight value to obtain a final emotion value; According to a preset mapping relationship between emotion values ​​and emotion types, the target emotion type corresponding to the target emotion value is determined.

10. The device according to claim 9, characterized in that The timestamp of each data in the plurality of data is used to record the existence time corresponding to the data. In the aspect of comparing the current timestamp with the timestamp corresponding to each data in the plurality of data to obtain at least one target timestamp, the comparing unit is specifically used to: Determine the time length between the current timestamp and the timestamp corresponding to each of the multiple data and the current timestamp to obtain multiple time lengths; Selecting a time length greater than a preset threshold from the multiple time lengths to obtain at least one target time length; The timestamp of the data corresponding to the at least one target time length is used as the at least one target timestamp.

11. The device according to claim 10, characterized in that The comparison unit is also specifically used for: Obtaining a target CPU usage rate of the electronic device; According to the mapping relationship between the preset CPU usage and the threshold, the preset threshold corresponding to the target CPU usage is determined.

12. The device according to claim 9, characterized in that The timestamp of each data in the plurality of data is used to record the expiration time corresponding to the data. In the aspect of comparing the current timestamp with the timestamp corresponding to each data in the plurality of data to obtain at least one target timestamp, the comparing unit is specifically used to: Obtaining a timestamp corresponding to each of the multiple data to obtain multiple timestamps; Determine the timestamps of the multiple timestamps that are earlier than the current timestamp to obtain the at least one target timestamp.

13. The device according to any one of claims 9 to 12, characterized in that: In the aspect of comparing the current timestamp with the timestamp corresponding to each of the plurality of data to obtain at least one target timestamp, the comparing unit is specifically configured to: The current timestamp is compared with a timestamp corresponding to each of the multiple data through a hook function in the RocksDB storage engine to obtain at least one target timestamp.

14. The device according to any one of claims 9 to 12, characterized in that: In the aspect of deleting the data corresponding to the at least one target timestamp, the deleting unit is specifically used to: determining a number of target timestamps corresponding to the at least one target timestamp; Determine the target number of threads corresponding to the at least one target timestamp according to a preset mapping relationship between the number of timestamps and the number of threads; Thread loading is performed according to the target number of threads, and data corresponding to the at least one target timestamp is deleted according to the loaded threads, and each data corresponding to the target timestamp corresponds to one thread.

15. The device according to any one of claims 9 to 12, characterized in that: The device further comprises: a receiving unit, wherein: The receiving unit is used to receive a data clearing instruction; The second acquisition unit responds to the data clearing instruction to execute the step of acquiring the current timestamp.

16. An electronic device, characterized in that: The method comprises a processor, 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 programs include instructions for executing the steps in the method according to any one of claims 1 to 8.

17. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 8.

18. A computer program product, characterized in that The computer program product comprises a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute the method according to any one of claims 1-8.