Image-based fluctuation trend recognition method, device, computer equipment and medium

By using smoothing parameter filtering and difference technology in fluctuation trend identification to determine the inflection point and perform peak and valley searches, the inefficiency problem caused by point-by-point judgment in the existing technology is solved, and the calculation efficiency and accuracy are improved.

CN112464794BActive Publication Date: 2024-09-06E FUND MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011340307.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-25
Publication Date
2024-09-06
Estimated Expiration
2040-11-25

AI Technical Summary

Technical Problem

In the existing technology, the image-based fluctuation trend identification method relies on point-by-point judgment, resulting in low computational efficiency. Especially when processing images with large differences in batches, the efficiency problem is serious.

Method used

By obtaining the fluctuation curve, determining smoothing parameters, filtering short-term fluctuations, using differential technology to determine the initial inflection point, and conducting peak and valley searches within a predetermined time range, the target inflection point and fluctuation trend state are determined, and information representing the trend state is output.

Benefits of technology

The calculation efficiency is improved, invalid high and low point identification is reduced, the accuracy and calculation efficiency of inflection point identification are improved, and the time occupied is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112464794B
    Figure CN112464794B
Patent Text Reader

Abstract

The present invention provides a method, device, computer equipment and medium for identifying fluctuation trends based on images. The method includes: obtaining a fluctuation curve in an image to be identified, wherein the fluctuation curve represents a time series; determining a smoothing parameter according to the fluctuation curve; filtering short-term fluctuations in the fluctuation curve according to the smoothing parameter to obtain a smooth time series; determining an inflection point on the smooth time series by a differential technique to obtain an initial inflection point; performing a peak-valley search within a predetermined time range from the initial inflection point to obtain a target inflection point; determining the fluctuation trend state of the fluctuation curve according to the peak-valley relationship between adjacent target inflection points; and outputting state information representing the fluctuation trend state. Through the present invention, the computational efficiency of computer recognition of fluctuation trends of fluctuation curves in images can be improved, and the recognition accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to an image-based fluctuation trend recognition method, device, computer equipment and medium. Background Art

[0002] In the field of image recognition technology, it is often necessary to identify the fluctuation trend of fluctuation curves in order to determine the changing trend of variables. For example, in securities research, by identifying the fluctuation curve of stock trading prices, the rising or falling trend of stocks can be identified, and clarifying the turning point of stock prices is the basis for subsequent research. For another example, in consumer index research, by identifying the sales fluctuation curve of a certain type of supplies, that is, the sales fluctuation curve of multiple commodities in this type of supplies, the rising or falling area of ​​this type of supplies can be identified, and then the corresponding changes in the consumer index can be clarified. The problem of identifying the changing trend of the fluctuation curve is very easy for the human eye, but it is not so easy for computers.

[0003] In the prior art, when computers identify fluctuation trends based on images, a method that relies on point-by-point judgment is proposed. Specifically, it is to judge point by point whether the current point is the local highest point (peak) or the lowest point (valley). The trend is downward from the highest point to the lowest point, and upward from the lowest point to the highest point. Since it is necessary to judge the high and low points point by point, its running speed is very slow, resulting in low computational efficiency of this method. In particular, when the computer needs to complete the trend identification of fluctuation curves in a large number of images with large differences in batches, the problems of the above method are further magnified.

[0004] Therefore, how to improve the computational efficiency of image-based fluctuation trend identification has become a technical problem that needs to be urgently solved in this field. Summary of the invention

[0005] The purpose of the present invention is to provide an image-based fluctuation trend recognition method, device, computer equipment and medium to solve the technical problems in the prior art.

[0006] On the one hand, to achieve the above objectives, the present invention provides an image-based fluctuation trend recognition method.

[0007] The image-based fluctuation trend recognition method includes: obtaining a fluctuation curve in an image to be recognized, wherein the fluctuation curve represents a time series; determining a smoothing parameter according to the fluctuation curve; filtering short-term fluctuations in the fluctuation curve according to the smoothing parameter to obtain a smooth time series; determining an inflection point on the smooth time series by a differential technique to obtain an initial inflection point; performing a peak-valley search within a predetermined time range from the initial inflection point to obtain a target inflection point; determining a fluctuation trend state of the fluctuation curve according to a peak-valley relationship between adjacent target inflection points; and outputting state information representing the fluctuation trend state.

[0008] Furthermore, determining the smoothing parameter according to the fluctuation curve includes: determining the type of time series corresponding to the fluctuation curve; when the type of the time series is monthly data, determining the smoothing parameter to be a first preset smoothing parameter; when the type of the time series is quarterly data, determining the smoothing parameter to be a second preset smoothing parameter; when the type of the time series is annual data, determining the smoothing parameter to be a third preset smoothing parameter, wherein the first preset smoothing parameter, the second preset smoothing parameter and the third preset smoothing parameter gradually decrease.

[0009] Furthermore, {Y t} is the time series corresponding to the fluctuation curve, t=1,2,...,T, T is the time length of the time series, {Y t T} is a smooth time series, λ is a smoothing parameter, and the steps of filtering short-term fluctuations in the fluctuation curve according to the smoothing parameter to obtain a smooth time series include: solving the following minimization problem to obtain a smooth time series {Y t T}:

[0010] Further, determining the smoothing parameter according to the fluctuation curve includes: step S11: determining the initial value of the iterative smoothing parameter; step S12: calculating the smooth time series according to the iterative smoothing parameter; step S13: calculating the fluctuation series according to the time series and the smooth time series; step S14: calculating the ratio of the variance of the smooth time series to the variance of the fluctuation series to obtain the current ratio; step S15: judging whether the difference between the current ratio and the previous ratio is less than or equal to a preset threshold, wherein when the difference is less than or equal to the preset threshold, outputting the current ratio as the smoothing parameter, and when the difference is greater than the preset threshold, using the current ratio as the iterative smoothing parameter, and returning to step S12.

