Stock data query method and device, electronic equipment and readable storage medium
By processing trend and timing characteristics of stock data and aligning timing, the problem of inaccurate stock fragment query caused by timing distortion is solved, and more accurate and comprehensive stock data query results are achieved.
Patent Information
- Application Number
- CN202411783298.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-05-06
AI Technical Summary
In the prior art, when queries about stock fragments similarity, due to the misalignment of trading time and market reaction speed, the timing is distorted, and the stock fragments with distorted timing but similar shapes are misjudged, resulting in inaccurate query results.
By obtaining the stock trend segments to be matched and the candidate stock trend segments, the trend pattern characteristics are processed separately, and the feature sequence is obtained, and then the similarity is determined to identify the target stock trend segments with similar properties.
Through timing alignment and similarity calculation, the risk of incomplete query caused by timing distortion is reduced, and the accuracy and comprehensiveness of stock data query is improved.
Smart Images

Figure CN119938730A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis technology, and in particular to a method, device, electronic device and readable storage medium for querying stock data. Background Art
[0002] With the development of data analysis technology, stock data query methods have been widely used.
[0003] In the related art, when users use software to query the similarity of stock segments, due to factors such as trading time and market reaction speed, the time points of the stock segments are not completely aligned, and the stock trend has a time sequence distortion problem. In this case, if the similarity of two stock segments is directly compared and calculated, the stock segments with time sequence distortion but similar actual shapes may be misjudged during the query process, resulting in incomplete stock trend segments obtained by the query and inaccurate stock data query results. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present invention provides a method, device, electronic device and readable storage medium for querying stock data.
[0005] In a first aspect, the present invention provides a method for querying stock data, the method comprising:
[0006] Obtain a stock trend segment to be matched and multiple candidate stock trend segments;
[0007] Performing trend morphological feature processing on the to-be-matched stock trend segment and each of the candidate stock trend segments respectively, to obtain a to-be-matched feature sequence corresponding to the to-be-matched stock trend segment and a candidate feature sequence corresponding to each of the candidate stock trend segments;
[0008] For any of the candidate feature sequences, the feature sequence to be matched and the candidate feature sequence are time-series aligned to obtain a target feature sequence in the candidate feature sequence that matches the feature sequence to be matched; the target feature sequence includes all or part of the candidate feature sequences;
[0009] Based on the similarity between each of the target feature sequences and the feature sequence to be matched, a target stock trend segment having similarity with the stock trend segment to be matched is determined among the multiple candidate stock trend segments.
[0010] Optionally, the step of performing trend morphological feature processing on the to-be-matched stock trend segment and each of the candidate stock trend segments to obtain a to-be-matched feature sequence corresponding to the to-be-matched stock trend segment and a candidate feature sequence corresponding to each of the candidate stock trend segments includes:
[0011] For the stock trend segment to be processed, normalization processing and differential processing are performed on the stock trend segment to be processed to obtain a feature sequence to be processed; the stock trend segment to be processed is any stock trend segment among the stock trend segment to be matched and the candidate stock trend segments;
[0012] For any target time point in the feature sequence to be processed, determining feature information corresponding to the target time point based on subsequence shape information of multiple time points within a target time window length including the target time point;
[0013] Based on the feature information corresponding to each target time point in the feature sequence to be processed, the feature sequence corresponding to the stock trend segment to be processed is determined; the feature sequence corresponding to the stock trend segment to be processed is the feature sequence to be matched or the candidate feature sequence.
[0014] Optionally, the method further comprises:
[0015] In the case of receiving a query instruction from a user, determining the target stock data and target query conditions indicated by the query instruction; the target query conditions include a query time range;
[0016] Based on the target stock data, generate a stock trend chart;
[0017] Based on the query time range, a stock trend segment to be matched is determined in the stock trend chart.
[0018] Optionally, the target query condition further includes the number of stock queries; and determining, based on the similarity between each of the target feature sequences and the feature sequence to be matched, a target stock trend segment having similarity with the stock trend segment to be matched among the multiple candidate stock trend segments, comprises:
[0019] Obtaining the similarity between each of the target feature sequences and the feature sequence to be matched;
[0020] Sorting each of the target feature sequences in descending order according to the similarity;
[0021] The stock trend segment corresponding to the target feature sequence that is ranked higher and matches the stock query quantity is determined as the target stock trend segment.
[0022] Optionally, the obtaining the similarity between each of the target feature sequences and the feature sequence to be matched includes:
[0023] For any of the target feature sequences, obtaining a first mean, a first variance, and a first standard deviation of the data corresponding to the target feature sequence, and obtaining a second mean, a second variance, and a second standard deviation of the data corresponding to the feature sequence to be matched;
[0024] Based on the first mean, the first variance, the first standard deviation, the second mean, the second variance, and the second standard deviation, a Pearson correlation coefficient between the target feature sequence and the feature sequence to be matched is determined as the similarity.
[0025] Optionally, the method further comprises:
[0026] Performing statistical analysis on the target stock trend segment to obtain statistical analysis results; the statistical analysis includes at least one of stock pattern occurrence frequency analysis, stock pattern future trend analysis, and stock pattern stock selection analysis.
[0027] In a second aspect, the present invention provides a stock data query device, the device comprising:
[0028] A first acquisition module is used to acquire a to-be-matched stock trend segment and a plurality of candidate stock trend segments;
[0029] A first processing module is used to perform trend morphological feature processing on the to-be-matched stock trend segment and each of the candidate stock trend segments, respectively, to obtain a to-be-matched feature sequence corresponding to the to-be-matched stock trend segment and a candidate feature sequence corresponding to each of the candidate stock trend segments;
[0030] A first alignment module is used to perform time alignment on the feature sequence to be matched and the candidate feature sequence for any of the candidate feature sequences, so as to obtain a target feature sequence in the candidate feature sequence that matches the feature sequence to be matched; the target feature sequence includes all or part of the candidate feature sequences;
[0031] The first determination module is used to determine a target stock trend segment having similarity with the stock trend segment to be matched among the multiple candidate stock trend segments based on the similarity between each of the target feature sequences and the feature sequence to be matched.
[0032] Optionally, the first processing module includes:
[0033] A first processing submodule is used for performing normalization processing and differential processing on the stock trend segment to be processed to obtain a feature sequence to be processed; the stock trend segment to be processed is any stock trend segment among the stock trend segment to be matched and the candidate stock trend segments;
[0034] A first determination submodule is used to determine, for any target time point in the feature sequence to be processed, feature information corresponding to the target time point based on subsequence shape information of multiple time points within a target time window length including the target time point;
[0035] The second determination submodule is used to determine the feature sequence corresponding to the stock trend segment to be processed based on the feature information corresponding to each target time point in the feature sequence to be processed; the feature sequence corresponding to the stock trend segment to be processed is the feature sequence to be matched or the candidate feature sequence.
[0036] Optionally, the device further comprises:
[0037] A second determination module is used to determine the target stock data and target query conditions indicated by the query instruction when receiving the query instruction from the user; the target query conditions include the query time range;
[0038] A first generating module, used for generating a stock trend chart based on the target stock data;
[0039] A third determination module is used to determine a stock trend segment to be matched in the stock trend chart based on the query time range.
[0040] Optionally, the target query condition further includes a stock query quantity; and the first determination module includes:
[0041] A second acquisition module is used to obtain the similarity between each of the target feature sequences and the feature sequence to be matched;
[0042] A first sorting module, used to sort the target feature sequences in descending order according to the similarity;
[0043] The fourth determination module is used to determine the stock trend segment corresponding to the target feature sequence that is ranked higher and matches the stock query quantity as the target stock trend segment.
[0044] Optionally, the second acquisition module includes:
[0045] A first acquisition submodule is used to acquire, for any of the target feature sequences, a first mean, a first variance, and a first standard deviation of the data corresponding to the target feature sequence, and to acquire a second mean, a second variance, and a second standard deviation of the data corresponding to the feature sequence to be matched;
[0046] The third determination submodule is used to determine the Pearson correlation coefficient between the target feature sequence and the feature sequence to be matched based on the first mean, the first variance, the first standard deviation, the second mean, the second variance and the second standard deviation as the similarity.
[0047] Optionally, the device further comprises:
[0048] The first analysis module is used to perform statistical analysis on the target stock trend segment to obtain statistical analysis results; the statistical analysis includes at least one of stock pattern occurrence frequency analysis, stock pattern future trend analysis and stock pattern stock selection analysis.
[0049] In a third aspect, the present invention provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for querying stock data described in any one of the first aspects above is implemented.
[0050] In a fourth aspect, the present invention provides a readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the steps in the stock data query method in any one of the embodiments of the first aspect above.
[0051] In an embodiment of the present invention, a stock trend segment to be matched and a plurality of candidate stock trend segments are obtained; the stock trend segment to be matched and each candidate stock trend segment are processed with trend morphological features respectively to obtain a feature sequence to be matched corresponding to the stock trend segment to be matched and a candidate feature sequence corresponding to each candidate stock trend segment; for any candidate feature sequence, the feature sequence to be matched and the candidate feature sequence are aligned in time series to obtain a target feature sequence in the candidate feature sequence that matches the feature sequence to be matched; the target feature sequence includes all candidate feature sequences or part of the candidate feature sequences; based on the similarity between each target feature sequence and the feature sequence to be matched, a target stock trend segment in the plurality of candidate stock trend segments that has similarity with the stock trend segment to be matched is determined. In this way, by processing the trend morphological features of the stock trend segment to be matched and each candidate stock trend segment respectively to obtain the feature sequence to be matched and the candidate feature sequence, the trend change amplitude and change state of the stock trend segment to be matched and each candidate stock trend segment can be more clearly reflected, and then by performing time series alignment on the feature sequence to be matched and the candidate feature sequence, while improving the accuracy of time series alignment, the feature sequence to be matched and the candidate feature sequence after processing are more suitable for matching the similarity of time series trend morphology. Moreover, by performing time alignment on the feature sequences to be matched and the candidate feature sequences, the probability of incomplete search of similar stock trend segments due to time distortion is reduced, thereby improving the accuracy and comprehensiveness of stock data query results. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 It is a schematic diagram of a method for stock query in the prior art;
[0054] Figure 2 is a flowchart of a method for querying stock data provided by an embodiment of the present invention;
[0055] Figure 3 This is a flowchart of the specific steps of a stock data query method provided by an embodiment of the present invention;
[0056] Figure 4 This is a data interaction diagram of a stock data query system provided by an embodiment of the present invention;
[0057] Figure 5 It is a schematic diagram of the architecture of a stock data query method provided by an embodiment of the present invention;
[0058] Figure 6 is a structural diagram of a stock data query device provided by an embodiment of the present invention;
[0059] Figure 7 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] For example, Figure 1 As shown, a certain stock software has a K-line pattern stock selection function, wherein the K-line pattern stock selection can follow up the target stocks and specific time window intervals selected by the user, realize the search for stocks with similar K-line patterns within the search range selected by the user, and display the corresponding time window intervals and similarities of similar stocks.
[0062] The similar sequence morphological fragments obtained through the above stock selection all have the same time window interval length and their relative time point distribution are exactly the same. For example, the time coordinate points between similar sequences c1 and c2 are one-to-one corresponding: c1_t0 corresponds to c2_t0, c1_t1 corresponds to c2_t1...c1_tN corresponds to c2_tN. However, in actual scenarios, the time window lengths and relative time point distributions of similar time series morphologies in different periods are difficult to be exactly the same. There is often a problem of time series distortion. The complex real environment causes distortion in the time series, that is, different fragments will show different degrees of time axis scaling, resulting in the time coordinate points between similar sequences no longer corresponding one-to-one. In this way, if the stock fragments are directly compared for similarity, the stock fragments that actually have morphological similarity but have time series distortion will not be queried, and the stock data query results are incomplete and inaccurate.
[0063] Figure 2 is a flowchart of a method for querying stock data provided by an embodiment of the present invention. Figure 2 As shown, the method may include:
[0064] Step 101: Obtain a stock trend segment to be matched and multiple candidate stock trend segments.
[0065] In an embodiment of the present invention, a stock trend segment to be matched and a plurality of candidate stock trend segments are obtained. The stock trend segment to be matched is. The candidate stock pool can be a collection of a plurality of candidate stocks screened by a user according to certain standards and conditions, or the candidate stock identifiers input by the user can be used to determine the candidate stocks corresponding to the candidate stock identifiers to construct a candidate stock pool. The candidate stock pool can include a plurality of candidate stocks, and the candidate stock trend segment can be determined based on the candidate stocks included in the candidate stock pool.
[0066] Optionally, step 101 may include the following steps:
[0067] Step 201: upon receiving a query instruction from a user, determine the target stock data and target query conditions indicated by the query instruction; the target query conditions include a query time range.
[0068] In an embodiment of the present invention, when a user needs to perform a stock segment similarity query, the user can input a query instruction through the client. Upon receiving the user's query instruction, the data query platform determines the target stock data and the target query condition indicated by the query instruction. The target query condition may include a query time range and a stock query quantity, etc. The query instruction may carry a target stock identifier for which a similarity query is required. Upon receiving the query instruction, the query instruction is parsed to obtain the target stock identifier and the target query condition carried by the query instruction. Based on the target stock identifier, the target stock data is determined in the stock database.
[0069] Step 202: Generate a stock trend chart based on the target stock data.
[0070] In the embodiment of the present invention, based on the visualization processing of the queried target stock data, the target stock data is converted into a stock trend chart, and the stock trend chart can be displayed to the user through the client.
[0071] Step 203: Based on the query time range, determine the stock trend segment to be matched in the stock trend chart.
[0072] In the embodiment of the present invention, based on the query time range, a trend segment that meets the query time range is selected in the stock trend chart as the stock trend segment to be matched. For example, assuming that the query time range is from xx / xx / xx to yy / yy / yy, the time corresponding to the starting point of the stock trend segment to be matched is xx / xx / xx, and the time corresponding to the end point is yy / yy / yy.
[0073] In the embodiment of the present invention, based on a clear query time range, the to-be-matched stock trend segments that require stock data query can be quickly locked, thereby avoiding aimless searches in huge data sets, improving data processing speed, and reducing consumption of computing resources.
[0074] Step 102: Process the trend morphology features of the to-be-matched stock trend segment and each of the candidate stock trend segments respectively to obtain a to-be-matched feature sequence corresponding to the to-be-matched stock trend segment and a candidate feature sequence corresponding to each of the candidate stock trend segments.
[0075] In an embodiment of the present invention, in order to improve the accuracy of timing alignment of the stock trend segments to be matched and the candidate stock trend segments, the trend morphological features of the stock trend segments to be matched can be processed to obtain a feature sequence to be matched corresponding to the stock trend segments to be matched, and the trend morphological features of each candidate stock trend segment can be processed separately to obtain a candidate feature sequence corresponding to each candidate stock trend segment.
[0076] Optionally, step 102 may include the following steps:
[0077] Step 301, for the stock trend segment to be processed, normalize and differentiate the stock trend segment to be processed to obtain a feature sequence to be processed; the stock trend segment to be processed is the stock trend segment to be matched and any stock trend segment among the candidate stock trend segments.
[0078] In an embodiment of the present invention, both the stock trend segment to be matched and each candidate stock trend segment need to be processed with trend morphological features. Therefore, for the stock trend segment to be processed, that is, the stock trend segment to be matched or any candidate stock trend segment, the stock trend segment to be processed is normalized and differentially processed to obtain a feature sequence to be processed.
[0079] Since the absolute values of different stock prices vary greatly, in order to reduce the influence of the absolute value of the price on the judgment of the similarity of the morphological trend, it is necessary to normalize the stock trend fragments to be processed. For example, the stock trend fragments to be processed can be processed based on Min-Max normalization. Min-Max normalization can scale the data to a specific range, usually between [0,1]. This method maps the minimum value of the original data to 0 and the maximum value to 1 through linear transformation, so that the numerical range of the data is limited to a fixed interval. The normalized stock trend fragments to be processed retain the distribution form of the original stock trend fragments to be processed. This means that after normalization, the relative relationship between the data (such as size relationship, change trend, change amplitude, etc.) remains unchanged.
[0080] The normalized stock trend segments to be processed are further subjected to differential processing, and the feature sequence to be processed is obtained by processing the discrete trend segments. Differential processing can highlight the trend, fluctuation and periodicity characteristics in the time series by calculating the difference between adjacent data points. Differential processing can highlight the trend changes in the stock trend segments. Exemplarily, the first-order difference can be used to perform differential processing on the normalized stock trend segments to be processed to obtain the feature sequence to be processed.
[0081] Step 302: for any target time point in the feature sequence to be processed, determine feature information corresponding to the target time point based on subsequence shape information of multiple time points within a target time window length including the target time point.
[0082] In an embodiment of the present invention, for any target time point in the feature sequence to be processed, multiple time points within the target time window length including the target time point are determined, subsequence shape information of the multiple time points is obtained, and encoding is performed based on the subsequence shape information of the multiple time points as feature information corresponding to the target time point. Among them, the target time window length can be set according to the needs, for example, it can be 5. Combined with the subsequence shape information of multiple time points within a certain window near the target time point, the calculation is performed. Specifically, the subsequence shape information corresponding to the multiple time points within a certain window near the target time point can be encoded into a numerical value that can characterize the trend shape near the target time point through wavelet transform, as the feature information corresponding to the target time point.
[0083] For example, wavelet transform can be used to obtain wavelet coefficients of subsequences at different scales near a target time point in the feature sequence to be processed. These wavelet coefficients can be used as numerical values to characterize the morphology near the target time point. For example, the shape features of the subsequence can be extracted and quantified based on information such as the modulus and phase of the wavelet coefficients to obtain the subsequence shape information.
[0084] In a possible implementation, assuming that the target time window is 5, and the feature sequence to be processed includes 7 time points t1, t2, t3, t4, t5, t6, and t7, then for the target time point t3, the multiple time points within the target time window length including the target time point may be t1, t2, t3, t4, and t5; for the target time point t5, the multiple time points within the target time window length including the target time point may be t3, t4, t5, t6, and t7. It is understandable that when the target time point is t1, the multiple time points within the target time window length including the target time point may be determined as t1, t1, t1, t2, and t3 by interpolation, and correspondingly, when the target time point is t7, the multiple time points within the target time window length including the target time point may be determined as t5, t6, t7, t7, and t7 by interpolation.
[0085] Step 303: Determine the feature sequence corresponding to the stock trend segment to be processed based on the feature information corresponding to each target time point in the feature sequence to be processed; the feature sequence corresponding to the stock trend segment to be processed is the feature sequence to be matched or the candidate feature sequence.
[0086] In an embodiment of the present invention, the feature information corresponding to each target time point in the feature sequence to be processed is integrated to obtain a feature sequence corresponding to the stock trend segment to be processed after trend pattern feature processing, that is, a feature sequence to be matched or a candidate feature sequence.
[0087] In an embodiment of the present invention, by sequentially performing preprocessing operations such as normalization, differentiation, and wavelet transform on the stock trend segment to be processed, the trend change amplitude and change state of the stock trend segment to be processed can be more clearly reflected, and at the same time, the characteristic information of the trend form at different scales of the feature sequence to be processed can be captured, so that the processed feature sequence to be matched or the candidate feature sequence can provide global trend form information, and at the same time, the local trend form of the stock trend segment to be processed at each time point can be revealed, which is conducive to further timing alignment processing.
[0088] Step 103: for any of the candidate feature sequences, perform time alignment on the feature sequence to be matched and the candidate feature sequence to obtain a target feature sequence in the candidate feature sequence that matches the feature sequence to be matched; the target feature sequence includes all or part of the candidate feature sequences.
[0089] In the embodiment of the present invention, after determining the feature sequence to be matched and the candidate feature sequence, a similarity comparison query is performed on multiple candidate feature sequences in turn based on the feature sequence to be matched. For any candidate feature sequence, a time sequence alignment algorithm is used to perform time sequence alignment on the feature sequence to be matched and the candidate feature sequence to obtain a target feature sequence in the candidate feature sequence that matches the feature sequence to be matched.
[0090] Among them, the timing alignment algorithm can be an Open-begin and Open-end DTW (Dynamic Time Warping) timing alignment algorithm. The purpose of timing alignment is to find the best alignment between two sequences so that the data at different time points or frames can accurately correspond, thereby facilitating subsequent analysis and processing. In the process of timing alignment, the starting point of the feature sequence to be matched can start matching with any point in the candidate feature sequence, and the end point of the feature sequence to be matched can end matching with any point in the candidate feature sequence. In other words, timing alignment does not need to meet the endpoint binding constraints of the feature sequence to be matched and the candidate feature sequence. The starting point of the target feature sequence can be any point in the candidate feature sequence, and the end point of the target feature sequence can be any point in the candidate feature sequence after the starting point of the target feature sequence. Assuming that the feature sequence to be matched and the candidate feature sequence are Seq1 and Seq2 respectively, the starting point of Seq1 can correspond to any point P in Seq2, and the end point of Seq1 corresponds to any point D after point P in the Seq2 sequence. The obtained point P to point D is a feature sequence in Seq2 that is time-aligned with the feature sequence to be matched, that is, the target feature sequence. The target feature sequence can contain all or part of the candidate feature sequences, that is, the target feature sequence can be a candidate feature sequence or a fragment of a candidate feature sequence.
[0091] Exemplarily, a distance matrix is created by calculating the distance between any two points in the feature sequence to be matched and the candidate feature sequence. Each element (i, j) in the matrix represents the distance between the i-th point in the feature sequence to be matched and the j-th point in the candidate feature sequence, which is usually calculated using the Euclidean distance. Starting from the first element (1, 1) in the distance matrix, the optimal path with the smallest sum of cumulative paths is determined based on the timing alignment algorithm of Open-begin and Open-end DTW (Dynamic Time Warping). Based on the optimal path, the target feature sequence can be determined in the candidate feature sequence. Among them, the time window length of the target feature sequence and the feature sequence to be matched may be different, but the morphological trend of the target feature sequence and the feature sequence to be matched is similar.
[0092] Step 104: Based on the similarity between each of the target feature sequences and the feature sequence to be matched, determine a target stock trend segment among the multiple candidate stock trend segments that has similarity with the stock trend segment to be matched.
[0093] In an embodiment of the present invention, after determining the target feature sequence that matches the feature sequence to be matched in each candidate feature sequence, the similarity between each target feature sequence and the feature sequence to be matched is determined. Based on multiple similarities, a target stock trend segment having similarity with the stock trend segment to be matched is determined from multiple candidate stock trend segments. Among them, the target stock trend segment has morphological similarity with the stock trend segment to be matched. Based on the similarity, a target feature sequence that meets the target query condition is determined in advance. Since the target feature sequence includes all or part of the candidate feature sequences, and the candidate feature sequence is obtained based on the trend morphological feature processing of the candidate stock trend segment, therefore, based on the target feature sequence that meets the target query condition, the target stock trend segment corresponding to the target feature sequence in the corresponding candidate stock trend segment can be determined. Exemplarily, the time window information corresponding to the target feature sequence can be obtained, and the stock trend segment corresponding to the target feature sequence is obtained in the corresponding candidate stock trend segment based on the time window information as the target stock trend segment.
[0094] When determining the target feature sequence that meets the target query condition based on similarity, different feature sequence screening methods are performed according to different target query conditions. Exemplarily, the stock trend segments corresponding to a certain number of target feature sequences with a high similarity ranking (e.g., the number of stock queries indicated by the query instruction) can be selected as the target stock trend segments. The stock trend segments corresponding to the target feature sequences with a similarity greater than a preset similarity threshold can also be selected as the target stock trend segments.
[0095] In a possible implementation, trend morphological feature processing, timing alignment and similarity calculation can be performed based on a preset morphological similarity model. The morphological similarity model can be a model constructed based on the timing alignment algorithm of Open-begin and Open-end DTW (Dynamic Time Warping), and the morphological similarity model is a pre-trained model. Exemplarily, the stock trend segment to be matched and the candidate stock trend segment can be input into the morphological similarity model to obtain the similarity between the target feature sequence output by the morphological similarity model and the feature sequence to be matched. Based on multiple similarity results, the target stock trend segment that has similarity with the stock trend segment to be matched is determined among multiple candidate stock trend segments.
[0096] Optionally, when the target query condition also includes the stock query quantity, step 104 may include the following steps:
[0097] Step 401: Obtain the similarity between each of the target feature sequences and the feature sequence to be matched.
[0098] In an embodiment of the present invention, after the target feature sequence and the feature sequence to be matched are time-series aligned, the similarity between the target feature sequence and the feature sequence to be matched is calculated. The similarity is used to characterize the morphological similarity between the target feature sequence and the feature sequence to be matched. Exemplarily, the Pearson correlation coefficient can be used as the similarity between the target feature sequence and the feature sequence to be matched.
[0099] Optionally, step 401 may include the following steps:
[0100] Step 501: for any target feature sequence, obtain a first mean, a first variance and a first standard deviation of data corresponding to the target feature sequence, and obtain a second mean, a second variance and a second standard deviation of data corresponding to the feature sequence to be matched.
[0101] Step 502: Based on the first mean, the first variance, the first standard deviation, the second mean, the second variance, and the second standard deviation, determine the Pearson correlation coefficient between the target feature sequence and the feature sequence to be matched as the similarity.
[0102] In the embodiment of the present invention, for any target feature sequence, the first mean, first variance and first standard deviation of the data corresponding to the target feature sequence are obtained, and the second mean, second variance and second standard deviation of the data corresponding to the feature sequence to be matched are obtained. According to the first mean, first variance and first standard deviation of the data corresponding to the target feature sequence, and the second mean, second variance and second standard deviation of the data corresponding to the feature sequence to be matched, the Pearson correlation coefficient between the target feature sequence and the feature sequence to be matched is determined as the similarity. It can be understood that the calculation method of the first mean, first variance, first standard deviation, second mean, second variance and second standard deviation can refer to the calculation method in the prior art, and the embodiment of the present invention will not be repeated here.
[0103] The Pearson correlation coefficient is a statistic used to measure the linear correlation between two variables, namely the target feature sequence and the feature sequence to be matched. The value of the Pearson correlation coefficient is between -1 and 1, where the larger the value of the Pearson correlation coefficient, the higher the similarity, and vice versa.
[0104] In the embodiment of the present invention, by calculating the Pearson correlation coefficient between the target feature sequence and the feature sequence to be matched as the similarity between the target feature sequence and the feature sequence to be matched, the similarity calculation method can be simplified and the similarity value can be made more intuitive.
[0105] Step 402: sort the target feature sequences in descending order according to the similarity.
[0106] Step 403: Determine the stock trend segment corresponding to the target feature sequence that is ranked higher and matches the stock query quantity as the target stock trend segment.
[0107] In the embodiment of the present invention, each target feature sequence is sorted in descending order according to the similarity, and the target feature sequences with the highest number of stock queries are selected according to the sorting order, and the stock trend segments corresponding to the target feature sequences are determined as the target stock trend segments. Assuming that the number of stock queries is N, the target stock trend segments are the first N stock trend segments in the candidate stock pool that are most similar to the stock trend segments to be matched.
[0108] In an embodiment of the present invention, the stock trend segment corresponding to the target feature sequence ranked higher is selected as the target stock trend segment according to the similarity, and the target stock trend segment with the most similar shape to the stock trend segment to be matched can be screened out according to the similarity, thereby improving the diversity and comprehensiveness of stock data query.
[0109] In summary, in the embodiment of the present invention, a stock trend segment to be matched and a plurality of candidate stock trend segments are obtained; the stock trend segment to be matched and each candidate stock trend segment are processed with trend morphological features respectively to obtain a feature sequence to be matched corresponding to the stock trend segment to be matched and a candidate feature sequence corresponding to each candidate stock trend segment; for any candidate feature sequence, the feature sequence to be matched and the candidate feature sequence are aligned in time series to obtain a target feature sequence in the candidate feature sequence that matches the feature sequence to be matched; the target feature sequence includes all candidate feature sequences or part of the candidate feature sequences; based on the similarity between each target feature sequence and the feature sequence to be matched, a target stock trend segment in the plurality of candidate stock trend segments that has similarity with the stock trend segment to be matched is determined. In this way, by processing the trend morphological features of the stock trend segment to be matched and each candidate stock trend segment respectively to obtain the feature sequence to be matched and the candidate feature sequence, the trend change amplitude and change state of the stock trend segment to be matched and each candidate stock trend segment can be more clearly reflected, and then by performing time series alignment on the feature sequence to be matched and the candidate feature sequence, while improving the accuracy of time series alignment, the processed feature sequence to be matched and the candidate feature sequence are more suitable for matching the similarity of time series trend morphology. Moreover, by performing time alignment on the feature sequences to be matched and the candidate feature sequences, the probability of incomplete search of similar stock trend segments due to time distortion is reduced, thereby improving the accuracy and comprehensiveness of stock data query results.
[0110] Further, the target feature sequence in the embodiment of the present invention includes all candidate feature sequences or part of the candidate feature sequences, and the time window length of the target feature sequence is not limited. That is to say, in the process of timing alignment operation, there is no need to bind the endpoints of the two feature sequences to be compared. The time window length of the target feature sequence that matches the feature sequence to be matched after timing alignment can be different from the time window length of the feature sequence to be matched. Compared with the processing method of timing alignment with the same time window length, the embodiment of the present invention can increase the flexibility of timing alignment and improve the comprehensiveness of stock data search. At the same time, by directly performing timing alignment on the feature sequence to be matched and the candidate feature sequence, there is no need to divide the candidate feature sequence according to the time window length of the feature sequence to be matched, and then sequentially perform timing alignment and determine the similarity of the subsequences in the candidate feature sequence by sampling traversal. The embodiment of the present invention adopts the timing alignment algorithm of Open-begin and Open-end DTW (Dynamic Time Warping, dynamic time warping), which can complete the timing alignment and determine the similarity operation for each candidate feature sequence at one time, thereby improving the processing efficiency to a certain extent.
[0111] Optionally, the embodiment of the present invention may include the following steps:
[0112] Step 601, perform statistical analysis on the target stock trend segment to obtain statistical analysis results; the statistical analysis includes at least one of stock pattern occurrence frequency analysis, stock pattern future trend analysis and stock pattern stock selection analysis.
[0113] In an embodiment of the present invention, after determining the target stock trend segment, a statistical analysis can be performed based on the target stock trend segment to obtain a statistical analysis result. The statistical analysis includes at least one of a stock pattern occurrence frequency analysis, a stock pattern future trend analysis, and a stock pattern stock selection analysis. The stock pattern occurrence frequency analysis may include: based on the target stock trend segment, analyzing the occurrence frequency of stock trend segments similar to the stock trend segment to be matched in all stock trend segments. The stock pattern future trend analysis may include: based on the subsequent trend of the target stock trend segment, analyzing and predicting the subsequent trend of the stock trend segment to be matched. The stock pattern stock selection analysis may include: analyzing the target stock trend segment according to the stock selection needs of the user, and determining the stock data that meets the stock selection needs.
[0114] Exemplarily, a business scenario case in which a user selects stocks based on technical trend characteristics based on an embodiment of the present invention is as follows:
[0115] First, the user enters a query instruction to determine the target stock data and target query conditions indicated by the query instruction. The specific implementation method includes: selecting the target stock data of a stock that has shown the trend pattern required by the user, and selecting the pattern corresponding to the specific time window interval through the time frame on the market chart of the target stock data to obtain the stock trend segment to be matched. Then, the user selects the search stock range, such as the target stock pool, as the candidate stock pool. Further, according to the stock trend segment to be matched selected by the user, the morphological similarity model is used to traverse the morphological similarity matching of each candidate stock trend segment in the candidate stock pool specified by the user, and then according to the similarity, the top n (such as the top 10) stocks closest to the current date and time and with the largest similarity value are returned as the target stock trend segment. Based on the stock price trend pattern of the target stock trend segment and the stock trend segment to be matched, the user further selects the optimal stock target in combination with other information (such as fundamentals, finance, ESG, etc.).
[0116] Exemplarily, the business scenario cases in which users perform high-frequency trend pattern analysis based on the embodiments of the present invention are as follows:
[0117] First, the user inputs a query instruction to determine the target stock data and target query conditions indicated by the query instruction. The specific implementation method includes: selecting the target stock data of a stock that has appeared in the trend pattern required by the user, and selecting the pattern corresponding to the specific time window interval through the time frame on the market chart of the target stock data to obtain the stock trend segment to be matched. Then, the user selects the search stock range, such as the target stock pool, as the candidate stock pool. Further, according to the stock trend segment to be matched selected by the user, the morphological similarity model is used to traverse the morphological similarity matching of each candidate stock trend segment in the candidate stock pool specified by the user, and then according to the preset similarity threshold set by the user, the target stock trend segment greater than the preset similarity threshold is searched, and sorted and returned according to the similarity. Based on the target stock trend segment, the user statistically analyzes the frequency of occurrence of the trend pattern corresponding to the stock trend segment to be matched. Then, by performing the above-mentioned frequency statistics on the stock trend segments to be matched with different trend patterns, the stock price trend pattern with a higher frequency of occurrence can be analyzed, and then the stock price trend pattern with a high frequency of occurrence / repetition can be mined, providing a reference for technical factor mining and technical stock selection.
[0118] For example, Figure 3 A flow chart showing the specific steps of a stock data query method is shown in FIG. Figure 3 As shown, the user selects the target stock data with the target trend pattern, and based on the query time range, selects the stock trend segment to be matched corresponding to the target trend pattern in the stock trend chart corresponding to the target stock data. According to the target query conditions, the stock data is queried in the candidate stock pool to obtain the target stock trend segment that is similar to the target trend pattern of the stock trend segment to be matched. Based on the target stock trend segment, the stock pattern occurrence frequency analysis, stock pattern future trend analysis and stock pattern stock selection analysis are performed to obtain the statistical analysis results.
[0119] For example, Figure 4 A data interaction diagram of a stock data query system is shown. Figure 4 As shown, after the user inputs the initial parameters of the system to initialize the stock data query system, the user inputs a query instruction, queries the target stock data in the stock data warehouse according to the target stock identifier indicated by the query instruction, and determines the stock trend segment to be matched from the stock trend chart corresponding to the target stock data according to the query time range indicated by the query instruction. According to the stock trend segment to be matched, the target stock trend segment that is similar to the stock trend segment to be matched is searched in the stock data warehouse or in the candidate stock pool pre-screened based on the stock data warehouse. The target stock trend segment is displayed on the front end, and the user can download the target stock trend segment for statistical analysis.
[0120] For example, Figure 5 A schematic diagram of the structure of a stock data query method is shown. Figure 5 As shown, the query query, i.e., the stock trend segment to be matched, is determined based on the query command input by the user. The historical stock price sequence corresponding to each candidate stock data is determined from the candidate stock pool, i.e., the candidate stock trend segment. Based on the morphological similarity model, the trend morphological feature processing (including normalization, differentiation or derivation, and wavelet transform) of the stock trend segment to be matched and each candidate stock trend segment is completed, the timing alignment algorithm of Open-begin and Open-end DTW (Dynamic Time Warping) is used for timing alignment, and the similarity between the target feature sequence and the feature sequence to be matched is calculated based on the Pearson correlation coefficient to obtain multiple similarity results. Based on the similarity results, the most similar result list is determined, including the target feature sequence that meets the target query conditions.
[0121] Figure 6 is a schematic diagram of the structure of a stock data query device provided by an embodiment of the present invention, such as Figure 6 As shown, the device may specifically include:
[0122] The first acquisition module 701 is used to acquire a to-be-matched stock trend segment and a plurality of candidate stock trend segments;
[0123] The first processing module 702 is used to perform trend morphological feature processing on the to-be-matched stock trend segment and each of the candidate stock trend segments, respectively, to obtain a to-be-matched feature sequence corresponding to the to-be-matched stock trend segment and a candidate feature sequence corresponding to each of the candidate stock trend segments;
[0124] The first alignment module 703 is used to perform time alignment on the feature sequence to be matched and the candidate feature sequence for any of the candidate feature sequences, to obtain a target feature sequence in the candidate feature sequence that matches the feature sequence to be matched; the target feature sequence includes all or part of the candidate feature sequences;
[0125] The first determination module 704 is used to determine a target stock trend segment having similarity with the stock trend segment to be matched among the multiple candidate stock trend segments based on the similarity between each of the target feature sequences and the feature sequence to be matched.
[0126] Optionally, the first processing module 702 includes:
[0127] A first processing submodule is used for performing normalization processing and differential processing on the stock trend segment to be processed to obtain a feature sequence to be processed; the stock trend segment to be processed is any stock trend segment among the stock trend segment to be matched and the candidate stock trend segments;
[0128] A first determination submodule is used to determine, for any target time point in the feature sequence to be processed, feature information corresponding to the target time point based on subsequence shape information of multiple time points within a target time window length including the target time point;
[0129] The second determination submodule is used to determine the feature sequence corresponding to the stock trend segment to be processed based on the feature information corresponding to each target time point in the feature sequence to be processed; the feature sequence corresponding to the stock trend segment to be processed is the feature sequence to be matched or the candidate feature sequence.
[0130] Optionally, the device further comprises:
[0131] A second determination module is used to determine the target stock data and target query conditions indicated by the query instruction when receiving the query instruction from the user; the target query conditions include the query time range;
[0132] A first generating module, used for generating a stock trend chart based on the target stock data;
[0133] A third determination module is used to determine a stock trend segment to be matched in the stock trend chart based on the query time range.
[0134] Optionally, the target query condition further includes a stock query quantity; the first determination module 704 includes:
[0135] A second acquisition module is used to obtain the similarity between each of the target feature sequences and the feature sequence to be matched;
[0136] A first sorting module, used to sort the target feature sequences in descending order according to the similarity;
[0137] The fourth determination module is used to determine the stock trend segment corresponding to the target feature sequence that is ranked higher and matches the stock query quantity as the target stock trend segment.
[0138] Optionally, the second acquisition module includes:
[0139] A first acquisition submodule is used to acquire, for any of the target feature sequences, a first mean, a first variance, and a first standard deviation of the data corresponding to the target feature sequence, and to acquire a second mean, a second variance, and a second standard deviation of the data corresponding to the feature sequence to be matched;
[0140] The third determination submodule is used to determine the Pearson correlation coefficient between the target feature sequence and the feature sequence to be matched based on the first mean, the first variance, the first standard deviation, the second mean, the second variance and the second standard deviation as the similarity.
[0141] Optionally, the device further comprises:
[0142] The first analysis module is used to perform statistical analysis on the target stock trend segment to obtain statistical analysis results; the statistical analysis includes at least one of stock pattern occurrence frequency analysis, stock pattern future trend analysis and stock pattern stock selection analysis.
[0143] The present invention also provides an electronic device, see Figure 7 , including: a processor 801, a memory 802, and a computer program 8021 stored in the memory and executable on the processor, wherein the processor implements the stock data query method of the aforementioned embodiment when executing the program.
[0144] The present invention also provides a readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the stock data query method of the aforementioned embodiment.
[0145] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0146] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0147] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0148] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0149] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0150] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0151] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0152] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0153] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0154] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0155] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for querying stock data, characterized in that: The method comprises: Obtain a stock trend segment to be matched and multiple candidate stock trend segments; Performing trend morphological feature processing on the to-be-matched stock trend segment and each of the candidate stock trend segments respectively, to obtain a to-be-matched feature sequence corresponding to the to-be-matched stock trend segment and a candidate feature sequence corresponding to each of the candidate stock trend segments; For any of the candidate feature sequences, the feature sequence to be matched and the candidate feature sequence are time-series aligned to obtain a target feature sequence in the candidate feature sequence that matches the feature sequence to be matched; the target feature sequence includes all or part of the candidate feature sequences; Based on the similarity between each of the target feature sequences and the feature sequence to be matched, a target stock trend segment having similarity with the stock trend segment to be matched is determined among the multiple candidate stock trend segments.
2. The method according to claim 1, characterized in that: The step of performing trend morphological feature processing on the to-be-matched stock trend segment and each of the candidate stock trend segments to obtain a to-be-matched feature sequence corresponding to the to-be-matched stock trend segment and a candidate feature sequence corresponding to each of the candidate stock trend segments includes: For the stock trend segment to be processed, normalization processing and differential processing are performed on the stock trend segment to be processed to obtain a feature sequence to be processed; the stock trend segment to be processed is any stock trend segment among the stock trend segment to be matched and the candidate stock trend segments; For any target time point in the feature sequence to be processed, determining feature information corresponding to the target time point based on subsequence shape information of multiple time points within a target time window length including the target time point; Based on the feature information corresponding to each target time point in the feature sequence to be processed, the feature sequence corresponding to the stock trend segment to be processed is determined; the feature sequence corresponding to the stock trend segment to be processed is the feature sequence to be matched or the candidate feature sequence.
3. The method according to claim 1, characterized in that The method further comprises: In the case of receiving a query instruction from a user, determining the target stock data and target query conditions indicated by the query instruction; the target query conditions include a query time range; Based on the target stock data, generate a stock trend chart; Based on the query time range, a stock trend segment to be matched is determined in the stock trend chart.
4. The method according to claim 3, characterized in that: The target query condition also includes the number of stock queries; the determining, based on the similarity between each of the target feature sequences and the feature sequence to be matched, a target stock trend segment having similarity with the stock trend segment to be matched among the plurality of candidate stock trend segments, includes: Obtaining the similarity between each of the target feature sequences and the feature sequence to be matched; Sorting each of the target feature sequences in descending order according to the similarity; The stock trend segment corresponding to the target feature sequence that is ranked higher and matches the stock query quantity is determined as the target stock trend segment.
5. The method according to claim 4, characterized in that The obtaining of the similarity between each of the target feature sequences and the feature sequence to be matched includes: For any of the target feature sequences, obtaining a first mean, a first variance, and a first standard deviation of the data corresponding to the target feature sequence, and obtaining a second mean, a second variance, and a second standard deviation of the data corresponding to the feature sequence to be matched; Based on the first mean, the first variance, the first standard deviation, the second mean, the second variance, and the second standard deviation, a Pearson correlation coefficient between the target feature sequence and the feature sequence to be matched is determined as the similarity.
6. The method according to claim 1, characterized in that The method further comprises: Performing statistical analysis on the target stock trend segment to obtain statistical analysis results; the statistical analysis includes at least one of stock pattern occurrence frequency analysis, stock pattern future trend analysis, and stock pattern stock selection analysis.
7. A stock data query device, characterized in that: The device comprises: A first acquisition module is used to acquire a to-be-matched stock trend segment and a plurality of candidate stock trend segments; A first processing module is used to perform trend morphological feature processing on the to-be-matched stock trend segment and each of the candidate stock trend segments, respectively, to obtain a to-be-matched feature sequence corresponding to the to-be-matched stock trend segment and a candidate feature sequence corresponding to each of the candidate stock trend segments; A first alignment module is used to perform time alignment on the feature sequence to be matched and the candidate feature sequence for any of the candidate feature sequences, so as to obtain a target feature sequence in the candidate feature sequence that matches the feature sequence to be matched; the target feature sequence includes all or part of the candidate feature sequences; The first determination module is used to determine a target stock trend segment having similarity with the stock trend segment to be matched among the multiple candidate stock trend segments based on the similarity between each of the target feature sequences and the feature sequence to be matched.
8. The device according to claim 7, characterized in that The first processing module comprises: A first processing submodule is used for performing normalization processing and differential processing on the stock trend segment to be processed to obtain a feature sequence to be processed; the stock trend segment to be processed is any stock trend segment among the stock trend segment to be matched and the candidate stock trend segments; A first determination submodule is used to determine, for any target time point in the feature sequence to be processed, feature information corresponding to the target time point based on subsequence shape information of multiple time points within a target time window length including the target time point; The second determination submodule is used to determine the feature sequence corresponding to the stock trend segment to be processed based on the feature information corresponding to each target time point in the feature sequence to be processed; the feature sequence corresponding to the stock trend segment to be processed is the feature sequence to be matched or the candidate feature sequence.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the stock data query method as described in any one of claims 1 to 6 when executing the program.
10. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the stock data query method described in any one of claims 1-6.