Data processing method and apparatus
By storing health data as a two-dimensional array, the problem of low data processing efficiency in electronic devices is solved, resulting in faster front-end display and more efficient memory usage.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-10
- Publication Date
- 2026-04-07
AI Technical Summary
Existing electronic devices have low data processing efficiency when processing health data, resulting in slow display speed of health charts on the front end.
By associating and storing health data values and collection timestamps as a two-dimensional array, the data processing method is optimized, sorting and deduplication are reduced, and data processing efficiency is improved.
It improves the speed of displaying health charts on the front end, saves memory resources, and optimizes the data processing performance of electronic devices.
Smart Images

Figure CN115568834B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of health monitoring technology, and in particular to a data processing method and apparatus. Background Technology
[0002] With the increasing prevalence of health devices today, routine health monitoring has gradually become one of the important reasons for people to choose health devices. Health devices can collect corresponding types of health data through various sensors, store the collected health data in a file with a collection timestamp, and then when the user checks their health status, the health device reads the health data from the file and displays it on the front end.
[0003] Existing electronic devices, such as embedded devices, can serve as health monitoring devices for daily health monitoring. These devices collect health data such as heart rate, blood pressure, blood oxygen, and exercise based on sensors that fit the human body, and process this data to display health charts on the front end, meeting the user's need to check their health status at any time. However, the high frequency of health data collection by sensors results in a large amount of health data that the electronic devices need to process. For electronic devices with limited hardware processing capabilities, the data processing efficiency is low, and the speed of displaying health charts on the front end is slow. Summary of the Invention
[0004] This application provides a data processing method, an electronic device, and a storage medium. By assigning values to a two-dimensional array of health data, the processing method of health data is optimized, the processing efficiency of health data is improved, and the speed of displaying health charts on the front end is increased, thus solving the problem of slow display of health charts in existing electronic devices.
[0005] In a first aspect, embodiments of this application provide a data processing method, including:
[0006] Collect health data and write the health data to a data file; wherein the health data includes data values and collection timestamps;
[0007] In response to a health data read request, target health data collected within a target time period is obtained from the data file;
[0008] The two-dimensional array of the target health data is assigned values according to the first rule; wherein the two-dimensional array includes a time dimension and a data value dimension;
[0009] The assigned two-dimensional array is displayed according to the second rule.
[0010] Secondly, embodiments of this application provide a data processing apparatus, including:
[0011] A data storage module is used to collect health data and write the health data to a data file; wherein the health data includes data values and collection timestamps;
[0012] The data reading module is used to respond to a health data reading request and obtain the target health data collected within the target time period from the data file;
[0013] An array assignment module is used to assign values to a two-dimensional array of the target health data according to a first rule; wherein the two-dimensional array includes a time dimension and a data value dimension;
[0014] The data display module is used to display the assigned two-dimensional array according to the second rule.
[0015] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the data processing method as described in the first aspect.
[0016] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, they implement the data processing method as described in the first aspect.
[0017] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the data processing method as described in the first aspect.
[0018] In this embodiment, the data values and collection timestamps of real-time collected health data are associated and stored in a data file. Upon receiving a health data read request, the data values and collection timestamps of the target health data collected within the target time period are retrieved from the data file. The target health data is traversed, and the column and row indices of the two-dimensional array are assigned values corresponding to the data values and collection timestamps of the target health data. This assigned two-dimensional array represents the different data values of the target health data within the target time period. The assigned two-dimensional array is then displayed on the front end to show the data values collected by the electronic device within the target time period. Using this technique, the different data values of the target health data within the target time period can be displayed using a two-dimensional array after only one traversal of the target health data. This eliminates the need for multiple rounds of sorting and deduplication of the target health data values, effectively saving data processing time, improving data processing efficiency, and thus increasing the speed of displaying health charts on the front end. Furthermore, assigning values to the two-dimensional array does not require excessive memory space, saving memory resources of the electronic device and optimizing its data processing performance. Attached Figure Description
[0019] Figure 1 This is a schematic flowchart of a data processing method provided in one embodiment of this application;
[0020] Figure 2 This is a schematic diagram of an embedded device collecting and storing health data according to an embodiment of this application;
[0021] Figure 3 This is a flowchart illustrating the generation of a target two-dimensional array of target health data, provided in an embodiment of this application.
[0022] Figure 4 This is a schematic diagram of the target two-dimensional array provided in the embodiments of this application;
[0023] Figure 5 This is a first schematic diagram of a blood pressure chart provided in an embodiment of this application;
[0024] Figure 6 This is a flowchart of drawing a health chart based on a target two-dimensional array, provided in an embodiment of this application;
[0025] Figure 7 This is a flowchart illustrating the generation of a one-dimensional array with a preset time period, provided in an embodiment of this application.
[0026] Figure 8 This is a flowchart of drawing a health chart according to the second rule provided in an embodiment of this application;
[0027] Figure 9 This is a second schematic diagram of the blood pressure chart provided in the embodiments of this application;
[0028] Figure 10 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this application;
[0029] Figure 11 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application;
[0030] Figure 12 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0031] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0032] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0033] The data processing method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0034] Figure 1 This is a schematic flowchart illustrating a data processing method according to one embodiment of this application. (Reference) Figure 1 The data processing method includes:
[0035] S110. Collect health data and write the health data to a data file; wherein, the health data includes data values and collection timestamps.
[0036] This embodiment describes the data processing method using a wearable embedded device as the executing entity. The wearable embedded device can be a smartwatch, smart bracelet, or other smart device. The embedded device is equipped with sensor modules such as heart rate sensors, blood pressure sensors, and motion sensors. These sensor modules collect health data values such as heart rate, blood pressure, and movement speed from the user wearing the embedded device. The sensor modules send the collected health data values to the embedded device's processor. The processor determines the acquisition timestamp of the received data value based on the timestamp, packages the data value and the corresponding acquisition timestamp to generate health data, and stores the health data in the embedded device's memory.
[0037] In this embodiment, Figure 2 This is a schematic diagram illustrating the collection and storage of health data by an embedded device provided in an embodiment of this application. For example... Figure 2As shown, the sensor module sends the collected data values to the processor. The processor determines the data acquisition timestamp and associates the data value and timestamp with each other, saving them in a general data structure to generate corresponding health data. This health data is then written to a data file. The data file is the storage space in the memory used to store the health data. Since the data in the memory is not cleared when the embedded device is powered on or off, the health data is persistently stored in the data file, preventing data loss. Furthermore, the general data structure only stores the health data value and timestamp, standardizing data storage rules and preventing the data file from storing too much useless data, thus saving memory space.
[0038] It should be noted that different sensor modules have different acquisition frequencies. For example, a heart rate sensor acquires a heart rate value every 5 seconds, and a blood pressure sensor acquires a blood pressure value every 15 seconds. Therefore, the data value received by the processor each time may be one or more types of health data. In this embodiment, to facilitate data classification and management, the processor stores various health data into corresponding type data files. For example, the processor currently receives blood pressure and heart rate values, determines the acquisition timestamps of the blood pressure and heart rate values, associates the blood pressure value with the acquisition timestamp, saves it to a general data structure to generate blood pressure data, and writes the blood pressure data to a blood pressure data file. Similarly, it associates the heart rate value with the acquisition timestamp, saves it to a general data structure to generate heart rate data, and writes the heart rate data to a heart rate data file.
[0039] In existing technologies, when a user checks their health status for the day through a health monitoring application on an embedded device, the processor reads health data from a data file into memory and calculates common data values representing the day's health status, such as average, maximum, and minimum values, based on the health data in memory. These common data values are then displayed on the front end of the health monitoring application. Each time the front end displays common data values, the processor spends time determining the maximum, minimum, and average values from the large amount of health data collected that day, resulting in low front-end display efficiency. To address this, this embodiment proposes that the embedded device calculates the maximum, minimum, and average values of the health data collected that day as soon as it acquires health data, thereby improving the efficiency of subsequent front-end display.
[0040] In this embodiment, commonly used data values for a target time period are determined based on health data values and stored in memory. These commonly used data values include at least one of the average, maximum, and minimum values of the data collected within the target time period. The target time period refers to the time interval from a preset time point to the current time point. The preset time point could be midnight of the current day or midnight on Monday, and can be set according to actual needs. This embodiment uses blood pressure data collection via an embedded device as an example. (Reference) Figure 2 After a preset time point, when the processor acquires the first blood pressure value collected by the blood pressure sensor, it determines this value as the average, maximum, and minimum values of blood pressure values collected within the target time period. This value is then saved as the data value, maximum value, minimum value, and average value in a custom data structure to generate commonly used blood pressure data, which is written into memory. When the processor acquires the second blood pressure value, it reads the maximum, minimum, and average values of the commonly used blood pressure data from memory. The read maximum and minimum values are compared with the second blood pressure value to determine the maximum and minimum values of blood pressure values collected within the target time period. Based on the read average value and the second blood pressure value, the average value of blood pressure values collected within the target time period is determined. The currently stored commonly used blood pressure data is deleted, and the maximum, minimum, and average values of blood pressure values collected within the target time period are saved to a custom data structure to generate new commonly used blood pressure data, which is then stored in memory. This process continues, and after acquiring the latest blood pressure value from the blood pressure sensor, the processor reads the maximum, minimum, and average values of the blood pressure value determined at the previous moment from memory. Based on the currently collected blood pressure values and the maximum, minimum, and average values read from the database, the maximum, minimum, and average blood pressure values within the target time period are determined. These values are then saved to a custom data structure to generate new frequently used blood pressure data. This new frequently used blood pressure data is stored in memory to update the existing data. This embodiment allows for rapid retrieval of frequently used data values from memory each time they are displayed on the front end, effectively saving data processing time and improving both data processing and front-end display efficiency.
[0041] In another embodiment, after the processor writes the health data to a data file, it stores the health data value and the collection timestamp in memory. (See reference...) Figure 2 The processor acquires the latest blood pressure value from the blood pressure sensor and determines the acquisition timestamp. It then saves the blood pressure value, acquisition timestamp, and frequently used blood pressure data within the target time period into a custom data structure to generate frequently used blood pressure data, which is then written into memory. Similarly, in this embodiment, each time the front-end displays real-time acquired data values, the latest acquired data value can be quickly read from memory for display, eliminating the need for frequent memory access. This effectively improves the hardware performance of the embedded device, thereby enhancing data processing efficiency and front-end display efficiency.
[0042] S120. In response to the health data read request, retrieve the target health data collected within the target time period from the data file.
[0043] The health data read request is generated when a user checks their current health status through a health monitoring application. The system responds to this request by displaying the user's current health data to the front end. Target health data refers to all health data collected by the sensor module within a target time period.
[0044] In one embodiment, a first touch operation to enter the health data interface is received, and a health data read request is generated based on the first touch operation. Here, the health data interface refers to the front-end interface of the health monitoring application. Assuming the embedded device is a touchscreen watch, the user can open the health monitoring application by tapping the icon of the health monitoring application on the main page of the touchscreen watch. Launching the health monitoring application can be considered as the first touch operation to enter the health data interface. When the user taps the health monitoring application icon, the front-end of the health monitoring application receives the first touch operation and generates a health data read request based on the first trigger operation. The front-end sends the health data read request to the underlying layer of the health monitoring application. After receiving the health data read request, the underlying layer replies to the front-end that it has received the request and begins accurately displaying the data on the front-end.
[0045] This embodiment describes the target time period from midnight to the current time as an example. The underlying layer of the health monitoring application reads all blood pressure values collected from midnight to the present, along with their corresponding timestamps, from the blood pressure data file to obtain the target blood pressure data. The underlying layer performs deduplication and sorting on the blood pressure values in the target blood pressure data, and then provides the processed target blood pressure data to the front end. The front end displays the processed target blood pressure data, allowing users to view their blood pressure values for different time periods throughout the day. The reading and processing process for other types of target health data is similar.
[0046] The front-end of a health monitoring application can also display commonly used data values such as the maximum, minimum, and average values for a target time period, allowing users to more intuitively view their current health status. In this embodiment, in response to a health data read request, commonly used data values are read from memory and displayed. For example, after receiving a health data read request, the underlying layer reads commonly used blood pressure data from memory and provides this data to the front-end. The front-end then displays the maximum, minimum, and average blood pressure values for the day, as well as the current data value and its corresponding collection timestamp. Because commonly used blood pressure data is stored in memory, the underlying layer can quickly read and display this data, improving front-end display efficiency.
[0047] S130. Assign values to the two-dimensional array of target health data according to the first rule; wherein, the two-dimensional array includes a time dimension and a data value dimension.
[0048] In existing technologies, after the underlying layer reads the target health data from the data file, it sorts the data values according to the order of collection time and removes duplicate data values. However, sorting and deduplication are time-consuming and consume a lot of memory, which puts a heavy burden on embedded devices with poor hardware performance, resulting in low data processing efficiency. Therefore, this embodiment proposes to display the data values and collection timestamps of the target health data based on the element values in a two-dimensional array representing the time dimension and the data value dimension, saving memory space. Moreover, the process of assigning values to the elements of the two-dimensional array is relatively simple, without the need for sorting and deduplication, thus saving data processing time.
[0049] In this embodiment, the first rule refers to the rule that the row and column indices of a two-dimensional array correspond to the actual time in the time dimension and the data value in the data value dimension. For example, the first rule could be that a row index of a two-dimensional array corresponds to an hour segment within 24 hours, and a column index corresponds to an integer data value within the range of 0 to 100. The first rule can be set according to actual needs.
[0050] Furthermore, based on the time and data values corresponding to the row and column indices of the two-dimensional array as defined in the first rule, the element in the two-dimensional array corresponding to the target health data is determined, and the element is assigned a value to obtain a target two-dimensional array representing all data values of the target health data and the corresponding collection timestamp. Figure 3 This is a flowchart illustrating the generation of a target two-dimensional array of target health data, provided in an embodiment of this application. For example... Figure 3 As shown, the steps for generating the target two-dimensional array of target health data specifically include S1301-S1302:
[0051] S1301. Generate an initial two-dimensional array based on the preset data value range and preset time period in the first rule. The row subscript of the initial two-dimensional array corresponds to the preset time period in the time dimension, and the column subscript corresponds to the data value in the data value dimension.
[0052] This embodiment describes an example where the first rule is that a row index of a two-dimensional array corresponds to an hourly segment within 24 hours, and a column index corresponds to an integer data value within the range of 0 to 100. For example, based on the 24-hour period and the data value range of 0 to 100 in the first rule, an initial two-dimensional array of 24 rows and 100 columns is generated. The row indices of the initial two-dimensional array, from smallest to largest, correspond to the smallest and largest time segments. For example, the first row corresponds to the hourly segment from 0:00 to 1:00, the second row corresponds to the hourly segment from 1:00 to 2:00, and so on. The column indices of the initial two-dimensional array, from smallest to largest, correspond to the integer data values from smallest to largest. For example, the first column corresponds to the data value 1, the second column corresponds to the data value 2, and so on. Each element in the initial two-dimensional array is 0.
[0053] S1302. Traverse the target health data collected within the target time period, assign the first preset value to the elements in the initial two-dimensional array whose column index is the same as the data value of the target health data and whose row index corresponds to the preset time period containing the collection timestamp of the target health data, and obtain the target two-dimensional array.
[0054] Assuming the first preset value is 1, the system iterates through all blood pressure values and timestamps collected that day. In the initial two-dimensional array, elements with column indices matching the blood pressure value and row indices corresponding to the hour segment containing that blood pressure value's timestamp are set to 1. This process continues until the end of the iteration, resulting in a two-dimensional blood pressure array. For example, if a blood pressure of 66 was generated at 3:30 PM, the element in row 14, column 66 of the initial two-dimensional array would be set from 0 to 1. It's important to note that if the same data value is generated twice within the same hour segment, the corresponding element in the target two-dimensional array will still be set to 1, indicating that the data value was generated during that time period. Therefore, the target two-dimensional array indirectly achieves deduplication of data values. Furthermore, since the row indices in the target two-dimensional array are sorted in ascending order, and the corresponding timestamps are also sorted in ascending order, it indirectly achieves sorting of the data values by collection time. Compared to existing technologies that require traversing the target health data multiple times to complete deduplication and sorting, this embodiment only requires traversing the target health data once to complete deduplication and sorting, reducing the complexity of data processing, improving data processing efficiency, and enabling embedded devices to process large amounts of health data normally, thus ensuring the operating performance of the embedded devices.
[0055] Figure 4 This is a schematic diagram of the target two-dimensional array provided in an embodiment of this application. For example... Figure 4 As shown, based on the column and row indices of the elements with a value of 1 in the target two-dimensional array, the data value of the health data collected by the embedded device on that day and the hour segment in which the collection timestamp is located can be determined. For example, if the element in the 1st row and 3rd column is 1, then it is determined that the embedded device collected health data with a value of 3 in the hour segment from 0 to 1 on that day.
[0056] S140. Display the assigned two-dimensional array according to the second rule.
[0057] In this embodiment, the target two-dimensional array is the assigned two-dimensional array. The second rule refers to the rule for the front-end to draw health charts. For example, the second rule could be to display different data values for each hourly segment using dots, or to display the maximum data value for each hourly segment using a line graph. The health chart displays the health data collected within the target time period. Different types of health data are displayed using different health charts, such as blood pressure data displayed using a blood pressure chart.
[0058] In one embodiment, the second rule is to connect and display data values in each hourly segment whose difference is less than or equal to a second preset value, and to display data values whose difference is greater than the second preset value as dots. Assuming the first preset value is 1, the second preset value is 5, and the element values in the 66th, 70th, and 77th columns of the 4th row of the blood pressure two-dimensional array are 1, it can be determined that the embedded device collected blood pressure values of 66, 70, and 77 during the hourly segment from 3 AM to 4 AM that day. Since blood pressure values of 66 and 70 are less than 5, and blood pressure values of 77 and 70 are greater than 5, a line is drawn connecting the blood pressure values of 66 and 70 during the hourly segment from 3 AM to 4 AM on the blood pressure chart, and a dot is placed at the blood pressure value of 77 during the same hourly segment. Figure 5 This is a first schematic diagram of a blood pressure chart provided in an embodiment of this application. Figure 5 The horizontal axis of the blood pressure chart represents each hourly segment within a 24-hour period, and the vertical axis represents integer blood pressure values from 0 to 100. Assuming that the elements in the 66th, 70th, and 77th columns of the 4th row of the blood pressure two-dimensional array are all 1, then the blood pressure chart drawn according to the second rule would look like this. Figure 5 As shown.
[0059] In one embodiment, to improve the efficiency of front-end drawing health charts, the target two-dimensional array can be converted into a data format that the front-end can directly read and draw. Figure 6 This is a flowchart illustrating the creation of a health chart based on a target two-dimensional array, as provided in an embodiment of this application. Figure 6 As shown, the steps for drawing a health chart based on a target two-dimensional array specifically include S1401-S1403:
[0060] S1401. Based on the column index of the target element with the same row index in the target two-dimensional array, generate a one-dimensional array of the preset time period corresponding to the row index, and the element value of the target element is the first preset value.
[0061] For example, the target element with a value of 1 is obtained from the two-dimensional blood pressure array, and then its column and row indices are obtained. Based on the target element's row and column indices, the blood pressure values collected for each hour of the day are obtained, and all blood pressure values collected in the same hour are combined to generate a one-dimensional array corresponding to that hour. (Reference) Figure 4 The illustrated two-dimensional blood pressure array is traversed. The elements in the first row of the blood pressure array are traversed to obtain the column indices of the target elements, which are 3, 97, and 99. This yields the blood pressure values collected during the hourly period from 0:00 to 1:00 on the same day, which are 3, 97, and 99. This generates a one-dimensional array [3, 97, 99]. After the front-end receives this one-dimensional array [3, 97, 99], it compares the difference between the element value and the next element value in the one-dimensional array with a second preset value. Based on the comparison result, it performs point marking and / or line drawing.
[0062] In one embodiment, the display efficiency of health charts is affected when the front end compares the differences in data values. Therefore, this embodiment improves the efficiency of the front end in displaying health charts by converting the elements in a one-dimensional array within a preset time period into a storage structure that the front end can directly draw by connecting lines or dots. Figure 7 This is a flowchart illustrating the generation of a one-dimensional array with a preset time period, provided in an embodiment of this application. For example... Figure 7 As shown, the steps for generating a one-dimensional array for a preset time period specifically include S14011-S14013:
[0063] S14011. Traverse the target elements with the same row index in the target two-dimensional array, and compare the difference between the column index of the target element and the adjacent target element with the second preset value.
[0064] S14012. Mark the column subscripts of target elements whose column subscripts are greater than the second preset value as element values in a single-value array, and mark the column subscripts of target elements whose column subscripts are less than or equal to the second preset value and their adjacent target elements as element values in a double-value array.
[0065] S14013. Combine the single-value arrays and double-value arrays with the same row index to obtain a one-dimensional array corresponding to the preset time period.
[0066] In this embodiment, a single-value array refers to a one-dimensional array that stores one element, and a double-value array refers to a one-dimensional array that stores two elements. For example, traversing... Figure 4 The elements of the first row of the shown two-dimensional blood pressure array are used to obtain the column indices of the target elements as 3, 97, and 99. Assuming the second preset value is 5, the difference between 3 and 97 is greater than the preset value, so 3 is generated as a single-value array [3]. The difference between 97 and 99 is less than the preset value, so 97 and 99 are generated as a double-value array [97, 99]. The single-value array [3] and the double-value array [97, 99] of this hourly segment are combined to obtain the one-dimensional array [[3], [97, 99]] of this hourly segment. It should be noted that if multiple double-value arrays have the same element value, the multiple double-value arrays are merged into one double-value array. The element values of the merged double-value array are the maximum and minimum values of the corresponding multiple double-value arrays. For example, the column indices of the element value 1 in the second row are 66, 70, and 75, so the double-value arrays [66, 70] and [70, 75] are generated accordingly. The two double-value arrays are merged to obtain the double-value array [66, 75].
[0067] S1402. Combine the one-dimensional arrays of each preset time period to construct a one-dimensional array in object format.
[0068] For example, the one-dimensional arrays of each hour segment are combined into a single one-dimensional array, and this one-dimensional array is saved as an object to obtain an object-formatted one-dimensional array. For instance, if the current time is 3:30, the one-dimensional array from 0:00 to 1:00 is [[1, 10],
[88] ], the one-dimensional array from 1:00 to 2:00 is [0], the one-dimensional array from 2:00 to 3:00 is [0], and the one-dimensional array from 3:00 to 4:00 is [[7], [22, 66]]. The one-dimensional arrays of each hour segment are combined to construct an object-formatted one-dimensional array {"array": [[[1, 10],
[88] ], [0], [0], [[7], [22, 66]], [0], [0], ... [0]]}. Compared to the cJSON format in existing technologies, the object format can be directly used by the front-end rendering without further syntax parsing, improving the efficiency of front-end health chart drawing.
[0069] S1403. Display the health chart corresponding to the one-dimensional array of the object format based on the second rule.
[0070] For example, after the underlying layer constructs a one-dimensional array in object format, it sends the one-dimensional array in object format to the front end. The front end then draws points or lines in the corresponding hourly segment of the health chart based on the single-value array and double-value array in the one-dimensional array of each hourly segment in the one-dimensional array in object format, according to the second rule. Figure 8 This is a flowchart illustrating the drawing of a health chart according to the second rule, provided in an embodiment of this application. For example... Figure 8 As shown, the steps for drawing a health chart according to the second rule specifically include S14031-S14032:
[0071] S14031. The element values of the single-value array in the one-dimensional array of the object format and the corresponding preset time period are displayed as dots at the corresponding data values and preset time periods in the health chart.
[0072] S14032. Based on the element values of the double-value array in the one-dimensional array of the object format and the corresponding preset time period, a line is connected between the data value and the preset time period in the health chart.
[0073] For example, the front end uses a one-dimensional array in object format {"array":[[[1, 10],
[68] ], [0], [0], [[7], [22, 66]], [0], [0], ... [0]]} to determine the one-dimensional array from 0:00 to 1:00 as [[1, 10],
[68] ], from 1:00 to 2:00 as [0], from 2:00 to 3:00 as [0], and from 3:00 to 4:00 as [[7], [22, 66]]. From the one-dimensional array from 0:00 to 1:00 [[1, 10],
[68] ], the double-value array [1, 10] and the single-value array
[68] are obtained. From the one-dimensional array from 3:00 to 4:00, the single-value array [7] and the double-value array [22, 66] are obtained. No data is generated for other hourly segments. Figure 9 This is a second schematic diagram of the blood pressure chart provided in the embodiments of this application. For example... Figure 9 As shown, based on the double-value array [0, 10] from point 0 to point 1, a line is drawn from blood pressure value 1 to blood pressure value 10 during the time interval from point 0 to point 1 on the blood pressure chart. Based on the single-value array
[68] from point 0 to point 1, a point is marked at blood pressure value 68 during the time interval from point 0 to point 1 on the blood pressure chart. Based on the single-value array [7] from point 3 to point 4, a point is marked at blood pressure value 7 during the time interval from point 3 to point 4 on the blood pressure chart. Based on the double-value array [22, 66] from point 3 to point 4, a line is drawn from blood pressure value 22 to blood pressure value 66 during the time interval from point 3 to point 4 on the blood pressure chart.
[0074] After the front-end draws the health chart, users can view the data values for each hour of the day through the chart. Since the embedded device collects the user's health data in real time, the health chart is also updated in real time based on the currently collected health data. In this embodiment, the data value and collection timestamp are read from memory, and dots are added to the corresponding data value and preset time period on the health chart based on the data value and collection timestamp. For example, if the embedded device keeps the health data interface open, since the health data interface has already displayed the previously drawn health chart, the front-end can retrieve the currently collected data value and collection timestamp from memory and add dots to the data value at the hour corresponding to the collection timestamp of the health chart already displayed on the health data interface. In this embodiment, when refreshing the health chart displayed on the health data interface, there is no need to obtain a one-dimensional array in object format from the underlying layer; instead, dots are drawn based only on the currently collected data values. This effectively improves the update efficiency of the front-end health chart, reduces the frequency of the embedded device accessing the data file, and indirectly optimizes the hardware storage performance of the embedded device.
[0075] In summary, the data processing method provided in this embodiment stores the data values and collection timestamps of real-time collected health data in a data file. Upon receiving a health data read request, it retrieves the data values and collection timestamps of the target health data collected within the target time period from the data file. It iterates through the target health data, assigning values to the elements in a two-dimensional array corresponding to the data values and collection timestamps of the target health data, thus representing the different data values of the target health data within the target time period through the assigned two-dimensional array. The assigned two-dimensional array is then displayed on the front end to show the data values collected by the electronic device within the target time period. Using the above techniques, a single iteration of the target health data is sufficient to display the different data values of the target health data within the target time period through a two-dimensional array, eliminating the need for multiple loop sorting and deduplication processes on the target health data values. This effectively saves data processing time, improves data processing efficiency, and consequently increases the speed of displaying health charts on the front end. Furthermore, assigning values to the two-dimensional array does not require excessive memory space, saving memory resources of the electronic device and optimizing its data processing performance.
[0076] It should be noted that the data processing method provided in this application embodiment can be executed by a data processing device or a control module within that data processing device for executing the data processing method. This application embodiment uses the execution of the data processing method by a data processing device as an example to illustrate the data processing device provided in this application embodiment.
[0077] Figure 10 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this application. Figure 10 As shown, the data processing device includes: a data storage module 201, a data reading module 202, an array assignment module 203, and a data display module 204.
[0078] The data storage module is used to collect health data and write it to a data file; the health data includes data values and collection timestamps.
[0079] The data reading module is used to respond to health data reading requests and obtain target health data collected within the target time period from the data file;
[0080] The array assignment module is used to assign values to a two-dimensional array of target health data according to the first rule; the two-dimensional array includes a time dimension and a data value dimension.
[0081] The data display module is used to display the assigned two-dimensional array according to the second rule.
[0082] Based on the above embodiments, the data storage module further includes: a common data storage unit, used to determine common data values for a target time period based on the data values of the health data after collecting health data and writing the health data to a data file, and store the common data values in memory. The common data values include at least one of the average, maximum, and minimum values of the data values collected within the target time period. The data display module further includes: a common data display unit, used to read the common data values from memory and display the common data values after responding to a health data read request.
[0083] Based on the above embodiments, the array assignment module includes: an initial two-dimensional array generation unit, used to generate an initial two-dimensional array based on a preset data value range and a preset time period in the first rule, wherein the row index of the initial two-dimensional array corresponds to the preset time period in the time dimension, and the column index corresponds to the data value in the data value dimension; and a target two-dimensional array generation unit, used to traverse the target health data collected within the target time period, assign a first preset value to the elements in the initial two-dimensional array whose column index is the same as the data value of the target health data, and whose row index corresponds to the preset time period containing the collection timestamp of the target health data, thereby obtaining the target two-dimensional array.
[0084] Based on the above embodiments, the data processing device includes: a one-dimensional array generation module, used to generate a one-dimensional array of a preset time period corresponding to the column index of the target element in the same row of the target two-dimensional array before displaying the assigned two-dimensional array according to the second rule; the element value of the target element is a first preset value; an array format conversion module, used to combine the one-dimensional arrays of each preset time period to construct a one-dimensional array of object format; and a data display module including: a health icon display unit, used to display the health chart corresponding to the one-dimensional array of object format based on the second rule.
[0085] Based on the above embodiments, the one-dimensional array generation module includes: a comparison unit, used to traverse the target elements with the same row index in the target two-dimensional array and compare the column index difference between the target element and the adjacent target element with a second preset value; a single-value array generation unit, used to mark the column index of the target element whose column index difference is greater than the second preset value as the element value in the single-value array, and mark the column index of the target element whose column index difference is less than or equal to the second preset value and the adjacent target element as the element value in the double-value array; and an array combination unit, used to combine the single-value array and the double-value array with the same row index to obtain a one-dimensional array corresponding to a preset time period.
[0086] Based on the above embodiments, the health icon display unit includes: a dot display subunit, used to display dots at the corresponding data values and preset time periods of the health chart based on the element values of the single-value array in the one-dimensional array of the object format and the corresponding preset time periods; and a line display subunit, used to display lines at the corresponding data values and preset time periods of the health chart based on the element values of the double-value array in the one-dimensional array of the object format and the corresponding preset time periods.
[0087] Based on the above embodiments, the data storage module further includes: a data caching unit, used to store the data value and collection timestamp of the health data in memory after collecting health data and writing the health data to a data file; the data display module further includes: a data dot display unit, used to read the data value and collection timestamp from memory after displaying the assigned two-dimensional array according to the second rule, and to perform dot display at the corresponding data value and preset time period of the health chart according to the data value and collection timestamp.
[0088] In summary, the data processing device provided in this embodiment stores the data values and collection timestamps of real-time collected health data in a data file. Upon receiving a health data read request, it retrieves the data values and collection timestamps of the target health data collected within the target time period from the data file. It iterates through the target health data, assigning values to the elements in a two-dimensional array corresponding to the data values and collection timestamps of the target health data, thus representing the different data values of the target health data within the target time period through the assigned two-dimensional array. The assigned two-dimensional array is then displayed on the front end to show the data values collected by the electronic device within the target time period. Through the above technical means, a single traversal of the target health data is sufficient to display the different data values of the target health data within the target time period using a two-dimensional array. This eliminates the need for multiple loop sorting and deduplication processes on the target health data values, effectively saving data processing time, improving data processing efficiency, and consequently increasing the speed of displaying health charts on the front end. Furthermore, assigning values to the two-dimensional array does not require excessive memory space, saving memory resources of the electronic device and optimizing its data processing performance.
[0089] The data processing device in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be handheld computers, in-vehicle electronic devices, and wearable devices, while non-mobile electronic devices can be television sets (TVs), etc. This application embodiment does not impose specific limitations.
[0090] The data processing device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.
[0091] The data processing device provided in this application embodiment can achieve... Figures 1 to 9 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0092] Optionally, such as Figure 11 As shown, this application embodiment also provides an electronic device 30, including a processor 301, a memory 302, and a program or instructions stored in the memory 302 and executable on the processor 301. When the program or instructions are executed by the processor 301, they implement the various processes of the above-described data processing method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0093] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.
[0094] Figure 12 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0095] The electronic device 40 includes, but is not limited to, components such as: radio frequency unit 403, network module 404, audio output unit 405, input unit 406, sensor 407, display unit 408, user input unit 409, interface unit 410, memory 402, and processor 401.
[0096] Those skilled in the art will understand that the electronic device 40 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 401 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 12 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0097] The processor 401 is used to collect health data and write the health data to a data file; wherein the health data includes data values and collection timestamps; in response to a health data read request, it retrieves the target health data collected within a target time period from the data file; assigns values to a two-dimensional array of the target health data according to a first rule; wherein the two-dimensional array includes a time dimension and a data value dimension; and displays the assigned two-dimensional array according to a second rule.
[0098] Optionally, the processor 401 is further configured to, after collecting health data and writing the health data to a data file, determine common data values for a target time period based on the data values of the health data, and store the common data values in memory, wherein the common data values include at least one of the average, maximum, and minimum values of the data values collected within the target time period; and, in response to a health data read request, read the common data values from memory and display the common data values.
[0099] Optionally, the processor 401 is further configured to generate an initial two-dimensional array based on a preset data value range and a preset time period in the first rule, wherein the row index of the initial two-dimensional array corresponds to the preset time period in the time dimension and the column index corresponds to the data value in the data value dimension; traverse the target health data collected within the target time period, assign a first preset value to the elements in the initial two-dimensional array whose column index is the same as the data value of the target health data and whose row index corresponds to the preset time period containing the collection timestamp of the target health data, thereby obtaining the target two-dimensional array.
[0100] Optionally, the processor 401 is further configured to, before displaying the assigned two-dimensional array according to the second rule, generate a one-dimensional array of a preset time period corresponding to the column index of the target element in the same row of the target two-dimensional array, wherein the element value of the target element is a first preset value; combine the one-dimensional arrays of each preset time period to construct a one-dimensional array in object format; and display the health chart corresponding to the one-dimensional array in object format based on the second rule.
[0101] Optionally, the processor 401 is further configured to traverse the target elements with the same row index in the target two-dimensional array, compare the column index difference between the target element and the adjacent target element with a second preset value; mark the column index of the target element whose column index difference is greater than the second preset value as the element value in the single-value array, and mark the column index of the target element whose column index difference is less than or equal to the second preset value and the adjacent target element as the element value in the double-value array; and combine the single-value array and the double-value array with the same row index to obtain a one-dimensional array corresponding to the preset time period.
[0102] Optionally, the processor 401 is also used to display the element values of the single-value array in the one-dimensional array of the object format and the corresponding preset time period as dots at the corresponding data values and preset time periods in the health chart; and to display the element values of the double-value array in the one-dimensional array of the object format and the corresponding preset time periods as lines at the corresponding data values and preset time periods in the health chart.
[0103] Optionally, the processor 401 is further configured to, after collecting health data and writing the health data to a data file, store the data value and collection timestamp of the health data in memory; after displaying the assigned two-dimensional array according to the second rule, read the data value and collection timestamp from memory, and display the data value and collection timestamp at the corresponding data value and preset time period in the health chart.
[0104] In summary, the electronic device provided in this embodiment stores the data values and collection timestamps of real-time collected health data in a data file. Upon receiving a health data read request, it retrieves the data values and collection timestamps of the target health data collected within the target time period from the data file. It iterates through the target health data, assigning values to the elements in a two-dimensional array corresponding to the data values and collection timestamps of the target health data, thus representing the different data values of the target health data within the target time period through the assigned two-dimensional array. The assigned two-dimensional array is then displayed on the front end to show the data values collected by the electronic device within the target time period. Through this technical means, a single iteration of the target health data is sufficient to display the different data values of the target health data within the target time period using a two-dimensional array. This eliminates the need for multiple loop sorting and deduplication processes on the target health data values, effectively saving data processing time, improving data processing efficiency, and consequently increasing the speed of displaying health charts on the front end. Furthermore, assigning values to the two-dimensional array does not require excessive memory space, saving memory resources of the electronic device and optimizing its data processing performance.
[0105] It should be understood that, in this embodiment, the input unit 406 may include a graphics processing unit (GPU) 4061 and a microphone 4062. The GPU 4061 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 408 may include a display panel 4081, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 409 includes a touch panel 4091 and other input devices 4092. The touch panel 4091 is also called a touch screen. The touch panel 4091 may include a touch detection device and a touch controller. Other input devices 409 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here. The memory 402 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understandable that the aforementioned modem processor may not be integrated into processor 401.
[0106] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described data processing method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0107] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0108] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above data processing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0109] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0110] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0111] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0112] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A data processing method, characterized in that, include: Collect health data and write the health data to a data file; wherein the health data includes data values and collection timestamps; In response to a health data read request, target health data collected within a target time period is obtained from the data file; The two-dimensional array of target health data is assigned values according to the first rule; wherein the two-dimensional array includes a time dimension and a data value dimension; the assignment of values to the two-dimensional array of target health data according to the first rule includes: generating an initial two-dimensional array based on a preset data value range and a preset time period in the first rule, wherein the row index of the initial two-dimensional array corresponds to the preset time period under the time dimension, and the column index corresponds to the data value under the data value dimension; traversing the target health data collected within the target time period, assigning a first preset value to the elements in the initial two-dimensional array whose column index is the same as the data value of the target health data and whose row index corresponds to the preset time period containing the collection timestamp of the target health data, thereby obtaining the target two-dimensional array; According to the second rule, the target health data corresponding to each preset time period in the target two-dimensional array are plotted into corresponding health charts.
2. The method according to claim 1, characterized in that, After collecting health data and writing the health data to a data file, the method further includes: Based on the data values of the health data, the commonly used data values for the target time period are determined and stored in memory. The commonly used data values include at least one of the average, maximum, and minimum values of the data collected within the target time period. Following the response to the health data read request, the following is also included: Read the commonly used data values from the memory and display the commonly used data values.
3. The method according to claim 1, characterized in that, Before plotting the target health data corresponding to each preset time period in the target two-dimensional array into a corresponding health chart according to the second rule, the process includes: Based on the column index of the target element with the same row index in the target two-dimensional array, a one-dimensional array of the preset time period with the corresponding row index is generated, and the element value of the target element is the first preset value; A one-dimensional array in object format is constructed by combining the one-dimensional arrays of each preset time period. The two-dimensional array after being assigned values according to the second rule includes: Based on the second rule, display the health chart corresponding to the one-dimensional array of the object format.
4. The method according to claim 3, characterized in that, The step of generating a one-dimensional array of the preset time period corresponding to the column index of the target element with the same row index in the target two-dimensional array includes: Traverse the target elements at the same row index in the target two-dimensional array, and compare the column index difference between the target element and the adjacent target element with a second preset value; The column subscripts of target elements whose column subscripts are greater than the second preset value are marked as element values in a single-value array, and the column subscripts of target elements whose column subscripts are less than or equal to the second preset value and their adjacent target elements are marked as element values in a double-value array. The single-value array and the double-value array with the same row index are combined to obtain a one-dimensional array corresponding to the preset time period.
5. The method according to claim 4, characterized in that, The step of displaying the health chart corresponding to the one-dimensional array in the object format based on the second rule includes: Based on the element values of the single-value array in the one-dimensional array of the object format and the corresponding preset time period, dots are displayed at the data values and preset time periods corresponding to the health chart; Based on the element values of the two-value array in the one-dimensional array of the object format and the corresponding preset time period, a line is connected between the data value and the preset time period in the health chart.
6. The method according to claim 5, characterized in that, After collecting health data and writing the health data to a data file, the method further includes: The data values and collection timestamps of the health data are stored in memory; Following the display of the assigned values of the two-dimensional array according to the second rule, the following is also included: The data value and the collection timestamp are read from the memory, and points are marked at the corresponding data value and preset time period in the health chart according to the data value and the collection timestamp.
7. A data processing apparatus, characterized in that, include: A data storage module is used to collect health data and write the health data to a data file; wherein the health data includes data values and collection timestamps; The data reading module is used to respond to a health data reading request and obtain the target health data collected within the target time period from the data file; An array assignment module is used to assign values to a two-dimensional array of the target health data according to a first rule; wherein the two-dimensional array includes a time dimension and a data value dimension; the array assignment module includes: an initial two-dimensional array generation unit, used to generate an initial two-dimensional array based on a preset data value range and a preset time period in the first rule, wherein the row index of the initial two-dimensional array corresponds to the preset time period under the time dimension, and the column index corresponds to the data value under the data value dimension; a target two-dimensional array generation unit, used to traverse the target health data collected within the target time period, and assign a first preset value to the elements in the initial two-dimensional array whose column index is the same as the data value of the target health data and whose row index corresponds to the preset time period containing the collection timestamp of the target health data, thereby obtaining a target two-dimensional array; The data display module is used to draw the target health data corresponding to each preset time period in the target two-dimensional array into a corresponding health chart according to the second rule.
8. The apparatus according to claim 7, characterized in that, The data storage module further includes: A common data storage unit is used to determine the common data values for the target time period based on the data values of the health data after the health data is collected and written to a data file, and to store the common data values in memory. The common data values include at least one of the average, maximum and minimum values of the data values collected within the target time period. The data display module also includes: A common data display unit is used to read the common data value from the memory and display the common data value after responding to the health data read request.
9. The apparatus according to claim 7, characterized in that, The data processing device includes: A one-dimensional array generation module is used to generate a one-dimensional array of the preset time period corresponding to the row index of the target element in the target two-dimensional array before displaying the assigned value according to the second rule. The element value of the target element is the first preset value. The array format conversion module is used to combine the one-dimensional arrays of each preset time period to construct a one-dimensional array in object format; The data display module includes: A health icon display unit is used to display a health chart corresponding to a one-dimensional array of the object format based on the second rule.
10. The apparatus according to claim 9, characterized in that, The one-dimensional array generation module includes: The comparison unit is used to traverse the target elements with the same row index in the target two-dimensional array and compare the column index difference between the target element and the adjacent target element with a second preset value. The single-value and double-value array generation unit is used to mark the column subscripts of target elements whose column subscript difference values are greater than the second preset value as element values in the single-value array, and to mark the column subscripts of target elements whose column subscript difference values are less than or equal to the second preset value and adjacent target elements as element values in the double-value array. An array combination unit is used to combine the single-value array and the double-value array with the same row index to obtain a one-dimensional array corresponding to the preset time period.
11. The apparatus according to claim 10, characterized in that, The health icon display unit includes: The dot display subunit is used to display dots at the data values and preset time periods corresponding to the health chart based on the element values of the single-value array in the one-dimensional array of the object format and the corresponding preset time periods; The line display subunit is used to display a line connecting the data value and the preset time period corresponding to the health chart based on the element values of the double-value array in the one-dimensional array of the object format and the corresponding preset time period.
12. The apparatus according to claim 11, characterized in that, The data storage module further includes: A data caching unit is used to store the data value and collection timestamp of the health data in memory after the health data is collected and written to a data file; The data display module also includes: The data dot display unit is used to read the data value and the collection timestamp from the memory after the two-dimensional array is displayed according to the second rule, and to display dots at the data value and preset time period corresponding to the health chart according to the data value and the collection timestamp.
Citation Information
Patent Citations
Terminal and method for acquiring electrocardiogram data information
CN101803916A
Human body state evaluation method and device, human body data visualization method and device, equipment and medium
CN112489798A
Reference offset calibration algorithm system for blood glucose data monitoring
CN113796858A