[0011] Furthermore, {Y t} is the time series corresponding to the fluctuation curve, t=1,2,...,T, T is the time length of the time series, {Y t T} is a smooth time series, and the step of determining the inflection point on the smooth time series by using the difference technique to obtain the initial inflection point includes: calculating the trend state sequence stage(t) by using the following formula:

[0012]

[0013] Whether the trend states of two adjacent moments are the same is determined according to the trend state sequence; and when the trend states of two adjacent moments are different, the previous moment of the two adjacent moments is determined as the initial turning point.

[0014] Furthermore, the step of performing a peak-valley search within a predetermined time range from the initial inflection point to obtain a target inflection point includes:

[0015] Step S21: Obtain a trend state sequence and set the initial search times to 1;

[0016] Step S22: searching for the minimum peak-to-valley interval according to the trend state sequence;

[0017] Step S23: Determine whether the minimum peak-to-valley interval is less than the first duration threshold, wherein if the minimum peak-to-valley interval is less than the first duration threshold, execute step S24; if the minimum peak-to-valley interval is greater than or equal to the first duration threshold, execute step S25;

[0018] Step S24: modifying the state between the peaks and valleys corresponding to the minimum peak-to-valley interval to an opposite state to update the trend state sequence, and returning to step S22;

[0019] Execute step S25: search for the minimum peak-to-peak interval according to the trend state sequence;

[0020] Execute step S26: determine whether the minimum peak-to-peak interval is less than the second duration threshold, wherein if the minimum peak-to-peak interval is less than the second duration threshold, execute step S27; if the minimum peak-to-peak interval is greater than or equal to the second duration threshold, execute step S28;

[0021] Step S27: Delete the two peaks corresponding to the minimum peak-to-peak interval, take the maximum value between the two peaks as the new peak, and update the trend state sequence according to the latest peak and valley, then return to step S25;

[0022] Execute step S28: search for the minimum valley interval according to the trend state sequence;

[0023] Execute step S29: determine whether the minimum valley interval is less than the second duration threshold, wherein if the minimum valley interval is less than the second duration threshold, execute step S30; if the minimum valley interval is greater than or equal to the second duration threshold, execute step S31;

[0024] Step S30: Delete the two valleys corresponding to the minimum valley interval, take the maximum value between the two valleys as the new valley, and update the trend state sequence according to the latest peak valley, then return to step S28;

[0025] Step S31: In the trend state sequence, all local extreme value points within a preset window range before and after the peak are regarded as new peaks, and all local extreme value points within a preset window range before and after the valley are regarded as new valleys;

[0026] Step S32: Determine whether the current search times reaches the search threshold, wherein if it reaches the search threshold, execute step S33, if it does not reach the search threshold, execute step S34;

[0027] Step S33: taking the latest peak and valley as the target inflection point;

[0028] Step S34: after updating the trend state sequence according to the latest peak and valley, the search times are increased by 1 and the process returns to step S22.

[0029] Furthermore, the fluctuation trend state includes an upward trend and a downward trend, and the step of outputting state information characterizing the fluctuation trend state includes: outputting a fluctuation curve including the state information, wherein the part of the fluctuation curve corresponding to the upward trend is displayed in a first display mode, and the part of the fluctuation curve corresponding to the downward trend is displayed in a second display mode.

[0030] On the other hand, to achieve the above-mentioned purpose, the present invention provides an image-based fluctuation trend recognition device.

[0031] The image-based fluctuation trend identification device is characterized in that it includes: an acquisition module for acquiring a fluctuation curve in an image to be identified, wherein the fluctuation curve represents a time series; a first determination module for determining a smoothing parameter based on the fluctuation curve; a processing module for filtering short-term fluctuations in the fluctuation curve according to the smoothing parameter to obtain a smooth time series; a second determination module for determining an inflection point on the smooth time series by a differential technique to obtain an initial inflection point; a search module for performing a peak-to-valley search within a predetermined time range from the initial inflection point to obtain a target inflection point; a third determination module for determining a fluctuation trend state of the fluctuation curve based on a relationship between adjacent target inflection points; and an output module for outputting state information representing the fluctuation trend state.

[0032] To achieve the above objectives, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0033] To achieve the above object, the present invention also provides a computer-readable storage medium on which a computer program is stored, and the computer program implements the steps of the above method when executed by a processor.

[0034] The image-based fluctuation trend recognition method, device, computer equipment and medium provided by the present invention obtain the fluctuation curve representing the time series in the image to be recognized, determine the smoothing parameter according to the fluctuation curve, and filter the short-term fluctuations in the fluctuation curve according to the smoothing parameter to obtain a smooth time series, and then determine the inflection point on the smooth time series by differential technology to obtain the initial inflection point. On this basis, further judge according to the initial inflection point, perform peak and valley search within a predetermined time range from the initial inflection point to obtain the target inflection point, determine the fluctuation trend state of the fluctuation curve according to the peak and valley relationship between adjacent target inflection points, and finally output the state information representing the fluctuation trend state. Through the present invention, filtering is first performed, and only the local high and low point judgment is performed on the filtered inflection point, which reduces a large number of invalid high and low point identifications, greatly reduces the time occupancy, and improves the calculation efficiency. At the same time, because the initial inflection point is calibrated by peak and valley search after filtering, the target inflection point is obtained, and trend identification is performed according to the target inflection point, which improves the accuracy of inflection point identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0036] Figure 1 A flowchart of a method for identifying fluctuation trends based on an image provided in Embodiment 1 of the present invention;

