Method and device for determining data change trend, electronic equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIVIEW TECH CO LTD
- Filing Date
- 2024-12-20
- Publication Date
- 2026-06-23
AI Technical Summary
In existing technologies, determining data change trends is inefficient and relies on actual data, making automatic analysis impossible.
By segmenting the data trend image, identifying the region of interest, and using the Hough line detection algorithm to determine the feature data of the line segments, the data trend can be automatically analyzed.
It improves the efficiency of determining data change trends, reduces reliance on actual data, reduces human intervention, and significantly reduces the complexity of data processing.
Smart Images

Figure CN122265367A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for determining data change trends. Background Technology
[0002] Data trends represent how data performs throughout its characteristic lifecycle. Analyzing these trends can lead to methods for reverse suppression, thereby achieving the desired outcome. For example, during the focusing process of an optical module, environmental vibrations can cause the image's focusing data to become discrete, resulting in a blurred image. In this case, monitoring data trends can help adjust the focusing process in a timely manner, thus correcting the result.
[0003] In related technologies, it is usually necessary to combine actual data and use mathematical logic to manually analyze data change trends.
[0004] However, the aforementioned technologies require manual analysis of data trends, which reduces the efficiency of determining data trends and relies on actual data. Summary of the Invention
[0005] This invention provides a method, apparatus, electronic device, and storage medium for determining data change trends, in order to address the shortcomings of existing technologies that reduce the efficiency of determining data change trends and require reliance on actual data.
[0006] This invention provides a method for determining data change trends, comprising the following steps.
[0007] The data change trend image is segmented to obtain at least two regions of interest, each region of interest including a line segment representing the data change trend; For each region of interest, feature data corresponding to the region of interest is determined based on the line segments within the region of interest; Based on the feature data of each region of interest, the data change trend in the data change trend image is determined.
[0008] According to a method for determining data change trends provided by the present invention, the segmentation of the data change trend image to obtain at least two regions of interest includes: Determine the target axis representing the number of data samples in the data change trend image; Based on the values corresponding to the target axis, determine the data sampling interval; The data change trend image is segmented based on the sampling interval to obtain at least two regions of interest.
[0009] According to a method for determining data change trends provided by the present invention, determining the feature data corresponding to the region of interest based on line segments in the region of interest includes: For each region of interest, a first angle is determined between the line segment of the region of interest and the target line segment, wherein the target line segment is parallel to the target axis, and the target axis is the data axis representing the number of data samples in the data change trend image; Determine the second included angle between the line segment in the region of interest and the line segment in the adjacent next region of interest; The first included angle and the second included angle are determined as the feature data corresponding to the region of interest.
[0010] According to a method for determining data change trends provided by the present invention, determining the data change trend in the data change trend image based on feature data of each of the regions of interest includes: When the second included angle is greater than the first included angle, it is determined that the data change trend of the next region of interest is the same as the data change trend of the region of interest; When the second included angle is smaller than the first included angle, it is determined that the data change trend of the latter region of interest is opposite to the data change trend of the region of interest; When the second included angle is equal to the first included angle, it is determined that neither the second region of interest nor the region of interest shows a data change trend.
[0011] According to a method for determining data change trends provided by the present invention, the method further includes: Determine the target slope of the line segment of the first region of interest in the data change trend image, and determine the data change trend of the first region of interest based on the target slope; If the data change trend of a second region of interest adjacent to the first region of interest is the same as the data change trend of the first region of interest, the data change trend of the first region of interest is determined as the data change trend of the second region of interest. If the data change trend of the second region of interest is opposite to that of the first region of interest, the opposite trend of the data change trend of the first region of interest shall be determined as the data change trend of the second region of interest. Based on the data change trend of the second region of interest, the data change trend of the third region of interest adjacent to the second region of interest is determined, until the data change trend of the last region of interest in the data change trend image is determined.
[0012] According to a method for determining data change trends provided by the present invention, the method further includes: In two adjacent regions of interest, if the data trend of the latter region of interest is downward and the data trend of the former region of interest is upward, the intersection of the line segments of the latter region of interest and the line segments of the former region of interest is determined as the peak position. In two adjacent regions of interest, if the data trend of the latter region of interest is upward and the data trend of the former region of interest is downward, the intersection of the line segments of the latter region of interest and the line segments of the former region of interest is determined as the trough position.
[0013] According to a method for determining data change trends provided by the present invention, the feature data includes the slope of line segments in the region of interest; Determining the data change trend in the data change trend image based on the feature data of each of the regions of interest includes: If the slope of a line segment in the region of interest is greater than zero, the data change trend in the region of interest is determined to be an upward trend. If the slope of a line segment in the region of interest is less than zero, the data change trend of the region of interest is determined to be a downward trend.
[0014] The present invention also provides an apparatus for determining data change trends, comprising: A segmentation unit is used to segment a data change trend image to obtain at least two regions of interest, wherein the regions of interest include line segments that characterize the data change trend; The first determining unit is used to determine the feature data corresponding to each region of interest based on the line segments in the region of interest. The second determining unit is used to determine the data change trend in the data change trend image based on the feature data of each of the regions of interest.
[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for determining data change trends as described above.
[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for determining data change trends as described above.
[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method for determining data change trends as described above.
[0018] The present invention provides a method, apparatus, electronic device, and storage medium for determining data change trends. The method segments a data change trend image to obtain at least two regions of interest (ROIs), each containing line segments characterizing the data change trend. For each ROI, feature data corresponding to the ROI is determined based on the line segments within it. Based on the feature data of each ROI, the data change trend in the data change trend image is determined. Therefore, the present invention can automatically determine the data change trend based on the feature data of each ROI in the data change trend image, improving the efficiency of data change trend determination, and does not require reliance on actual data. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is one of the flowcharts illustrating the method for determining data change trends provided in this embodiment of the invention.
[0021] Figure 2 This is a schematic diagram of the data change trend image provided in the embodiment of the present invention.
[0022] Figure 3 This is a schematic diagram of OCR-based digital recognition provided in an embodiment of the present invention.
[0023] Figure 4 This is a schematic diagram of the region of interest provided in an embodiment of the present invention.
[0024] Figure 5 This is the second flowchart illustrating the method for determining data change trends provided in this embodiment of the invention.
[0025] Figure 6 This is one of the schematic diagrams of two adjacent regions of interest provided in the embodiments of the present invention.
[0026] Figure 7 This is the second schematic diagram of two adjacent regions of interest provided in the embodiments of the present invention.
[0027] Figure 8 This is the third schematic diagram of two adjacent regions of interest provided in the embodiments of the present invention.
[0028] Figure 9 This is the fourth schematic diagram of two adjacent regions of interest provided in the embodiments of the present invention.
[0029] Figure 10 This is the third flowchart illustrating the method for determining data change trends provided in this embodiment of the invention.
[0030] Figure 11 This is a schematic diagram of the Hough line detection algorithm provided in an embodiment of the present invention for detecting lines.
[0031] Figure 12 This is a schematic diagram of the structure of the data change trend determination device provided in the embodiment of the present invention.
[0032] Figure 13 This is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0034] The following is combined with Figures 1-11 This invention describes a method for determining data change trends. The subject executing this method can be an electronic device such as a terminal, camera, computer, or server, or a data change trend determination device installed in that electronic device. This data change trend determination device can be implemented through software, hardware, or a combination of both.
[0035] Figure 1 This is one of the flowcharts illustrating the method for determining data change trends provided in this embodiment of the invention, such as... Figure 1 As shown, the method for determining the trend of this data change includes the following steps: Step 101: Segment the data change trend image to obtain at least two regions of interest, wherein the regions of interest include line segments that characterize the data change trend.
[0036] Among them, the data change trend image can be an image obtained by taking a picture of the data change trend image generated for the target scene. The target scene can be any scene that can generate changing data, such as a health monitoring scene, a high-precision data control scene, or a flat data analysis scene.
[0037] For example, when acquiring a data trend image, a target axis representing the number of data samples can be detected within the image. Upon detection, each value corresponding to the target axis can be identified. The leftmost and rightmost values corresponding to the target axis are selected, and the difference between the rightmost and leftmost values is determined as the number of segments corresponding to the target axis. The difference between the coordinates of the rightmost and leftmost values is determined as the data length, and the ratio of the data length to the number of segments is determined as the sampling interval. The data trend image is then segmented based on the sampling interval to obtain at least two regions of interest. Alternatively, the distance between two adjacent values corresponding to the target axis can be determined, and this distance is defined as the sampling interval. The data trend image can then be segmented based on the sampling interval to obtain at least two regions of interest.
[0038] Step 102: For each region of interest, determine the feature data corresponding to the region of interest based on the line segments in the region of interest.
[0039] For example, when each region of interest is obtained, the Hough line detection algorithm can be used to detect line segments in each region of interest, thereby obtaining the slope corresponding to the line segment. The slope corresponding to the line segment can be determined as the feature data corresponding to the region of interest.
[0040] It should be noted that the specific principle of the Hough line detection algorithm is as follows: First, an edge detection algorithm (such as the Canny edge detector) is used to identify edge pixels in the region of interest. For each edge pixel in the region of interest, all possible parameters of the line to which the edge pixel may belong are calculated. In the Hough transform, a line can be represented in polar coordinates as ρ = xcos(θ) + ysin(θ), where ρ represents the distance from the origin to the line, and θ represents the angle between the line and the x-axis. Then, in the Hough space (parameter space), an accumulator array is used to record the number of votes for each possible (θ, ρ) combination. Whenever an edge pixel matches a certain (θ, ρ) combination, a vote is added to the corresponding cell in the accumulator array. After all edge pixels have been processed, the accumulator array is analyzed to find the cell with the most votes, i.e., the peak. These peaks correspond to the lines that may exist in the region of interest because these peaks are supported by the most edge pixels. Finally, using the (θ, ρ) values corresponding to the peaks in the accumulator array, the equation of the line in the region of interest is reconstructed. In this way, the parameters of the detected line in the region of interest can be obtained, thereby determining the position and direction of the line and obtaining the slope corresponding to the line segment.
[0041] Step 103: Based on the feature data of each region of interest, determine the data change trend in the data change trend image.
[0042] For example, when the feature data corresponding to each region of interest is obtained, the feature data corresponding to all regions of interest are analyzed to determine the data change trend in the data change trend image.
[0043] The method for determining data change trends provided by this invention segments a data change trend image to obtain at least two regions of interest (ROIs), each containing line segments representing the data change trend. For each ROI, feature data corresponding to the ROI is determined based on the line segments within it. Based on the feature data of each ROI, the data change trend in the data change trend image is determined. This invention can automatically determine data change trends based on the feature data of the ROIs in the data change trend image, improving the efficiency of data change trend determination without relying on actual data. Furthermore, this invention analyzes data change trends based on a visual method, eliminating the need for manual intervention, significantly reducing the complexity of data processing, and providing an intuitive and efficient presentation of the conclusions regarding data change trends.
[0044] In one embodiment, step 101 above segments the data change trend image to obtain at least two regions of interest, which can be achieved in the following way: Determine the target axis representing the number of data samples in the data change trend image; determine the sampling interval of the data based on the values corresponding to the target axis; segment the data change trend image based on the sampling interval to obtain the at least two regions of interest.
[0045] For example, Optical Character Recognition (OCR) is used to identify the target axis representing the number of data samples in the data trend image. When the target axis is identified, OCR is further used to identify all the values corresponding to the target axis, and the size of each value is compared to obtain the maximum and minimum values. The difference between the maximum and minimum values is determined as the number of segments corresponding to the target axis, and the difference between the coordinate values corresponding to the maximum and minimum values is determined as the data length L. The ratio of the data length L to the number of segments is determined as the sampling interval. Finally, the data trend image is segmented based on the sampling interval to obtain multiple regions of interest. Each region of interest corresponds to a segment, and all the obtained regions of interest are arranged in the order of the values corresponding to the target axis to obtain a set of regions of interest.
[0046] Figure 2 This is a schematic diagram of the data change trend image provided in the embodiments of the present invention, such as... Figure 2As shown, the data trend graph is a line graph, and the target axis is the horizontal axis. The horizontal axis includes values from 0 to 18. The minimum value is 0 and the maximum value is 18. Therefore, the number of segments is 18-0=18, resulting in 18 regions of interest.
[0047] Figure 3 This is a schematic diagram of OCR-based digital recognition provided in an embodiment of the present invention, such as... Figure 3 As shown, the numbers in the green box are recognized using OCR. The recognized numbers from left to right are 1, 6, 1, 1, 1, 4, 5 and 0.
[0048] Figure 4 This is a schematic diagram of the region of interest provided in an embodiment of the present invention, such as... Figure 4 As shown, they respectively demonstrate Figure 2 The data trend image shown includes regions of interest corresponding to values 1 to 2, values 2 to 3, and values 3 to 4 on the target axis.
[0049] In this embodiment, the sampling interval of the data is determined based on the values corresponding to the target axis in the data change trend image, and the data change trend image is automatically segmented based on the sampling interval to obtain each region of interest, thereby improving the efficiency of obtaining the region of interest and further improving the efficiency of determining the data change trend.
[0050] In one embodiment, Figure 5 This is a second flowchart illustrating the method for determining data change trends provided in this embodiment of the invention. Figure 5 As shown, step 102 above determines the feature data corresponding to the region of interest based on the line segments in the region of interest, which can be implemented through the following steps: Step 1021: For each region of interest, determine the first angle between the line segment of the region of interest and the target line segment. The target line segment is parallel to the target axis, which is the data axis representing the number of data samples in the data change trend image.
[0051] For example, for each region of interest, a target line segment horizontal to the target axis needs to be drawn in the region of interest. Based on the equations corresponding to the target line segment and the line segment in the region of interest, the first angle between the line segment in the region of interest and the target line segment is calculated. Figure 6 This is one of the schematic diagrams of two adjacent regions of interest provided in the embodiments of the present invention, such as... Figure 6 As shown, the red dashed line is the target line segment. The first angle between line segment 601 in the region of interest and the red dashed line is θ, and part of the first angle θ is within the region of interest.
[0052] It should be noted that the equations corresponding to the line segments in the region of interest can be obtained by the Hough line detection algorithm or based on the image coordinates of each point on the line segment in the region of interest; similarly, the equations corresponding to the target line segments can be obtained by the Hough line detection algorithm or based on the image coordinates of each point on the target line segment, and this invention does not limit the specific equations.
[0053] Step 1022: Determine the second included angle between the line segment of the region of interest and the line segment in the adjacent next region of interest.
[0054] For example, such as Figure 6 As shown, the second included angle between line segment 601 in the region of interest and line segment 602 in the next region of interest is β, and part of the second included angle β is within the region of interest. Specifically, the second included angle between line segment 601 and line segment 602 can be calculated based on the equations corresponding to line segment 601 and line segment 602.
[0055] Step 1023: Determine the first included angle and the second included angle as the feature data corresponding to the region of interest.
[0056] For example, after determining the first included angle and the second included angle, both the first included angle and the second included angle are determined as feature data corresponding to the region of interest.
[0057] In this embodiment, feature data corresponding to the region of interest is determined based on the first included angle and the second included angle. The comparison of the first included angle and the second included angle is used to determine whether the data change trends of two adjacent regions of interest are the same, thereby improving the accuracy of the determination of data change trends.
[0058] In one embodiment, step 103 above determines the data change trend in the data change trend image based on the feature data of each of the regions of interest, which can be implemented in the following ways: When the second included angle is greater than the first included angle, it is determined that the data change trend of the next region of interest is the same as the data change trend of the region of interest.
[0059] For example, for each region of interest in the set of regions of interest, when determining the first included angle θ and the second included angle β corresponding to the region of interest, the first included angle θ and the second included angle β are compared. If the second included angle β is greater than the first included angle θ, it is determined that the data change trend of the next region of interest is the same as the data change trend of the current region of interest. Figure 6 As shown, if the second included angle β is greater than the first included angle θ, then it can be concluded that the data change trend corresponding to the next region of interest is the same as the data change trend of the region of interest. Figure 7 This is a second schematic diagram of two adjacent regions of interest provided in an embodiment of the present invention, such as... Figure 7 As shown, the second included angle β is also greater than the first included angle θ, so it can be concluded that the data change trend corresponding to the next region of interest is the same as the data change trend of the region of interest.
[0060] When the second included angle is smaller than the first included angle, the data change trend of the next region of interest is determined to be opposite to the data change trend of the region of interest.
[0061] For example, for each region of interest in the set of regions of interest, when determining the first included angle θ and the second included angle β corresponding to the region of interest, the first included angle θ and the second included angle β are compared. When the second included angle β is less than the first included angle θ, it is determined that the data change trend of the next region of interest is opposite to the data change trend of the region of interest. Figure 8 This is the third schematic diagram of two adjacent regions of interest provided in the embodiments of the present invention, as shown in Figure 3. Figure 8 As shown, if the second included angle β is less than the first included angle θ, then the data change trend corresponding to the next region of interest is opposite to the data change trend of the region of interest. Figure 9 This is the fourth schematic diagram of two adjacent regions of interest provided in the embodiments of the present invention, as shown below. Figure 9 As shown, the second included angle β is also smaller than the first included angle θ, so it can be concluded that the data change trend corresponding to the next region of interest is opposite to the data change trend of the region of interest.
[0062] When the second included angle is equal to the first included angle, it is determined that neither the second region of interest nor the region of interest shows a data change trend.
[0063] For example, when the second included angle β is equal to the first included angle θ, it means that there is no data change trend in both the subsequent region of interest and the current region of interest, that is, the line segments of the subsequent region of interest and the current region of interest are both straight lines parallel to the target axis.
[0064] In this embodiment, the data change trend can be automatically determined based on the comparison of the first included angle and the second included angle, which improves the accuracy and efficiency of the data change trend determination.
[0065] In one embodiment, Figure 10 This is the third flowchart illustrating the method for determining data change trends provided in this embodiment of the invention. Figure 10 As shown, the method for determining the trend of this data change also includes the following steps: Step 1001: Determine the target slope of the line segment of the first region of interest in the data change trend image, and determine the data change trend of the first region of interest based on the target slope.
[0066] For example, the Hough line detection algorithm can be used to detect the line segment of the first region of interest, and then determine the target slope of the line segment. The target slope is compared with zero. When the target slope is greater than zero, it means that the data is gradually increasing, and the data change trend of the first region of interest is determined to be an upward trend. When the target slope is less than zero, it means that the data is gradually decreasing, and the data change trend of the first region of interest is determined to be a downward trend.
[0067] It should be noted that the coordinates of the starting point and ending point of the line segment of the first region of interest along the target axis can also be obtained. Substituting these coordinates into the equation corresponding to the line segment of the first region of interest, the coordinates of the starting point and ending point along the target axis can be obtained. By comparing these coordinates, it can be determined that the data change trend of the first region of interest is downward. This invention does not limit this process.
[0068] Step 1002: If the data change trend of the second region of interest adjacent to the first region of interest is the same as the data change trend of the first region of interest, the data change trend of the first region of interest is determined as the data change trend of the second region of interest.
[0069] For example, if the data change trend of the second region of interest adjacent to the first region of interest is the same as the data change trend of the first region of interest, and it is determined that the data change trend of the first region of interest is an upward trend, then the data change trend of the second region of interest is also an upward trend.
[0070] Step 1003: If the data change trend of the second region of interest is opposite to the data change trend of the first region of interest, the opposite trend of the data change trend of the first region of interest shall be determined as the data change trend of the second region of interest.
[0071] For example, if the data change trend of the second region of interest adjacent to the first region of interest is opposite to the data change trend of the first region of interest, and the data change trend of the first region of interest is determined to be an upward trend, then the data change trend of the second region of interest is also a downward trend.
[0072] Step 1004: Based on the data change trend of the second region of interest, determine the data change trend of the third region of interest adjacent to the second region of interest, until the data change trend of the last region of interest in the data change trend image is determined.
[0073] For example, after determining the data change trend of the second region of interest, it is determined whether the data change trend of the second region of interest is the same as the data change trend of the adjacent third region of interest. If the data change trend of the second region of interest is the same as the data change trend of the adjacent third region of interest, then the data change trend of the second region of interest is determined as the data change trend of the third region of interest; if the data change trend of the second region of interest is opposite to the data change trend of the adjacent third region of interest, then the opposite trend of the data change trend of the second region of interest is determined as the data change trend of the third region of interest, and so on, until the data change trend of the last region of interest in the data change trend image is determined.
[0074] In this embodiment, the data change trend of the first region of interest is determined based on the target slope corresponding to the line segment of the first region of interest. This allows the data change trend of each subsequent region of interest to be compared with the data change trend of the previous region of interest. In this way, only the slope of the line segment of the first region of interest needs to be calculated, thereby reducing the computational workload of the slope.
[0075] In one embodiment, the method for determining the data change trend further includes the following steps: In two adjacent regions of interest, if the data trend of the latter region of interest is downward and the data trend of the former region of interest is upward, the intersection of the line segments of the latter region of interest and the line segments of the former region of interest is determined as the peak position.
[0076] For example, such as Figure 8 As shown, if the data trend corresponding to the previous region of interest is determined to be upward, and the data trend corresponding to the next region of interest is determined to be downward, then the intersection point K1 of the line segments included in the next region of interest and the line segments included in the previous region of interest can be determined as the peak position. Following the same method, all peak positions in the data trend graph can be obtained.
[0077] In two adjacent regions of interest, if the data trend of the latter region of interest is upward and the data trend of the former region of interest is downward, the intersection of the line segments of the latter region of interest and the line segments of the former region of interest is determined as the trough position.
[0078] For example, such as Figure 9As shown, if the data trend corresponding to the previous region of interest is determined to be downward, and the data trend corresponding to the next region of interest is determined to be upward, then the intersection point K2 of the line segments included in the next region of interest and the line segments included in the previous region of interest can be determined as the trough position. Following the same method, all trough positions in the data trend graph can be obtained.
[0079] When identifying all trough and peak positions in a data trend graph, arranging these positions according to their corresponding values on the target axis allows analysis of the overall trend graph's tonal relationships. Furthermore, peak and trough positions can be used to locate outliers, improving the efficiency of anomaly detection.
[0080] It should be noted that when corresponding values are displayed on the axis perpendicular to the target axis in the data change trend image, the peak data corresponding to the peak position and the trough data corresponding to the trough position can also be determined based on the value corresponding to the axis. This makes it convenient for users to analyze and evaluate the operation of the corresponding scenario based on the peak data and trough data. This invention does not limit this.
[0081] In this embodiment, all trough and peak positions in the data change trend image can be quickly determined based on the data change trend of each region of interest, improving the efficiency of trough and peak position determination. Furthermore, abnormal data can be located through peak and trough positions, improving the efficiency of abnormal data location.
[0082] In one embodiment, the feature data includes the slope of line segments in the region of interest; step 103 above determines the data change trend in the data change trend image based on the feature data of each region of interest, which can be further implemented in the following ways: If the slope of a line segment in the region of interest is greater than zero, the data trend of the region of interest is determined to be an upward trend; if the slope of a line segment in the region of interest is less than zero, the data trend of the region of interest is determined to be a downward trend.
[0083] For example, the Hough line detection algorithm can be used to detect line segments in a region of interest, and then determine the slope of those line segments. Figure 11 This is a schematic diagram of the Hough line detection algorithm provided in an embodiment of the present invention for detecting lines, as shown below. Figure 11 As shown, the left image includes four lines to be detected, and the right image shows each line detected by the Hough line detection algorithm.
[0084] When obtaining the slope of a line segment within a region of interest, the slope is compared to zero. If the slope is greater than zero, it indicates that the data is gradually increasing, thus determining that the data trend in the region of interest is upward. If the slope is less than zero, it indicates that the data is gradually decreasing, thus determining that the data trend in the region of interest is downward. Of course, if the slope is equal to zero, it indicates that the data is not changing, thus determining that the data trend in the region of interest is stationary.
[0085] Furthermore, when the data trend image includes multiple regions of interest (ROIs), i.e., multiple line segments, if the data trend of the corresponding ROI is determined based on the slope of each line segment, the peak and / or trough positions can also be determined based on the data trend of each ROI. For example, if the slope of the line segments included in the previous ROI is K... x-1 The slope of the line segment included in the region of interest of the second target is K. x If based on slope K x-1 and K x By comparing the data trends, if the data trend corresponding to the previous region of interest is determined to be downward and the data trend corresponding to the next region of interest is determined to be upward, then the intersection of the line segments included in the next region of interest and the line segments included in the previous region of interest can be determined as the trough locations. Following the same method, all trough locations in the data trend graph can be obtained. If based on the slope K... x-1 and K x By comparing the data trends of the preceding region of interest (ROI) and determining that the data trend of the following ROI is upward and downward, the intersection of the line segments included in the following ROI and the line segments included in the preceding ROI can be identified as peak positions. Using the same method, all peak positions in the data trend image can be obtained. Furthermore, based on all trough and peak positions in the data trend image, the tonal relationships of the entire data trend image can be analyzed.
[0086] The apparatus for determining data change trends provided by the present invention will be described below. The apparatus for determining data change trends described below can be referred to in correspondence with the method for determining data change trends described above.
[0087] Figure 12 This is a schematic diagram of the data change trend determination device provided in an embodiment of the present invention, as shown below. Figure 12 As shown, the data trend determination device 1200 includes a segmentation unit 1201, a first determination unit 1202, and a second determination unit 1203; wherein: The segmentation unit 1201 is used to segment the data change trend image to obtain at least two regions of interest, wherein the regions of interest include line segments that characterize the data change trend; The first determining unit 1202 is used to determine the feature data corresponding to each region of interest based on the line segments in the region of interest. The second determining unit 1203 is used to determine the data change trend in the data change trend image based on the feature data of each of the regions of interest.
[0088] The data change trend determination device provided by this invention segments a data change trend image to obtain at least two regions of interest (ROIs), each containing line segments characterizing the data change trend. For each ROI, feature data corresponding to the ROI is determined based on the line segments within it. Based on the feature data of each ROI, the data change trend in the data change trend image is determined. Therefore, this invention can automatically determine the data change trend based on the feature data of each ROI in the data change trend image, improving the efficiency of data change trend determination without relying on actual data.
[0089] Based on any of the above embodiments, the segmentation unit 1201 is specifically used for: Determine the target axis representing the number of data samples in the data change trend image; Based on the values corresponding to the target axis, determine the data sampling interval; The data change trend image is segmented based on the sampling interval to obtain at least two regions of interest.
[0090] Based on any of the above embodiments, the first determining unit 1202 is specifically used for: For each region of interest, a first angle is determined between the line segment of the region of interest and the target line segment, wherein the target line segment is parallel to the target axis, and the target axis is the data axis representing the number of data samples in the data change trend image; Determine the second included angle between a line segment in the region of interest and a line segment in the adjacent next region of interest, wherein a portion of the first included angle and a portion of the second included angle are located within the region of interest; The first included angle and the second included angle are determined as the feature data corresponding to the region of interest.
[0091] Based on any of the above embodiments, the second determining unit 1203 is specifically used for: When the second included angle is greater than the first included angle, it is determined that the data change trend of the next region of interest is the same as the data change trend of the region of interest; When the second included angle is smaller than the first included angle, it is determined that the data change trend of the latter region of interest is opposite to the data change trend of the region of interest; When the second included angle is equal to the first included angle, it is determined that neither the second region of interest nor the region of interest shows a data change trend.
[0092] Based on any of the above embodiments, the data change trend determination device 1200 further includes: The third determining unit is used to determine the target slope of the line segment of the first region of interest in the data change trend image, and to determine the data change trend of the first region of interest based on the target slope; The fourth determining unit is used to determine the data change trend of the first region of interest as the data change trend of the second region of interest when the data change trend of the second region of interest adjacent to the first region of interest is the same as the data change trend of the first region of interest. The fifth determining unit is used to determine the opposite trend of the data change trend of the first region of interest as the data change trend of the second region of interest when the data change trend of the second region of interest is opposite to the data change trend of the first region of interest. The sixth determining unit is used to determine the data change trend of a third region of interest adjacent to the second region of interest based on the data change trend of the second region of interest, until the data change trend of the last region of interest in the data change trend image is determined.
[0093] Based on any of the above embodiments, the data change trend determination device 1200 further includes: The seventh determining unit is used to determine the intersection point of the line segment of the second region of interest and the line segment of the first region of interest as the peak position when the data change trend of the second region of interest is downward and the data change trend of the first region of interest is upward. The eighth determining unit is used to determine the intersection point of the line segment of the second region of interest and the line segment of the first region of interest as the trough position when the data change trend of the second region of interest is upward and the data change trend of the first region of interest is downward in two adjacent regions of interest.
[0094] Based on any of the above embodiments, the feature data includes the slope of the line segment in the region of interest; the second determining unit 1203 is specifically used for: If the slope of a line segment in the region of interest is greater than zero, the data change trend in the region of interest is determined to be an upward trend. If the slope of a line segment in the region of interest is less than zero, the data change trend of the region of interest is determined to be a downward trend.
[0095] Figure 13 This is a schematic diagram of the physical structure of the electronic device provided in the embodiments of the present invention, such as... Figure 13 As shown, the electronic device may include a processor 1310, a communications interface 1320, a memory 1330, and a communication bus 1340, wherein the processor 1310, the communications interface 1320, and the memory 1330 communicate with each other via the communication bus 1340. The processor 1310 can invoke logical instructions in the memory 1330 to execute a method for determining data change trends. This method includes: segmenting a data change trend image to obtain at least two regions of interest, each region of interest including line segments characterizing the data change trend; for each region of interest, determining feature data corresponding to the region of interest based on the line segments within the region of interest; and determining the data change trend in the data change trend image based on the feature data of each region of interest.
[0096] Furthermore, the logical instructions in the aforementioned memory 1330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0097] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the data change trend determination method provided by the above methods. The method includes: segmenting a data change trend image to obtain at least two regions of interest, each region of interest including line segments characterizing the data change trend; determining feature data corresponding to each region of interest based on the line segments in the region of interest; and determining the data change trend in the data change trend image based on the feature data of each region of interest.
[0098] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for determining data change trends provided by the methods described above. The method includes: segmenting a data change trend image to obtain at least two regions of interest, each region of interest including line segments characterizing a data change trend; for each region of interest, determining feature data corresponding to the region of interest based on the line segments within the region of interest; and determining the data change trend in the data change trend image based on the feature data of each region of interest.
[0099] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0100] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for determining data change trends, characterized in that, include: The data change trend image is segmented to obtain at least two regions of interest, each region of interest including a line segment representing the data change trend; For each region of interest, feature data corresponding to the region of interest is determined based on the line segments within the region of interest; Based on the feature data of each region of interest, the data change trend in the data change trend image is determined.
2. The method for determining data change trends according to claim 1, characterized in that, The segmentation of the data change trend image yields at least two regions of interest, including: Determine the target axis representing the number of data samples in the data change trend image; Based on the values corresponding to the target axis, determine the data sampling interval; The data change trend image is segmented based on the sampling interval to obtain at least two regions of interest.
3. The method for determining data change trends according to claim 1, characterized in that, The step of determining the feature data corresponding to the region of interest based on line segments in the region of interest includes: For each region of interest, a first angle is determined between the line segment of the region of interest and the target line segment, wherein the target line segment is parallel to the target axis, and the target axis is the data axis representing the number of data samples in the data change trend image; Determine the second included angle between the line segment in the region of interest and the line segment in the adjacent next region of interest; The first included angle and the second included angle are determined as the feature data corresponding to the region of interest.
4. The method for determining data change trends according to claim 3, characterized in that, Determining the data change trend in the data change trend image based on the feature data of each of the regions of interest includes: When the second included angle is greater than the first included angle, it is determined that the data change trend of the next region of interest is the same as the data change trend of the region of interest; When the second included angle is smaller than the first included angle, it is determined that the data change trend of the latter region of interest is opposite to the data change trend of the region of interest; When the second included angle is equal to the first included angle, it is determined that neither the second region of interest nor the region of interest shows a data change trend.
5. The method for determining data change trends according to claim 4, characterized in that, The method further includes: Determine the target slope of the line segment of the first region of interest in the data change trend image, and determine the data change trend of the first region of interest based on the target slope; If the data change trend of a second region of interest adjacent to the first region of interest is the same as the data change trend of the first region of interest, the data change trend of the first region of interest is determined as the data change trend of the second region of interest. If the data change trend of the second region of interest is opposite to that of the first region of interest, the opposite trend of the data change trend of the first region of interest shall be determined as the data change trend of the second region of interest. Based on the data change trend of the second region of interest, the data change trend of the third region of interest adjacent to the second region of interest is determined, until the data change trend of the last region of interest in the data change trend image is determined.
6. The method for determining data change trends according to any one of claims 1-5, characterized in that, The method further includes: In two adjacent regions of interest, if the data trend of the latter region of interest is downward and the data trend of the former region of interest is upward, the intersection of the line segments of the latter region of interest and the line segments of the former region of interest is determined as the peak position. In two adjacent regions of interest, if the data trend of the latter region of interest is upward and the data trend of the former region of interest is downward, the intersection of the line segments of the latter region of interest and the line segments of the former region of interest is determined as the trough position.
7. The method for determining data change trends according to claim 1, characterized in that, The feature data includes the slope of the line segments in the region of interest; Determining the data change trend in the data change trend image based on the feature data of each of the regions of interest includes: If the slope of a line segment in the region of interest is greater than zero, the data change trend in the region of interest is determined to be an upward trend. If the slope of a line segment in the region of interest is less than zero, the data change trend of the region of interest is determined to be a downward trend.
8. A device for determining data change trends, characterized in that, include: A segmentation unit is used to segment a data change trend image to obtain at least two regions of interest, wherein the regions of interest include line segments that characterize the data change trend; The first determining unit is used to determine the feature data corresponding to each region of interest based on the line segments in the region of interest. The second determining unit is used to determine the data change trend in the data change trend image based on the feature data of each of the regions of interest.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for determining the data change trend as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for determining the data change trend as described in any one of claims 1 to 7.