[0037] Figure 2 A schematic diagram of a time series and a smooth time series provided by an embodiment of the present invention;

[0038] Figure 3 A schematic diagram of a target inflection point provided by an embodiment of the present invention;

[0039] Figure 4 A schematic diagram of a fluctuation curve including state information provided by an embodiment of the present invention;

[0040] Figure 5 A block diagram of a fluctuation trend identification device based on an image provided in Embodiment 2 of the present invention;

[0041] Figure 6 This is a hardware structure diagram of a computer device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0043] In order to solve the technical problem of low computational efficiency of the method relying on point-by-point judgment when performing fluctuation trend recognition based on images in the prior art, the present invention proposes a fluctuation trend recognition method, device, computer equipment and medium based on images. In the process of studying and solving the above technical problems, the inventor found that it is very easy for the human eye to recognize fluctuation trends based on images. By carefully splitting the process of human eye recognition trend, it is further found that: given any fluctuation curve, the human eye first quickly filters short-term fluctuations, and then accurately identifies the inflection point of the curve, so as to give a judgment on the fluctuation trend of each stage. Based on such a discovery, in the image-based fluctuation trend recognition method proposed by the present invention, after obtaining the fluctuation curve representing the time series in the image to be recognized, the smoothing parameter is first determined according to the fluctuation curve, and the short-term fluctuations in the fluctuation curve are filtered according to the smoothing parameter to obtain a smooth time series, and then the inflection point is determined on the smooth time series by the difference technology to obtain the initial inflection point. On this basis, further judgment is made according to the initial inflection point, and a peak-valley search is performed within a predetermined time range from the initial inflection point to obtain the target inflection point, and the fluctuation trend state of the fluctuation curve is determined according to the peak-valley relationship between adjacent target inflection points, and finally the state information representing the fluctuation trend state is output. The image-based fluctuation trend recognition method provided by the present invention takes simulating the human eye's trend recognition as the starting point, first performs filtering processing, and only judges the local high and low points of the inflection points after filtering, thereby reducing a large number of invalid high and low point identifications, greatly reducing the time occupied, and improving the calculation efficiency. At the same time, since the initial inflection point is calibrated through peak and valley search after filtering, the target inflection point is obtained, and trend recognition is performed according to the target inflection point, thereby improving the accuracy of inflection point recognition.

[0044] The specific embodiments of the image-based fluctuation trend identification method, apparatus, computer equipment and medium provided by the present invention will be described in detail below.

[0045] Embodiment 1

[0046] Embodiment 1 of the present invention provides a method for identifying fluctuation trends based on images. By using this method, the calculation efficiency can be improved, and the accuracy of inflection point identification can be improved. Specifically, Figure 1 Flow chart of the method for identifying fluctuation trend based on image provided in the first embodiment of the present invention, such as Figure 1As shown, the image-based fluctuation trend recognition method provided by this embodiment includes the following steps S101 to S107.

[0047] Step S101: obtaining a fluctuation curve in an image to be identified.

[0048] Among them, the fluctuation curve represents the time series, that is, it represents the fluctuation of the variable over time within a period of time. For example, it can be the Shanghai and Shenzhen 300 Index sequence over a period of time, or the sequence of changes in the number of parking lots in the garage over a period of time, or the sequence of changes in the number of virus infections over a period of time, etc.

[0049] Step S102: Determine a smoothing parameter according to the fluctuation curve.

[0050] Step S103: filtering short-term fluctuations in the fluctuation curve according to the smoothing parameter to obtain a smooth time series.

[0051] in, Figure 2 A schematic diagram of a time series and a smooth time series provided by an embodiment of the present invention, such as Figure 2 As shown in the figure, after filtering the fluctuation curve, that is, the time series, and filtering out the short-term fluctuations, the curve corresponding to the smooth time series can be obtained. Figure 2 The curve with more short-term fluctuations is the fluctuation curve, and the relatively smooth curve is the curve corresponding to the smooth time series. The vertical axis in the figure is the Shanghai and Shenzhen 300 Index, and the horizontal axis is time. The time points include 2010.01, 2010.03, 2010.05, 2010.07, 2010.09, 2010.11, 2011.01 and 2011.03.

[0052] In this embodiment, the adaptive smoothing parameter is determined according to the fluctuation curve itself. Optionally, in one embodiment, the correspondence between the type of time series and the preset smoothing parameter is predetermined. When determining the smoothing parameter according to the fluctuation curve, the type of time series corresponding to the fluctuation curve is first determined, and then the corresponding smoothing parameter is further determined according to the determined type and the above correspondence. For example, the type of time series includes monthly data, quarterly data or annual data distributed according to time frequency, or the type of time series includes county-level data, municipal-level data or provincial-level data distributed according to geographical location. Different types of time series have different corresponding smoothing parameters. The larger the smoothing parameter, the more short-term fluctuations are filtered, and the smoother the smoothed time series is obtained. Therefore, the smoothing parameter is determined according to the fluctuation curve itself to avoid using the same smoothing parameter for data of different dimensions and different volatility, so that the smoothing parameter is adapted to the fluctuation curve.

[0053] Further optionally, the specific step of determining the smoothing parameter according to the fluctuation curve includes: determining the type of time series corresponding to the fluctuation curve; when the type of the time series is monthly data, determining the smoothing parameter to be the first preset smoothing parameter; when the type of the time series is quarterly data, determining the smoothing parameter to be the second preset smoothing parameter; when the type of the time series is annual data, determining the smoothing parameter to be the third preset smoothing parameter, wherein the first preset smoothing parameter, the second preset smoothing parameter and the third preset smoothing parameter gradually decrease. For example, the first preset smoothing parameter is 14400, the second preset smoothing parameter is 1600, and the third preset smoothing parameter is 100. In this embodiment, the higher the time frequency, the greater the short-term change of the fluctuation curve, and the larger the corresponding smoothing parameter is set, so that invalid fluctuation changes can be filtered out while retaining the change trend.

[0054] Optionally, in one embodiment, let {Y t} is the time series corresponding to the fluctuation curve, t=1,2,...,T, T is the time length of the time series. t} contains trend components and fluctuation components, where the trend component is also a smooth time series and the fluctuation component is also a fluctuation series. Let {Y t T} is a smooth time series, {Y t C} is a fluctuation sequence, then Y t =Y t T +Y t C , filter the short-term fluctuations in the fluctuation curve to obtain a smooth time series, that is, from {Y t} to separate the trend term {Y t T}. Let λ be the smoothing parameter and solve the following minimization problem to obtain the smooth time series {Y t T}:

[0055]

[0056] In the above minimization problem, the first term in the curly brackets is the least squares method, the second term is the square of the second-order difference of the trend term, and λ≥0 is the smoothing parameter. The larger the λ, the smoother the estimated trend term. For example, if λ=0, the filtering degenerates into the least squares method. At this time, the estimated sequence {Y t T} is {Y t} itself; if λ = ∞, the estimated trend term is close to a linear function because the second-order difference of a linear function is 0.

[0057] In actual operation, trend items with different degrees of smoothness can be obtained by selecting smoothing parameters. However, it is not advisable to use the same smoothing parameters for data of different dimensions and volatility.

[0058] Further optionally, when determining the smoothing parameter according to the fluctuation curve, the following steps are specifically performed:

[0059] Step S11: Determine the initial value of the iterative smoothing parameter.

[0060] Specifically, the initial parameter value of the smoothing parameter may be determined based on experience. In the present invention, the smoothing parameter in the iterative process is defined as an iterative smoothing parameter.

[0061] Step S12: Calculate the smooth time series according to the iterative smoothing parameter.

[0062] Specifically, when this step is performed for the first time after the initial value of the iterative smoothing parameter is determined, the initial value is brought into the minimization problem as λ. The corresponding {Y t T}.

[0063] Step S13: Calculate the fluctuation series based on the time series and the smooth time series.

[0064] The time series {Y t} and the smooth time series {Y t T Substitute into Y t =Y t T +Y t C , we can get the fluctuation sequence.

[0065] Step S14: Calculate the ratio of the variance of the smooth time series to the variance of the fluctuation series to obtain the current ratio.

[0066] The calculated variance of the smooth time series is The variance of the volatility series is Calculate the ratio of the two, which is the current ratio.

[0067] Step S15: Determine whether the difference between the current ratio and the previous ratio is less than or equal to a preset threshold.

[0068] When the difference is less than or equal to a preset threshold, the current ratio is output as a smoothing parameter; when the difference is greater than the preset threshold, the current ratio is used as an iterative smoothing parameter and the process returns to step S12.

[0069] Specifically, at the nth iteration, the ratio calculated at the nth time is subtracted from the ratio calculated at the nth time and the ratio calculated at the n-1th time to determine the magnitude relationship between the difference and the preset threshold, where the preset threshold can be set based on experience, for example, set to 10 -6 When the difference is greater than the preset threshold, the ratio obtained in the nth iteration is used as the iterative smoothing parameter, and the process returns to step S12 to continue the iteration; when the difference is less than or equal to the preset threshold, the ratio obtained in the nth iteration is used as the smoothing parameter, the iteration is exited, and the smoothing parameter is substituted into The corresponding {Y t T}, which is the calculated smooth time series. When n=1, the ratio obtained for the n-1th time is set to 0.

[0070] In this embodiment, the balance parameter is selected To balance the least squares and smoothness penalty. Specifically, the smoothing parameter is determined by iterative operation. If the ratio obtained in the current iteration is Ratio to the last time When the difference is very small, that is, when the preset threshold requirement is met, the iteration is stopped.

[0071] Therefore, by adopting the image-based fluctuation trend recognition method provided by this embodiment, in the filtering step, the smoothing parameters can be adaptively selected according to the characteristics of the time series itself, which is conducive to computer batch processing of a large number of different time series and further improves the accuracy of fluctuation trend recognition.

[0072] Step S104: Determine the inflection point on the smooth time series by using a difference technique to obtain an initial inflection point.

[0073] After the smooth time series is determined, in this step, an inflection point is determined based on a classification technique, which is defined as an initial inflection point in the present invention.

[0074] Optionally, in one embodiment, let {Y t} is the time series corresponding to the fluctuation curve, t=1,2,...,T, T is the time length of the time series, {Y t T} is a smooth time series, and the steps of determining the inflection point on the smooth time series by using the difference technique to obtain the initial inflection point include:

[0075] The trend state sequence stage(t) is calculated using the following formula:

[0076]

[0077] After obtaining the trend state sequence stage(t), determine whether the trend states of two adjacent moments are the same according to the trend state sequence. Specifically, when the two adjacent moments are both 1, the trend states are both rising trends, and when they are both -1, the trend states are both falling trends. In this case, the trend states of the two adjacent moments are the same. If one of the two adjacent moments is 1 and the other is -1, it indicates that the trend states of the two adjacent moments are different. When the trend states of the two adjacent moments are different, the previous moment of the two adjacent moments is determined as the initial inflection point.

[0078] Step S105: Perform a peak-valley search within a predetermined time range from the initial inflection point to obtain a target inflection point.

[0079] Through this step, the peak-valley search is used to achieve accurate identification of the inflection point. Figure 3 A schematic diagram of a target inflection point provided by an embodiment of the present invention, such as Figure 3 As shown, the target inflection point is further screened out from multiple initial inflection points.

[0080] Optionally, in one embodiment, step S105 specifically includes the following steps:

[0081] Step S21: Obtain the trend state sequence and set the initial search times to 1.

[0082] The trend state sequence in this step is the trend state sequence obtained in the above step S104.

[0083] Step S22: Searching for the minimum peak-to-valley interval according to the trend state sequence.

[0084] Step S23: Determine whether the minimum peak-to-valley interval is less than a first duration threshold single_thresh.

[0085] If the minimum peak-to-valley interval is less than the first duration threshold, step S24 is executed; if the minimum peak-to-valley interval is greater than or equal to the first duration threshold, step S25 is executed.

[0086] Step S24: modify the state between the peaks and valleys corresponding to the minimum peak-to-valley interval to an opposite state to update the trend state sequence, and return to step S22.

[0087] Execute step S25: search for the minimum peak-to-peak interval according to the trend state sequence.

[0088] Execute step S26: determine whether the minimum peak-to-peak interval is less than a second duration threshold.

[0089] If the minimum peak-to-peak interval is less than the second duration threshold, step S27 is executed; if the minimum peak-to-peak interval is greater than or equal to the second duration threshold, step S28 is executed.

[0090] Step S27: Delete the two peaks corresponding to the minimum peak-to-peak interval, take the maximum value between the two peaks as the new peak, and update the trend state sequence according to the latest peak and valley, then return to step S25.

[0091] Execute step S28: search for the minimum valley interval according to the trend state sequence.

[0092] Execute step S29: determine whether the minimum valley interval is less than the second duration threshold double_thresh.

[0093] If the minimum valley interval is less than the second duration threshold, step S30 is executed; if the minimum valley interval is greater than or equal to the second duration threshold, step S31 is executed.

[0094] Step S30: Delete the two valleys corresponding to the minimum valley interval, take the maximum value between the two valleys as the new valley, and update the trend state sequence according to the latest peak valley, then return to step S28.

[0095] Step S31: In the trend state sequence, all local extreme value points within a preset window range before and after the peak are regarded as new peaks, and all local extreme value points within a preset window range band before and after the valley are regarded as new valleys.

[0096] Step S32: Determine whether the current search times reaches the search threshold.

[0097] If the search threshold is reached, step S33 is executed; if the search threshold is not reached, step S34 is executed.

[0098] Step S33: taking the latest peak and valley as the target inflection point.

[0099] Step S34: after updating the trend state sequence according to the latest peak and valley, the search times are increased by 1 and the process returns to step S22.

[0100] For example, if the time series is daily data, select single_thresh=6, double_thresh=12, band=5; if the time series is monthly data, select single_thresh=20, double_thresh=40, band=10.

[0101] Among them, in the above steps S21 to S34, there are multiple updates to the trend state sequence and searches based on the trend state sequence. It should be noted that the trend state sequence based on which each update is based is updating the current latest trend state sequence, and the trend state sequence based on which each search is based is also searching for the current latest trend state sequence.

[0102] Step S106: determining the fluctuation trend state of the fluctuation curve according to the peak-to-valley relationship between adjacent target inflection points.

[0103] Specifically, between adjacent target inflection points, if the previous target inflection point is a peak and the next target inflection point is a trough, then the fluctuation trend state of the fluctuation curve corresponding to the two target inflection points is a downward trend; if the previous target inflection point is a trough and the next target inflection point is a peak, then the fluctuation trend state of the fluctuation curve corresponding to the two target inflection points is an upward trend.

[0104] Step S107: Output status information representing the fluctuation trend status.

[0105] Through this step, the state information representing the fluctuation trend state is output, for example, it can be output by the illustrated method. Optionally, in one embodiment, the fluctuation trend state includes an upward trend and a downward trend, and the step of outputting the state information representing the fluctuation trend state includes: outputting a fluctuation curve including the state information, wherein the fluctuation curve portion corresponding to the upward trend is displayed in a first display mode, and the fluctuation curve portion corresponding to the downward trend is displayed in a second display mode. Figure 4 A schematic diagram of a fluctuation curve including state information provided by an embodiment of the present invention, such as Figure 4 As shown, an overlay is added to the portion of the fluctuation curve corresponding to the downward trend.

[0106] In the image-based fluctuation trend recognition method provided by this embodiment, after obtaining the fluctuation curve representing the time series in the image to be recognized, a smoothing parameter is determined according to the fluctuation curve, and the short-term fluctuations in the fluctuation curve are filtered according to the smoothing parameter to obtain a smooth time series, and then the inflection point is determined on the smooth time series by the difference technology to obtain the initial inflection point. On this basis, further judgment is made according to the initial inflection point, and a peak-valley search is performed within a predetermined time range from the initial inflection point to obtain the target inflection point, and the fluctuation trend state of the fluctuation curve is determined according to the peak-valley relationship between adjacent target inflection points, and finally the state information representing the fluctuation trend state is output. The image-based fluctuation trend recognition method provided by this embodiment is adopted, starting from simulating the human eye to recognize the trend, filtering is performed first, and only the inflection points after filtering are judged for local high and low points, which reduces a large number of invalid high and low point recognitions, greatly reduces the time occupied, and improves the calculation efficiency. At the same time, since the initial inflection point is calibrated by the peak-valley search after filtering, the target inflection point is obtained, and the trend recognition is performed according to the target inflection point, the accuracy of inflection point recognition is improved.

[0107] Compared with the point-by-point identification in the prior art, this embodiment reduces the calculation time for trend identification of a single time series with a length of 200 to 1 / 20 of the prior art, thereby improving computing efficiency, reducing computing resource usage, and enabling accurate identification of inflection points.

[0108] Embodiment 2

[0109] Corresponding to the above-mentioned embodiment 1, embodiment 2 of the present invention provides an image-based fluctuation trend recognition device. The corresponding technical feature details and corresponding technical effects can be referred to the above-mentioned embodiment 1 and will not be repeated in this embodiment. Figure 5 A block diagram of a fluctuation trend recognition device based on an image provided in Embodiment 2 of the present invention, such as Figure 5 As shown, the device includes: an acquisition module 201, a first determination module 202, a processing module 203, a second determination module 204, a search module 205, a third determination module 206 and an output module 207.

[0110] The acquisition module 201 is used to acquire the fluctuation curve in the image to be identified, wherein the fluctuation curve represents a time series; the first determination module 202 is used to determine the smoothing parameter based on the fluctuation curve; the processing module 203 is used to filter the short-term fluctuations in the fluctuation curve according to the smoothing parameter to obtain a smooth time series; the second determination module 204 is used to determine the inflection point on the smooth time series by differential technology to obtain the initial inflection point; the search module 205 is used to perform peak and valley search within a predetermined time range from the initial inflection point to obtain the target inflection point; the third determination module 206 is used to determine the fluctuation trend state of the fluctuation curve based on the relationship between adjacent target inflection points; and the output module 207 is used to output state information representing the fluctuation trend state.

[0111] Optionally, in one embodiment, the steps specifically performed by the first determination module 202 include: determining the type of the time series corresponding to the fluctuation curve; when the type of the time series is monthly data, determining the smoothing parameter to be a first preset smoothing parameter; when the type of the time series is quarterly data, determining the smoothing parameter to be a second preset smoothing parameter; when the type of the time series is annual data, determining the smoothing parameter to be a third preset smoothing parameter, wherein the first preset smoothing parameter, the second preset smoothing parameter and the third preset smoothing parameter gradually decrease.

[0112] Optionally, in one embodiment, {Y t} is the time series corresponding to the fluctuation curve, t=1,2,...,T, T is the time length of the time series, {Y t T} is the smooth time series, λ is the smoothing parameter, and the processing module 203 specifically performs the following steps: solving the following minimization problem to obtain the smooth time series {Y t T}:

[0113] Optionally, in an embodiment, the steps specifically performed by the first determining module 202 include:

[0114] Step S11: determining the initial value of the iterative smoothing parameter;

[0115] Step S12: Calculating the smooth time series according to the iterative smoothing parameter;

[0116] Step S13: calculating a fluctuation sequence according to the time series and the smooth time series;

[0117] Step S14: Calculate the ratio of the variance of the smooth time series to the variance of the fluctuation series to obtain a current ratio;

[0118] Step S15: Determine whether the difference between the current ratio and the previous ratio is less than or equal to a preset threshold, wherein when the difference is less than or equal to the preset threshold, output the current ratio as the smoothing parameter, and when the difference is greater than the preset threshold, use the current ratio as the iterative smoothing parameter and return to step S12.

[0119] Optionally, in one embodiment, {Y t} is the time series corresponding to the fluctuation curve, t=1,2,...,T, T is the time length of the time series, {Y t T} is the smooth time series, and the second determination module 204 specifically performs the following steps:

[0120] The trend state sequence stage(t) is calculated using the following formula:

[0121]

[0122] Determining whether the trend states at two adjacent moments are the same according to the trend state sequence; and

[0123] When the trend states of the two adjacent moments are different, the previous moment of the two adjacent moments is determined as the initial inflection point.

[0124] Optionally, in one embodiment, the steps specifically performed by the search module 205 include:

[0125] Step S21: Obtain the trend state sequence and set the initial search times to 1.

[0126] Step S22: Searching for the minimum peak-to-valley interval according to the trend state sequence.

[0127] Step S23: Determine whether the minimum peak-to-valley interval is less than a first duration threshold single_thresh.

[0128] If the minimum peak-to-valley interval is less than the first duration threshold, step S24 is executed; if the minimum peak-to-valley interval is greater than or equal to the first duration threshold, step S25 is executed.

[0129] Step S24: modify the state between the peaks and valleys corresponding to the minimum peak-to-valley interval to an opposite state to update the trend state sequence, and return to step S22.

[0130] Execute step S25: search for the minimum peak-to-peak interval according to the trend state sequence.

[0131] Execute step S26: determine whether the minimum peak-to-peak interval is less than a second duration threshold.

[0132] If the minimum peak-to-peak interval is less than the second duration threshold, step S27 is executed; if the minimum peak-to-peak interval is greater than or equal to the second duration threshold, step S28 is executed.

[0133] Step S27: Delete the two peaks corresponding to the minimum peak-to-peak interval, take the maximum value between the two peaks as the new peak, and update the trend state sequence according to the latest peak and valley, then return to step S25.

[0134] Execute step S28: search for the minimum valley interval according to the trend state sequence.

[0135] Execute step S29: determine whether the minimum valley interval is less than the second duration threshold double_thresh.

[0136] If the minimum valley interval is less than the second duration threshold, step S30 is executed; if the minimum valley interval is greater than or equal to the second duration threshold, step S31 is executed.

[0137] Step S30: Delete the two valleys corresponding to the minimum valley interval, take the maximum value between the two valleys as the new valley, and update the trend state sequence according to the latest peak valley, then return to step S28.

[0138] Step S31: In the trend state sequence, all local extreme value points within a preset window range before and after the peak are regarded as new peaks, and all local extreme value points within a preset window range band before and after the valley are regarded as new valleys.

[0139] Step S32: Determine whether the current search times reaches the search threshold.

[0140] If the search threshold is reached, step S33 is executed; if the search threshold is not reached, step S34 is executed.

[0141] Step S33: taking the latest peak and valley as the target inflection point.

[0142] Step S34: after updating the trend state sequence according to the latest peak and valley, the search times are increased by 1 and the process returns to step S22.

[0143] Optionally, in one embodiment, the fluctuation trend state includes an upward trend and a downward trend, and the steps specifically performed by the output module 207 include: outputting the fluctuation curve including the state information, wherein the part of the fluctuation curve corresponding to the upward trend is displayed in a first display mode, and the part of the fluctuation curve corresponding to the downward trend is displayed in a second display mode.

[0144] Embodiment 3

[0145] This third embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. Figure 6 As shown, the computer device 01 of this embodiment includes at least but is not limited to: a memory 011 and a processor 012 which can be interconnected via a system bus. Figure 6 It should be pointed out that Figure 6 Only a computer device 01 having components memory 011 and processor 012 is shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0146] In this embodiment, the memory 011 (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 011 can be an internal storage unit of the computer device 01, such as a hard disk or memory of the computer device 01. In other embodiments, the memory 011 can also be an external storage device of the computer device 01, such as a plug-in hard disk equipped on the computer device 01, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 011 can also include both the internal storage unit of the computer device 01 and its external storage device. In this embodiment, the memory 011 is generally used to store the operating system and various application software installed on the computer device 01, such as the program code of the image-based fluctuation trend recognition device of the second embodiment. In addition, the memory 011 can also be used to temporarily store various types of data that have been output or are to be output.

[0147] In some embodiments, the processor 012 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 012 is generally used to control the overall operation of the computer device 01. In this embodiment, the processor 012 is used to run the program code stored in the memory 011 or process data, such as an image-based fluctuation trend recognition method.

[0148] Embodiment 4

[0149] The fourth embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and the program realizes corresponding functions when executed by a processor. The computer-readable storage medium of the present embodiment is used to store an image-based fluctuation trend recognition device, and when executed by a processor, the image-based fluctuation trend recognition method of the first embodiment is realized.

[0150] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0151] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0152] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0153] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for identifying fluctuation trends based on images, characterized in that: include: Obtain a fluctuation curve in the image to be identified, wherein the fluctuation curve represents a time series, {Y t } is the time series corresponding to the fluctuation curve, t=1, 2, ..., T, T is the time length of the time series; Determining a smoothing parameter according to the fluctuation curve; According to the smoothing parameter, the short-term fluctuations in the fluctuation curve are filtered to obtain a smooth time series, {Y t T } is the smooth time series; Determine the inflection point on the smooth time series by using a difference technique to obtain an initial inflection point; Performing a peak-valley search within a predetermined time range from the initial inflection point to obtain a target inflection point; Determining the fluctuation trend state of the fluctuation curve according to the peak-to-valley relationship between adjacent target inflection points; and outputting state information representing the state of the fluctuation trend, Among them, the trend state sequence stage(t) is calculated using the following formula: The step of performing a peak-valley search within a predetermined time range from the initial inflection point to obtain a target inflection point comprises: Step S21: Obtain the trend state sequence and set the initial search times to 1; Step S22: searching for the minimum peak-to-valley interval according to the trend state sequence; Step S23: Determine whether the minimum peak-to-valley interval is less than a first duration threshold, wherein if the minimum peak-to-valley interval is less than the first duration threshold, execute step S24; if the minimum peak-to-valley interval is greater than or equal to the first duration threshold, execute step S25; Step S24: modifying the state between the peaks and valleys corresponding to the minimum peak-to-valley interval to an opposite state to update the trend state sequence, and returning to step S22; Step S25: searching for a minimum peak-to-peak interval according to the trend state sequence; Step S26: determining whether the minimum peak-to-peak interval is less than a second duration threshold, wherein if the minimum peak-to-peak interval is less than the second duration threshold, executing step S27; if the minimum peak-to-peak interval is greater than or equal to the second duration threshold, executing step S28; Step S27: deleting the two peaks corresponding to the minimum peak-to-peak interval, taking the maximum value between the two peaks as a new peak, and updating the trend state sequence according to the latest peak and valley, and then returning to step S25; Step S28: searching for the minimum valley interval according to the trend state sequence; Step S29: determining whether the minimum valley interval is less than the second duration threshold, wherein if the minimum valley interval is less than the second duration threshold, executing step S30; if the minimum valley interval is greater than or equal to the second duration threshold, executing step S31; Step S30: deleting the two valleys corresponding to the minimum valley interval, taking the maximum value between the two valleys as a new valley, and updating the trend state sequence according to the latest peak valley, and then returning to step S28; Step S31: in the trend state sequence, taking all local extreme value points within a preset window range before and after the peak as new peaks, and taking all local extreme value points within the preset window range before and after the valley as new valleys; Step S32: Determine whether the current search times reaches a search threshold, wherein if it reaches the search threshold, execute step S33, and if it does not reach the search threshold, execute step S34; Step S33: taking the latest peak and valley as the target inflection point; Step S34: after updating the trend state sequence according to the latest peak and valley, the search times are increased by 1 and the process returns to step S22.

2. The method for identifying fluctuation trends based on images according to claim 1, characterized in that: Determining the smoothing parameter according to the fluctuation curve includes: Determining the type of time series corresponding to the fluctuation curve; When the type of the time series is monthly data, determining the smoothing parameter to be a first preset smoothing parameter; When the type of the time series is quarterly data, determining the smoothing parameter to be a second preset smoothing parameter; When the type of the time series is annual data, the smoothing parameter is determined to be a third preset smoothing parameter, The first preset smoothing parameter, the second preset smoothing parameter and the third preset smoothing parameter gradually decrease.

3. The method for identifying fluctuation trends based on images according to claim 1, characterized in that: λ is the smoothing parameter, and the step of filtering the short-term fluctuations in the fluctuation curve according to the smoothing parameter to obtain a smooth time series includes: Solve the following minimization problem to obtain the smooth time series {Y t T }:

4. The method for identifying fluctuation trends based on images according to claim 3, characterized in that: Determining the smoothing parameter according to the fluctuation curve includes: Step S11: determining the initial value of the iterative smoothing parameter; Step S12: Calculating the smooth time series according to the iterative smoothing parameter; Step S13: calculating a fluctuation sequence according to the time series and the smooth time series; Step S14: Calculate the ratio of the variance of the smooth time series to the variance of the fluctuation series to obtain a current ratio; Step S15: Determine whether the difference between the current ratio and the previous ratio is less than or equal to a preset threshold, wherein when the difference is less than or equal to the preset threshold, output the current ratio as the smoothing parameter, and when the difference is greater than the preset threshold, use the current ratio as the iterative smoothing parameter and return to step S12.

5. The method for identifying fluctuation trends based on images according to claim 1, characterized in that: The step of determining the inflection point on the smooth time series by using a difference technique to obtain an initial inflection point comprises: Determining whether the trend states at two adjacent moments are the same according to the trend state sequence; and When the trend states of the two adjacent moments are different, the previous moment of the two adjacent moments is determined as the initial inflection point.

6. The method for identifying fluctuation trends based on images according to claim 1, characterized in that: The fluctuation trend state includes an upward trend and a downward trend, and the step of outputting state information representing the fluctuation trend state includes: The fluctuation curve including the state information is output, wherein the fluctuation curve portion corresponding to the upward trend is displayed in a first display mode, and the fluctuation curve portion corresponding to the downward trend is displayed in a second display mode.

7. An image-based fluctuation trend recognition device, characterized in that: include: An acquisition module is used to acquire a fluctuation curve in the image to be identified, wherein the fluctuation curve represents a time series, {Y t } is the time series corresponding to the fluctuation curve, t=1, 2, ..., T, T is the time length of the time series; A first determination module, used to determine a smoothing parameter according to the fluctuation curve; A processing module is used to filter the short-term fluctuations in the fluctuation curve according to the smoothing parameter to obtain a smooth time series, {Y t T } is the smooth time series; A second determination module is used to determine the inflection point on the smooth time series by using a difference technique to obtain an initial inflection point; A search module, used for performing a peak-valley search within a predetermined time range from the initial inflection point to obtain a target inflection point; A third determining module is used to determine the fluctuation trend state of the fluctuation curve according to the relationship between adjacent target inflection points; and An output module, used to output status information representing the fluctuation trend status, The second determination module calculates the trend state sequence stage(t) using the following formula: The steps performed by the search module include: Step S21: Obtain the trend state sequence and set the initial search times to 1; Step S22: searching for the minimum peak-to-valley interval according to the trend state sequence; Step S23: Determine whether the minimum peak-to-valley interval is less than a first duration threshold, wherein if the minimum peak-to-valley interval is less than the first duration threshold, execute step S24; if the minimum peak-to-valley interval is greater than or equal to the first duration threshold, execute step S25; Step S24: modifying the state between the peaks and valleys corresponding to the minimum peak-to-valley interval to an opposite state to update the trend state sequence, and returning to step S22; Step S25: searching for a minimum peak-to-peak interval according to the trend state sequence; Step S26: determining whether the minimum peak-to-peak interval is less than a second duration threshold, wherein if the minimum peak-to-peak interval is less than the second duration threshold, executing step S27; if the minimum peak-to-peak interval is greater than or equal to the second duration threshold, executing step S28; Step S27: deleting the two peaks corresponding to the minimum peak-to-peak interval, taking the maximum value between the two peaks as a new peak, and updating the trend state sequence according to the latest peak and valley, and then returning to step S25; Step S28: searching for the minimum valley interval according to the trend state sequence; Step S29: determining whether the minimum valley interval is less than the second duration threshold, wherein if the minimum valley interval is less than the second duration threshold, executing step S30; if the minimum valley interval is greater than or equal to the second duration threshold, executing step S31; Step S30: deleting the two valleys corresponding to the minimum valley interval, taking the maximum value between the two valleys as a new valley, and updating the trend state sequence according to the latest peak valley, and then returning to step S28; Step S31: in the trend state sequence, taking all local extreme value points within a preset window range before and after the peak as new peaks, and taking all local extreme value points within the preset window range before and after the valley as new valleys; Step S32: Determine whether the current search times reaches a search threshold, wherein if it reaches the search threshold, execute step S33, and if it does not reach the search threshold, execute step S34; Step S33: taking the latest peak and valley as the target inflection point; Step S34: after updating the trend state sequence according to the latest peak and valley, the search times are increased by 1 and the process returns to step S22.

8. A computer 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, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.