Methods, devices, electronic equipment and media for analyzing candlestick chart data of financial products

By converting the candlestick chart data sequences of financial products into image form and using convolutional filters for analysis, the problem of excessive computational resource consumption in large-scale data analysis is solved, improving the accuracy and efficiency of the analysis.

CN119810624BActive Publication Date: 2025-11-14CSC FINANCIAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510295338.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-11-14
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

Financial data analysis suffers from problems such as excessive consumption of computing resources due to large data volumes, and loss of key information due to unreasonable information compression methods, which weakens the ability to integrate information.

Method used

The candlestick chart data sequence of financial products is converted into an image format. Pixels with different color values ​​represent information such as price and trading volume, and convolutional layers and convolutional filters with different gradient scales are used for analysis.

Benefits of technology

It reduces the computational resource consumption of data analysis, improves the accuracy and efficiency of analysis, reduces noise interference, and improves the signal-to-noise ratio.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810624B_ABST
    Figure CN119810624B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, and medium for analyzing K-line sequence data of financial products, relating to the field of image processing technology. The method includes: acquiring a first K-line data sequence of a target financial product; generating a first image based on the first K-line data sequence, wherein each first pixel column in the first image corresponds to a first time period, and the color values ​​of pixels in the first pixel row corresponding to the highest and lowest prices are set to a first color value; the color values ​​of pixels between the second pixel row corresponding to the opening and closing prices are all set to the first color value; the color values ​​of pixels between the third pixel row corresponding to the trading volume and the third pixel row corresponding to a first preset minimum trading volume are set to the first color value; and performing data analysis on the target financial product based on the generated image. Applying the solution provided in this application can reduce the computational resources consumed when analyzing financial data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to methods, apparatus, electronic devices and media for analyzing K-line sequence data of financial products. Background Technology

[0002] Financial analysts and researchers need to analyze various types of financial time series data in their work. Taking stocks as an example, the stock time series data to be analyzed often includes financial series data over multiple time periods, such as daily trading days, 5 trading days, 22 trading days, and 66 trading days. Furthermore, it often requires overall analysis of financial data collected over a relatively long period according to these time periods. The types of financial data to be analyzed are numerous, and each type involves multi-period statistical calculations, resulting in a large total data volume. Further training of artificial intelligence models with the analysis results faces challenges such as insufficient data compression leading to computational pressure, and the loss of key information due to unreasonable information compression methods, affecting the subsequent information fusion capabilities. Summary of the Invention

[0003] The purpose of this application is to provide a method, apparatus, electronic device, and medium for analyzing K-line sequence data of financial products, so as to reduce the computing resources consumed when analyzing financial data. The specific technical solution is as follows:

[0004] In a first aspect, embodiments of this application provide a method for analyzing candlestick chart data of financial products, the method comprising:

[0005] Obtain the first candlestick data sequence of the target financial product, wherein the first candlestick data sequence includes the highest price, lowest price, opening price, closing price, and trading volume of the target financial product in each first time period;

[0006] Based on the first K-line data sequence, a first image is generated, the first image comprising a first part, a second part and a third part;

[0007] Each first pixel column in the first image corresponds to a first time period, each first pixel row in the first part corresponds to a price value, the difference between the price values ​​corresponding to adjacent first pixel rows is a first preset value, and within each first pixel column, the color value of the pixel in the first pixel row corresponding to the highest price and the lowest price in the first time period corresponding to the first pixel column is set to a first color value.

[0008] Each second pixel row in the second part corresponds to a price value, and the difference between the price values ​​corresponding to adjacent second pixel rows is a second preset value. In each first pixel column, the color values ​​of the pixels between the second pixel rows corresponding to the opening price and the closing price in the first time period corresponding to the first pixel column are all set to the first color value.

[0009] Each third pixel row in the third part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent third pixel rows is a third preset value. In each first pixel column, the color values ​​of the pixels between the third pixel row corresponding to the transaction volume in the first time period and the third pixel row corresponding to the first preset minimum transaction volume are all set to the first color value.

[0010] The color value of the unset pixels in the first image is the second color value, and the first color value is different from the second color value;

[0011] Based on the generated images, data analysis is performed on the target financial product.

[0012] In one embodiment of this application, prior to performing data analysis on the target financial product based on the generated image, the method further includes:

[0013] Obtain the second candlestick data sequence of the target financial product, wherein the second candlestick data sequence includes the highest price, lowest price, opening price, closing price, and trading volume of the target financial product in each second time period, and the duration of the second time period is shorter than the duration of the first time period;

[0014] Based on the second candlestick data sequence, a second image is generated, which includes a fourth part, a fifth part, and a sixth part.

[0015] Each second pixel column in the second image corresponds to a second time period, each fourth pixel row in the fourth part corresponds to a price value, the difference between the price values ​​corresponding to adjacent fourth pixel rows is a fourth preset value, and within each second pixel column, the color value of the pixel in the fourth pixel row corresponding to the highest and lowest prices in the second time period corresponding to that second pixel column is set to a third color value.

[0016] Each fifth pixel row in the fifth part corresponds to a price value, and the difference between the price values ​​corresponding to adjacent fifth pixel rows is a fifth preset value. In each second pixel column, the color values ​​of the pixels between the fifth pixel rows corresponding to the opening price and the closing price in the second time period corresponding to the second pixel column are all set to the third color value.

[0017] Each sixth pixel row in the sixth part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent sixth pixel rows is the sixth preset value. In each second pixel column, the color values ​​of the pixels between the sixth pixel row corresponding to the transaction volume in the second time period and the sixth pixel row corresponding to the second preset minimum transaction volume are all set to the third color value.

[0018] The color value of the unset pixels in the second image is the fourth color value, and the third color value is different from the fourth color value.

[0019] In one embodiment of this application, prior to performing data analysis on the target financial product based on the generated image, the method further includes:

[0020] Obtain a third data sequence of the trading market for the target financial product, wherein the third data sequence includes trading indicator data for the trading duration within each third time period;

[0021] Based on the third data sequence, a third image is generated;

[0022] In the third image, each second pixel column corresponds to a third time period, each seventh pixel row corresponds to a transaction indicator data value, the difference between the transaction indicator data values ​​corresponding to adjacent seventh pixel rows is a seventh preset value, and within each third pixel column, the color value of the pixel in the third pixel row corresponding to the transaction indicator data in the third time period is set to a fifth color value.

[0023] The color value of the unset pixels in the second image is the sixth color value, and the fifth color value is different from the sixth color value.

[0024] In one embodiment of this application, obtaining the first K-line data sequence of the target financial product includes:

[0025] Obtain multiple first candlestick data sequences of the target financial product. The duration of the first time period corresponding to different first candlestick data sequences is different, and the number of data items contained in each first candlestick data sequence is the same.

[0026] The grayscale values ​​of pixels in the first part of the first image are set differently based on different first K-line data sequences; the color values ​​of pixels in the second and third parts are set based on the first K-line data sequence corresponding to the shortest first time period.

[0027] In one embodiment of this application, obtaining the second K-line data sequence of the target financial product includes:

[0028] Obtain multiple second candlestick data sequences of the target financial product. The duration of the second time period corresponding to different second candlestick data sequences is different, and the number of data items contained in each second candlestick data sequence is the same.

[0029] Based on the fact that the grayscale values ​​of the pixels in the fourth part of the second image are set differently according to different second K-line data sequences, the color values ​​of the pixels in the fifth and sixth parts are set according to the second K-line data sequence corresponding to the second time period with the longest duration.

[0030] In one embodiment of this application, the data analysis of the target financial product based on the generated image includes:

[0031] The generated image is input into an image analysis model to obtain the data analysis results of the target financial product output by the image analysis model. The image analysis model contains convolutional layers, and the convolutional layers contain convolutional filters with different gradient scales.

[0032] Secondly, embodiments of this application provide a financial product candlestick chart data analysis device, the device comprising:

[0033] The first sequence acquisition module is used to acquire the first K-line data sequence of the target financial product, wherein the first K-line data sequence includes the highest price, lowest price, opening price, closing price and trading volume of the target financial product in each first time period;

[0034] The first image generation module is used to generate a first image based on the first K-line data sequence, the first image comprising a first part, a second part and a third part;

[0035] Each first pixel column in the first image corresponds to a first time period, each first pixel row in the first part corresponds to a price value, the difference between the price values ​​corresponding to adjacent first pixel rows is a first preset value, and within each first pixel column, the color value of the pixel in the first pixel row corresponding to the highest price and the lowest price in the first time period corresponding to the first pixel column is set to a first color value.

[0036] Each second pixel row in the second part corresponds to a price value, and the difference between the price values ​​corresponding to adjacent second pixel rows is a second preset value. In each first pixel column, the color values ​​of the pixels between the second pixel rows corresponding to the opening price and the closing price in the first time period corresponding to the first pixel column are all set to the first color value.

[0037] Each third pixel row in the third part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent third pixel rows is a third preset value. In each first pixel column, the color values ​​of the pixels between the third pixel row corresponding to the transaction volume in the first time period and the third pixel row corresponding to the first preset minimum transaction volume are all set to the first color value.

[0038] The color value of the unset pixels in the first image is the second color value, and the first color value is different from the second color value;

[0039] The data analysis module is used to perform data analysis on the target financial product based on the generated image.

[0040] In one embodiment of this application, the apparatus further includes:

[0041] The second sequence acquisition module is used to acquire the second K-line data sequence of the target financial product, wherein the second K-line data sequence includes the highest price, lowest price, opening price, closing price and trading volume of the target financial product in each second time period, and the duration of the second time period is shorter than the duration of the first time period.

[0042] The second image generation module is used to generate a second image based on the second K-line data sequence. The second image includes a fourth part, a fifth part, and a sixth part.

[0043] Each second pixel column in the second image corresponds to a second time period, each fourth pixel row in the fourth part corresponds to a price value, the difference between the price values ​​corresponding to adjacent fourth pixel rows is a fourth preset value, and within each second pixel column, the color value of the pixel in the fourth pixel row corresponding to the highest and lowest prices in the second time period corresponding to that second pixel column is set to a third color value.

[0044] Each fifth pixel row in the fifth part corresponds to a price value, and the difference between the price values ​​corresponding to adjacent fifth pixel rows is a fifth preset value. In each second pixel column, the color values ​​of the pixels between the fifth pixel rows corresponding to the opening price and the closing price in the second time period corresponding to the second pixel column are all set to the third color value.

[0045] Each sixth pixel row in the sixth part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent sixth pixel rows is the sixth preset value. In each second pixel column, the color values ​​of the pixels between the sixth pixel row corresponding to the transaction volume in the second time period and the sixth pixel row corresponding to the second preset minimum transaction volume are all set to the third color value.

[0046] The color value of the unset pixels in the second image is the fourth color value, and the third color value is different from the fourth color value.

[0047] In one embodiment of this application, the apparatus further includes:

[0048] The third sequence acquisition module is used to acquire the third data sequence of the trading market for the target financial product, wherein the third data sequence includes trading indicator data of the trading duration in each third time period.

[0049] The third image generation module is used to generate a third image based on the third data sequence;

[0050] In the third image, each second pixel column corresponds to a third time period, each seventh pixel row corresponds to a transaction indicator data value, the difference between the transaction indicator data values ​​corresponding to adjacent seventh pixel rows is a seventh preset value, and within each third pixel column, the color value of the pixel in the third pixel row corresponding to the transaction indicator data in the third time period is set to a fifth color value.

[0051] The color value of the unset pixels in the second image is the sixth color value, and the fifth color value is different from the sixth color value.

[0052] In one embodiment of this application, the first sequence acquisition module is specifically used for:

[0053] Obtain multiple first candlestick data sequences of the target financial product. The duration of the first time period corresponding to different first candlestick data sequences is different, and the number of data items contained in each first candlestick data sequence is the same.

[0054] The grayscale values ​​of pixels in the first part of the first image are set differently based on different first K-line data sequences; the color values ​​of pixels in the second and third parts are set based on the first K-line data sequence corresponding to the shortest first time period.

[0055] In one embodiment of this application, the second sequence acquisition module is specifically used for:

[0056] Obtain multiple second candlestick data sequences of the target financial product. The duration of the second time period corresponding to different second candlestick data sequences is different, and the number of data items contained in each second candlestick data sequence is the same.

[0057] Based on the fact that the grayscale values ​​of the pixels in the fourth part of the second image are set differently according to different second K-line data sequences, the color values ​​of the pixels in the fifth and sixth parts are set according to the second K-line data sequence corresponding to the second time period with the longest duration.

[0058] In one embodiment of this application, the data analysis module is specifically used for:

[0059] The generated image is input into an image analysis model to obtain the data analysis results of the target financial product output by the image analysis model. The image analysis model contains convolutional layers, and the convolutional layers contain convolutional filters with different gradient scales.

[0060] Thirdly, embodiments of this application provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0061] Memory, used to store computer programs;

[0062] When a processor executes a program stored in memory, it implements the steps of the method described in any of the first aspects.

[0063] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in any of the first aspects.

[0064] Fifthly, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described in the first aspect above.

[0065] Beneficial effects of the embodiments in this application:

[0066] The financial product candlestick chart data analysis method provided in this application can generate a first image based on a first candlestick chart data sequence of the target financial product. The color values ​​of the pixels in the first image can represent various data recorded in the first candlestick chart data sequence. In other words, this application can integrate the information recorded in a large first candlestick chart data sequence into a single first image. Subsequent data analysis of the financial product can be completed by processing this single first image, saving computational resources required for subsequent data analysis. Furthermore, the first image only contains pixels with color values ​​of either a first color value or a second color value. The color information of the image is relatively simple, avoiding the introduction of large amounts of noise due to complex pixel colors. Therefore, the first image has a high signal-to-noise ratio, which is beneficial for improving the accuracy and efficiency of subsequent data analysis. Attached Figure Description

[0067] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0068] Figure 1 A flowchart illustrating the first method for analyzing K-line sequence data of financial products provided in this application embodiment;

[0069] Figure 2 A schematic diagram of the processing flow of an image analysis model provided in an embodiment of this application;

[0070] Figure 3 A schematic diagram of a first image provided for an embodiment of this application;

[0071] Figure 4 A flowchart illustrating the second method for analyzing candlestick chart data of financial products provided in this application embodiment;

[0072] Figure 5 A flowchart illustrating the third method for analyzing K-line sequence data of financial products provided in this application embodiment;

[0073] Figure 6 A schematic diagram of the structure of a financial product K-line sequence data analysis device provided in this application embodiment;

[0074] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0075] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0076] Because the amount of financial data in related technologies is large, data analysis requires a lot of computing resources. In order to solve the above problem, this application provides a method, device, electronic device and medium for analyzing K-line sequence data of financial products.

[0077] See Figure 1 This is a flowchart illustrating the first financial product K-line sequence data analysis method provided in this application embodiment, including the following steps S101-S103.

[0078] S101: Obtain the first candlestick data sequence of the target financial product.

[0079] The aforementioned first candlestick data sequence includes the highest price, lowest price, opening price, closing price, and trading volume of the target financial product within each first time period. This first candlestick data sequence originates from the candlestick information of the target financial product; the source and collection methods of this candlestick information can be found in relevant technical documents and will not be elaborated upon here.

[0080] For example, if the first time period is one day, the first candlestick data sequence includes the highest price, lowest price, opening price, closing price, and trading volume of the target financial product for each day.

[0081] With the first time period being 5 days, for each day, the first candlestick data sequence includes the highest price, lowest price, opening price, closing price, and trading volume for the past 5 days, with that day as the last day.

[0082] In the case that the first time period is 22 days, for each day, the first K-line data sequence includes the highest price, lowest price, opening price, closing price, and trading volume for the past 22 days, with that day as the last day.

[0083] When the first time period is 66 days, for each day, the first K-line data sequence includes the highest price, lowest price, opening price, closing price, and trading volume within the last 66 days, with that day as the last day.

[0084] It should be noted that since the target financial product may not be available for trading on every single day, when compiling the above first candlestick data sequence, only the data for the target financial product within the trading days should be considered. In this case, each day refers to one trading day, the last 5 days refers to the last 5 trading days, and so on.

[0085] In addition, the aforementioned target financial products can be stocks, futures, funds, gold, etc., meaning that the embodiments of this application are applicable to stock data analysis, futures data analysis, fund data analysis, gold data analysis, etc.

[0086] Furthermore, if the target financial product did not trade on a certain day or several days due to factors such as suspension of trading, the first K-line data sequence will not include the data from the first time period corresponding to the target financial product that includes the time interval during which no trading occurred.

[0087] In another embodiment of this application, the data recorded in the first K-line data sequence can be the original data. Alternatively, the highest price, lowest price, opening price, and closing price can also be data that has been scaled proportionally to integers from the original collected actual prices. For example, a vertical axis scaling method can be used; the specific scaling method will not be described in detail in this application. Scaling simplifies the data contained in the first K-line data sequence, and the simplified data facilitates the subsequent generation of the first image.

[0088] S102: Generate a first image based on the first K-line data sequence mentioned above.

[0089] The first image mentioned above includes a first part, a second part, and a third part.

[0090] Specifically, the first, second, and third parts are arranged vertically in the first image. In one possible case, the first, second, and third parts are arranged from bottom to top in the first image, or in other orders.

[0091] (i) For the first part, each first pixel column in the first image corresponds to a first time period, each first pixel row in the first part corresponds to a price value, the difference between the price values ​​corresponding to adjacent first pixel rows is a first preset value, and within each first pixel column, the color value of the pixel in the first pixel row corresponding to the highest price and the lowest price in the first time period corresponding to the first pixel column is set to a first color value.

[0092] In one embodiment of this application, the first preset value can be set according to actual needs, and the price value corresponding to the first pixel row at the bottom and the price value corresponding to the first pixel row at the top of the first part can be set to determine the price value corresponding to each first pixel row, and then set.

[0093] In another embodiment of this application, the first part may include x columns of first pixels and y rows of first pixels. In this case, the highest and lowest prices of each of the original first time periods can be scaled proportionally to integer values ​​within the range of (0, y-1). In this case, the price corresponding to the bottommost first pixel row in the first part is 0, the price corresponding to the topmost first pixel row is y-1, and the price difference between adjacent first pixel rows is 1. This ensures that the first pixel row corresponding to the minimum of all scaled lowest and highest prices is the bottommost row of the first part, and the first pixel row corresponding to the maximum of all scaled lowest and highest prices is the topmost row of the first part. This ensures that there are no first pixel rows at the top and bottom of the first part where all pixel color values ​​are not configured, thereby reducing the image size of the first part.

[0094] Additionally, if data for one or more first time periods is missing in the first candlestick data sequence due to data acquisition failure or trading halt, the color value of the first pixel in the first pixel column corresponding to that first time period will not be set.

[0095] After setting the color values, the first part can show the fluctuations of the highest and lowest prices over time.

[0096] (ii) Regarding the second part, each second pixel row of the second part corresponds to a price value, and the difference between the price values ​​corresponding to adjacent second pixel rows is a second preset value. Within each first pixel column, the color values ​​of the pixels between the second pixel rows corresponding to the opening price and the closing price in the first time period corresponding to the first pixel column are all set to the first color value.

[0097] In one embodiment of this application, the aforementioned second preset value can be set according to actual needs, and the price value corresponding to the second pixel row at the bottom of the second part and the price value corresponding to the second pixel row at the top are set to determine the price value corresponding to each second pixel row, and then set.

[0098] In another embodiment of this application, the second part includes x first pixel columns and z second pixel rows. For each first time period, the minimum value of the original opening and closing prices collected for that first time period is subtracted to obtain the updated opening and closing prices. Then, the updated opening and closing prices for each first time period are scaled to integer values ​​within the range (0, z-1) to obtain the opening and closing prices contained in the first K-line data sequence. In this case, the price value corresponding to the bottommost second pixel row in the second part is 0, the price value corresponding to the topmost second pixel row is z-1, and the difference in price values ​​between adjacent second pixel rows is 1. This ensures that the second pixel row corresponding to the minimum value of all the final opening and closing prices is the bottommost row of the second part, and the minimum value of each set of opening and closing prices is 0, corresponding to the bottommost second pixel row in the second part. Furthermore, the second pixel row corresponding to the maximum value among all the lowest and highest prices is the top row of the second part. In this case, there can be no second pixel row at the top of the second part where all pixels have unconfigured color values, and the bottom can only have one second pixel row corresponding to the minimum value among all opening and closing prices, where all pixels are configured with the first color value. This reduces the image size of the second part.

[0099] After setting, for each second pixel column, the more pixels in that second pixel column whose color value is set to the first color value, the greater the absolute value of the difference between the opening price and the closing price of the corresponding first time period, and the greater the price change of the target financial product from the beginning to the end of the first time period.

[0100] Additionally, if data for one or more first time periods is missing in the first candlestick data sequence due to data acquisition failure or trading halt, the color values ​​of the pixels in the second part of the first pixel column corresponding to that first time period will not be set.

[0101] (iii) Regarding the third part, each third pixel row of the third part corresponds to a transaction volume value, and the difference between the transaction volume values ​​corresponding to adjacent third pixel rows is a third preset value. Within each first pixel column, the color values ​​of the pixels between the third pixel row corresponding to the transaction volume in the first time period and the third pixel row corresponding to the first preset minimum transaction volume are all set to the first color value.

[0102] The first preset minimum trading volume can be 0, or it can be the minimum value of all trading volumes recorded in the first K-line data sequence.

[0103] In one embodiment of this application, the aforementioned third preset value can be set according to actual needs, and the transaction volume value corresponding to the bottommost third pixel row and the topmost third pixel row of the third part can be set to determine the transaction volume value corresponding to each third pixel row, and then set accordingly.

[0104] In another embodiment of this application, the aforementioned third part includes x first pixel columns and p third pixel rows. For each first time period, the original collected transaction volume corresponding to the first time period is subtracted by a first preset minimum transaction volume to obtain the updated transaction volume. Then, the updated transaction volume corresponding to each first time period is scaled to an integer value within the interval (0, p-1) to obtain the transaction volume contained in the first K-line data sequence. In this case, the transaction volume corresponding to the bottommost third pixel row in the third part is 0, the transaction volume corresponding to the topmost third pixel row is p-1, and the difference between the transaction volume values ​​of adjacent third pixel rows is 1.

[0105] Using the above settings, the more pixels in the first pixel column whose color value is configured as the first color value, the higher the transaction volume in the first time period corresponding to that first pixel column.

[0106] If the first preset minimum transaction volume is less than the minimum of all transaction volumes, it means that all transaction volumes are greater than the first preset minimum transaction volume. In this case, the third pixel row corresponding to all transaction volumes is not the same pixel row as the third pixel row corresponding to the first preset minimum transaction volume. Therefore, in each first pixel column, there will be more than one pixel with its color value set to the first color value. Thus, at the bottom of the third part, there may be more than one third pixel row where all pixels have their color values ​​set to the first color value. Even if this part of the third pixel row does not exist, it does not affect the difference in the number of pixels in each first pixel column whose color value is configured as the first color value, which can represent the difference in the transaction volume within the first time period corresponding to that first pixel column. Therefore, this part of the third pixel row can be absent, so the first preset minimum transaction volume can be set to the minimum of all transaction volumes. This can reduce the size of the third part.

[0107] The color value of the unset pixels (also known as background pixels) in the first image is a second color value, and the first color value is different from the second color value.

[0108] In one embodiment of this application, the first color value and the second color value can be any different color values.

[0109] In another embodiment of this application, the first color value can be the color value corresponding to white, and the second color value can be the color value corresponding to black. Alternatively, the first color value can be the color value corresponding to black, and the second color value can be the color value corresponding to white. Since white and black only require a single-channel image to display in an image, but if the colors corresponding to the first and / or second color values ​​are colors other than black and white, then to display these other colors, a first image containing three channels, such as an RGB image, needs to be generated. This increases the amount of data in the first image, thereby increasing the amount of data that needs to be analyzed during subsequent data analysis. Furthermore, the additional color information reduces the signal-to-noise ratio of the first image representing financial data.

[0110] S103: Based on the generated image, perform data analysis on the aforementioned target financial product.

[0111] In one embodiment of this application, the above data analysis may include analyzing the price fluctuations and trading activity of the target financial product, or predicting future trading and / or price fluctuations of the target financial product.

[0112] Algorithms and models from relevant technologies can be used to conduct data analysis on target financial products.

[0113] As can be seen from the above, in this embodiment, a first image can be generated based on the first candlestick data sequence of the target financial product. The color values ​​of the pixels in the first image can represent various data recorded in the first candlestick data sequence. In other words, this application can integrate the information recorded in the large amount of first candlestick data sequence into a single first image. Subsequently, the data analysis process of the financial product can be completed by processing a single first image, saving the computational resources required for subsequent data analysis. Furthermore, the first image only contains pixels with color values ​​of either the first or second color value. The color information of the image is relatively simple, and it does not introduce a large amount of noise due to complex pixel colors. Therefore, the signal-to-noise ratio of the first image is high, which is beneficial to improving the accuracy and efficiency of subsequent data analysis.

[0114] In another embodiment of this application, step S103 can be achieved by step A.

[0115] Step A: Input the generated image into the image analysis model to obtain the data analysis results of the target financial product output by the image analysis model.

[0116] The image analysis model described above includes convolutional layers, which contain convolutional filters with different gradient scales.

[0117] Because the convolutional layers contain convolutional filters with different gradient scales, the image analysis model used in this embodiment can extract image information from image regions of different sizes in the first image, thereby extracting multi-scale correlations in the first image. For example, these correlations include "no change," "slight increase," "significant increase," "bottom reversal," and "high-level collapse" in the price and / or trading volume of the target financial product. This improves the accuracy of the output data analysis results.

[0118] In another embodiment of this application, a data processing flow of the above-mentioned image analysis model is as follows: The generated image is input into a patch embedding layer. After processing the output of the patch embedding layer using an activation function and a normalization layer, residual information is obtained. The residual information is then input into a channel convolutional layer for convolution processing, and the channel convolutional layer outputs a first convolution processing result. After processing the first convolution processing result using an activation function and a normalization layer, a first normalized result is obtained. The first normalized result is input into a one-dimensional convolutional layer, and the one-dimensional convolutional layer outputs a second convolution processing result. After processing the second convolution processing result using an activation function and a normalization layer, a second normalized result is obtained. The second normalized result is fused with the aforementioned residual information and input into a global pooling layer to obtain a pooling result. The pooling result is input into a multi-head attention layer to obtain an output result. This output result is then input into a fully connected layer and an activation function, i.e., the output result is first input into a fully connected layer, and then the output result of the fully connected layer is input into an activation function to obtain the data analysis result output by the activation function. The activation function can be a sigmoid function. The aforementioned channel convolutional layers and one-dimensional convolutional layers contain convolutional filters with different gradient scales to extract multi-scale relationships in the image. They also utilize an attention mechanism to dynamically assign different weights to different convolutional filter information.

[0119] See Figure 2 This is a schematic diagram of the processing flow of an image analysis model provided in an embodiment of this application.

[0120] The specific processing procedure is the same as described above, and will not be repeated here.

[0121] In another embodiment of this application, step S101 described above can be implemented by step B.

[0122] Step B: Obtain multiple first candlestick data sequences of the target financial product.

[0123] The duration of the first time period corresponding to different first candlestick data sequences is different, but the number of data items contained in each first candlestick data sequence is the same. The same number of data items ensures that the number of first time periods corresponding to each first candlestick data sequence is the same. Therefore, the number of first pixel columns corresponding to each first candlestick data sequence is the same, and the financial data contained in each first candlestick data sequence can be integrated into the same first image. The number of first pixel columns in this first image is the same as the number of data items contained in each first candlestick data sequence.

[0124] In this case, the grayscale values ​​of the pixels in the first part of the first image are set differently based on different first candlestick data sequences. The color values ​​of the pixels in the second and third parts are set based on the first candlestick data sequence corresponding to the shortest first time period.

[0125] In one embodiment, the grayscale values ​​corresponding to each first K-line data sequence can be decreased or increased according to a first preset step size, in ascending order of the duration of the corresponding first time period.

[0126] For each first K-line data sequence, the method of setting the color value of the first part in the first image based on the first K-line data sequence can be found in step S102 above, and will not be repeated here.

[0127] Furthermore, in cases where the first color value corresponds to white and the second color value corresponds to black, or vice versa, since different first candlestick data sequences correspond to different grayscale values, different first candlestick data sequences can be represented by a single-channel image. Therefore, different first candlestick data sequences can still be integrated into a single-channel first image, resulting in a lower data volume for the first image.

[0128] See Figure 3 This is a schematic diagram of a first image provided in an embodiment of this application.

[0129] The diagram, from bottom to top, represents Part 1, Part 2, and Part 3. Each square in the diagram represents a pixel. Part 1 is below the bottom left horizontal line, Part 2 is between the two horizontal lines, and Part 3 is above the top horizontal line. The horizontal lines are only used to distinguish different parts of the first image and are not included within the first image itself. Part 1 contains pixels set to white based on one first candlestick data sequence and pixels set to gray based on another. Other unconfigured pixels are black. The absence of white or gray pixels in some first pixel columns within Part 1 indicates missing data in the first candlestick data sequence due to trading halts or data acquisition failures. In Part 2, pixels with configured color values ​​are white, and unconfigured pixels are black. In Part 3, pixels with configured color values ​​are white, and unconfigured pixels are black.

[0130] As can be seen from the above, in one embodiment of this application, pixels with different grayscale values ​​in the first part of the first image can represent multiple different first K-line data sequences collected from the target financial product according to different first time periods. That is, multiple first K-line data sequences can be integrated into a single first image. This results in a higher information content and a higher signal-to-noise ratio in the financial data contained in the first image. In other words, this application can represent a large amount of financial data with a single first image, further reducing the computational load required for subsequent data analysis.

[0131] See Figure 4 This is a flowchart illustrating the second financial product K-line sequence data analysis method provided in this application embodiment, which is consistent with the aforementioned Figure 1 Compared to the embodiment shown, the steps S104-S105 are included before the aforementioned step S103.

[0132] S104: Obtain the second candlestick data sequence of the target financial product.

[0133] The second K-line data sequence includes the highest price, lowest price, opening price, closing price, and trading volume of the target financial product in each second time period. The duration of the second time period is shorter than the duration of the first time period.

[0134] S105: Generate a second image based on the above second K-line data sequence.

[0135] The second image mentioned above includes a fourth part, a fifth part, and a sixth part.

[0136] Each second pixel column in the second image above corresponds to a second time period, each fourth pixel row in the fourth part above corresponds to a price value, the difference between the price values ​​corresponding to adjacent fourth pixel rows is a fourth preset value, and within each second pixel column, the color value of the pixel in the fourth pixel row corresponding to the highest and lowest prices in the second time period corresponding to that second pixel column is set to a third color value.

[0137] Each fifth pixel row in the fifth part above corresponds to a price value, and the difference between the price values ​​corresponding to adjacent fifth pixel rows is the fifth preset value. In each second pixel column, the color value of the pixels between the fifth pixel rows corresponding to the opening price and closing price in the second time period of the second pixel column is set to the third color value.

[0138] Each sixth pixel row in the sixth part above corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent sixth pixel rows is the sixth preset value. Within each second pixel column, the color values ​​of the pixels between the sixth pixel row corresponding to the transaction volume in the second time period and the sixth pixel row corresponding to the second preset minimum transaction volume are all set to the third color value.

[0139] The color value of the unset pixels in the second image is the fourth color value, and the third color value is different from the fourth color value.

[0140] As mentioned above Figure 1Compared to steps S101-S102, the difference between steps S104-S105 is that the duration of the second time period corresponding to the second K-line data sequence used to generate the second image is shorter than the duration of the first time period corresponding to the first K-line data sequence used to generate the first image. In other words, the second K-line data sequence can represent the micro-level changes of the target financial product over a shorter period.

[0141] For example, the duration of the first time period is one day, and the duration of the second time period is 60 minutes, 15 minutes, 5 minutes or 1 minute, etc., which can be selected according to actual needs.

[0142] Apart from that, the generation method of the second image is similar to that of the first image, and will not be repeated here. Compared with the first image, the second image can represent the rapid changes in the data of the target financial product within a short period of time.

[0143] As can be seen from the above, in this embodiment, a second image can be generated based on the second candlestick data sequence of the target financial product. The color values ​​of the pixels in the second image can represent various data recorded in the second candlestick data sequence. In other words, this application can integrate the information recorded in the large amount of second candlestick data sequence into a single second image. Subsequent processing of this second image is sufficient to complete the data analysis of the target financial product, saving computational resources required for subsequent data analysis. Furthermore, the second image only contains pixels with third or fourth color values, resulting in simpler color information and avoiding the introduction of significant noise due to complex pixel colors. Therefore, the second image has a high signal-to-noise ratio, which is beneficial for improving the accuracy and efficiency of subsequent data analysis. Compared to the first image, the second image is generated based on the second candlestick data sequence with a shorter acquisition period, enabling the second image to reflect the rapid changes of the target financial product within a short timeframe. Combined with the first image, it provides rich information and improves the accuracy of the data results obtained from subsequent data processing.

[0144] In one embodiment of this application, step S104 described above can be implemented by step C.

[0145] Step C: Obtain multiple second candlestick data sequences of the target financial product. The duration of the second time period corresponding to different second candlestick data sequences is different, and the number of data items contained in each second candlestick data sequence is the same.

[0146] Based on the fact that the grayscale values ​​of the pixels in the fourth part of the second image are set differently for different second K-line data sequences, the color values ​​of the pixels in the fifth and sixth parts are set based on the second K-line data sequence corresponding to the second time period with the longest duration.

[0147] For example, each second candlestick data sequence contains data generated by the target financial product within a single day. For instance, one second candlestick data sequence contains data generated by the target financial product every 60 minutes within a day, another contains data generated every 15 minutes, another contains data generated every 5 minutes, and yet another contains data generated every 1 minute. When setting the color values ​​of the pixels in the fourth part, the grayscale values ​​corresponding to different second candlestick data sequences are different. For example, according to the order of the second time period corresponding to each second candlestick data sequence from longest to shortest, the grayscale values ​​corresponding to each second candlestick data sequence increase or decrease sequentially.

[0148] Specifically, in this embodiment, the method of generating the second image is similar to the method of generating the first image described in step B above, and will not be repeated here.

[0149] As can be seen from the above, in one embodiment of this application, pixels with different grayscale values ​​in the fourth part of the second image can represent multiple different second K-line data sequences collected from the target financial product according to different second time periods. That is, multiple second K-line data sequences can be integrated into a single second image. This results in a higher information content and a higher signal-to-noise ratio in the second image. In other words, this application can represent a large amount of financial data with a single second image, further reducing the computational load required for subsequent data analysis.

[0150] See Figure 5 This is a flowchart illustrating the third financial product K-line sequence data analysis method provided in this application embodiment, which is consistent with the aforementioned Figure 1 Compared to the embodiment shown, the steps S106-S107 are included before step S103 described above.

[0151] S106: Obtain the third data sequence of the trading market for the aforementioned target financial products.

[0152] The aforementioned third data sequence includes transaction indicator data for each of the aforementioned transaction durations within each third time period.

[0153] Specifically, the aforementioned trading indicator data may include at least one of the following: the volume and price of the broad-based index of the market in which the target financial product is located, the volume and price of the market style index, and the volume and price of the industry index of the sector in which the target financial product is located.

[0154] S107: Generate a third image based on the aforementioned third data sequence.

[0155] In the third image, each second pixel column corresponds to a third time period, each seventh pixel row corresponds to a transaction indicator data value, the difference between the transaction indicator data values ​​corresponding to adjacent seventh pixel rows is a seventh preset value, and within each third pixel column, the color value of the pixel in the third pixel row corresponding to the transaction indicator data in the third time period is set to a fifth color value.

[0156] The color value of the unset pixels in the second image is the sixth color value, and the fifth color value is different from the sixth color value.

[0157] In one embodiment of this application, the size of the third image is (m, n). Therefore, the original collected trading indicator data can be proportionally scaled to integers within the range of (0, n-1) to obtain a third data sequence. The minimum value of the scaled trading indicator data is 0, and the maximum value is n-1. Thus, the upper and lower ends of the third image generated based on this third data sequence do not contain third pixel rows where all pixels have the sixth color value, thereby reducing the size of the third image.

[0158] In another embodiment of this application, the colors corresponding to the fifth and sixth pixel values ​​are white and black, respectively. In this case, the generated third image may contain only one channel, thereby reducing the data size of the third image.

[0159] If the third data sequence contains one type of trading indicator data, the color value of the pixel at the corresponding position is set to the fifth color value based on the third data sequence. If the third data sequence contains multiple types of trading indicator data, and each type of data in the third data sequence corresponds to a different grayscale value, then in addition to setting the color value of the pixel at the corresponding position to the fifth color value based on one type of data in the third data sequence, the grayscale value of the pixel is also set to the grayscale value corresponding to that type of data, thereby distinguishing different data in the third image.

[0160] As can be seen from the above, the third image generated in this embodiment can represent the fluctuations of trading indicators in the trading market over time, and a single third image can represent the macro-level information of the entire trading market. This allows subsequent data processing to be completed using only a third image with a relatively small data volume, thereby reducing the computational resources required for data processing.

[0161] In this embodiment, multiple images are generated, including a first image, a second image, and a third image. Since the pixels in each image are all black, white, or gray, each image is a single-channel image. Even if three images are generated, only three channels need to be processed subsequently, resulting in a relatively small data volume. In one embodiment of this application, multiple images can be input as different channels into an image analysis model for joint processing. If the first, second, and third images are all generated, the three-channel image can concisely embed a large amount of multi-dimensional spatiotemporal information about the target financial product, such as price and volume changes, candlestick patterns, market trends, and intraday fluctuations. This effectively improves the signal-to-noise ratio and storage efficiency of the final generated image, thereby reducing the computational burden on subsequent data analysis.

[0162] Corresponding to the aforementioned method for analyzing K-line sequence data of financial products, this application also provides a device for analyzing K-line sequence data of financial products.

[0163] See Figure 6 This is a schematic diagram of a financial product candlestick chart data analysis device provided in an embodiment of this application. The device includes:

[0164] The first sequence acquisition module 601 is used to acquire the first K-line data sequence of the target financial product, wherein the first K-line data sequence includes the highest price, lowest price, opening price, closing price, and trading volume of the target financial product in each first time period.

[0165] The first image generation module 602 is used to generate a first image based on the first K-line data sequence, the first image including a first part, a second part and a third part;

[0166] Each first pixel column in the first image corresponds to a first time period, each first pixel row in the first part corresponds to a price value, the difference between the price values ​​corresponding to adjacent first pixel rows is a first preset value, and within each first pixel column, the color value of the pixel in the first pixel row corresponding to the highest price and the lowest price in the first time period corresponding to the first pixel column is set to a first color value.

[0167] Each second pixel row in the second part corresponds to a price value, and the difference between the price values ​​corresponding to adjacent second pixel rows is a second preset value. In each first pixel column, the color values ​​of the pixels between the second pixel rows corresponding to the opening price and the closing price in the first time period corresponding to the first pixel column are all set to the first color value.

[0168] Each third pixel row in the third part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent third pixel rows is a third preset value. In each first pixel column, the color values ​​of the pixels between the third pixel row corresponding to the transaction volume in the first time period and the third pixel row corresponding to the first preset minimum transaction volume are all set to the first color value.

[0169] The color value of the unset pixels in the first image is the second color value, and the first color value is different from the second color value;

[0170] The data analysis module 603 is used to perform data analysis on the target financial product based on the generated image.

[0171] As can be seen from the above, in this embodiment, a first image can be generated based on the first candlestick data sequence of the target financial product. The color values ​​of the pixels in the first image can represent various data recorded in the first candlestick data sequence. In other words, this application can integrate the information recorded in the large amount of first candlestick data sequence into a single first image. Subsequently, the data analysis process of the financial product can be completed by processing a single first image, saving the computational resources required for subsequent data analysis. Furthermore, the first image only contains pixels with color values ​​of either the first or second color value. The color information of the image is relatively simple, and it does not introduce a large amount of noise due to complex pixel colors. Therefore, the signal-to-noise ratio of the first image is high, which is beneficial to improving the accuracy and efficiency of subsequent data analysis.

[0172] In one embodiment of this application, the apparatus further includes:

[0173] The second sequence acquisition module is used to acquire the second K-line data sequence of the target financial product, wherein the second K-line data sequence includes the highest price, lowest price, opening price, closing price and trading volume of the target financial product in each second time period, and the duration of the second time period is shorter than the duration of the first time period.

[0174] The second image generation module is used to generate a second image based on the second K-line data sequence. The second image includes a fourth part, a fifth part, and a sixth part.

[0175] Each second pixel column in the second image corresponds to a second time period, each fourth pixel row in the fourth part corresponds to a price value, the difference between the price values ​​corresponding to adjacent fourth pixel rows is a fourth preset value, and within each second pixel column, the color value of the pixel in the fourth pixel row corresponding to the highest and lowest prices in the second time period corresponding to that second pixel column is set to a third color value.

[0176] Each fifth pixel row in the fifth part corresponds to a price value, and the difference between the price values ​​corresponding to adjacent fifth pixel rows is a fifth preset value. In each second pixel column, the color values ​​of the pixels between the fifth pixel rows corresponding to the opening price and the closing price in the second time period corresponding to the second pixel column are all set to the third color value.

[0177] Each sixth pixel row in the sixth part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent sixth pixel rows is the sixth preset value. In each second pixel column, the color values ​​of the pixels between the sixth pixel row corresponding to the transaction volume in the second time period and the sixth pixel row corresponding to the second preset minimum transaction volume are all set to the third color value.

[0178] The color value of the unset pixels in the second image is the fourth color value, and the third color value is different from the fourth color value.

[0179] As can be seen from the above, in this embodiment, a second image can be generated based on the second candlestick data sequence of the target financial product. The color values ​​of the pixels in the second image can represent various data recorded in the second candlestick data sequence. In other words, this application can integrate the information recorded in the large amount of second candlestick data sequence into a single second image. Subsequent processing of this second image is sufficient to complete the data analysis of the target financial product, saving computational resources required for subsequent data analysis. Furthermore, the second image only contains pixels with third or fourth color values, resulting in simpler color information and avoiding the introduction of significant noise due to complex pixel colors. Therefore, the second image has a high signal-to-noise ratio, which is beneficial for improving the accuracy and efficiency of subsequent data analysis. Compared to the first image, the second image is generated based on the second candlestick data sequence with a shorter acquisition period, enabling the second image to reflect the rapid changes of the target financial product within a short timeframe. Combined with the first image, it provides rich information and improves the accuracy of the data results obtained from subsequent data processing.

[0180] In one embodiment of this application, the apparatus further includes:

[0181] The third sequence acquisition module is used to acquire the third data sequence of the trading market for the target financial product, wherein the third data sequence includes trading indicator data of the trading duration in each third time period.

[0182] The third image generation module is used to generate a third image based on the third data sequence;

[0183] In the third image, each second pixel column corresponds to a third time period, each seventh pixel row corresponds to a transaction indicator data value, the difference between the transaction indicator data values ​​corresponding to adjacent seventh pixel rows is a seventh preset value, and within each third pixel column, the color value of the pixel in the third pixel row corresponding to the transaction indicator data in the third time period is set to a fifth color value.

[0184] The color value of the unset pixels in the second image is the sixth color value, and the fifth color value is different from the sixth color value.

[0185] As can be seen from the above, the third image generated in this embodiment can represent the fluctuations of trading indicators in the trading market over time, and a single third image can represent the macro-level information of the entire trading market. This allows subsequent data processing to be completed using only a third image with a relatively small data volume, thereby reducing the computational resources required for data processing.

[0186] In one embodiment of this application, the first sequence acquisition module 601 is specifically used for:

[0187] Obtain multiple first candlestick data sequences of the target financial product. The duration of the first time period corresponding to different first candlestick data sequences is different, and the number of data items contained in each first candlestick data sequence is the same.

[0188] The grayscale values ​​of pixels in the first part of the first image are set differently based on different first K-line data sequences; the color values ​​of pixels in the second and third parts are set based on the first K-line data sequence corresponding to the shortest first time period.

[0189] As can be seen from the above, in one embodiment of this application, pixels with different grayscale values ​​in the first part of the first image can represent multiple different first K-line data sequences collected from the target financial product according to different first time periods. That is, multiple first K-line data sequences can be integrated into a single first image. This results in a higher information content and a higher signal-to-noise ratio in the financial data contained in the first image. In other words, this application can represent a large amount of financial data with a single first image, further reducing the computational load required for subsequent data analysis.

[0190] In one embodiment of this application, the second sequence acquisition module is specifically used for:

[0191] Obtain multiple second candlestick data sequences of the target financial product. The duration of the second time period corresponding to different second candlestick data sequences is different, and the number of data items contained in each second candlestick data sequence is the same.

[0192] Based on the fact that the grayscale values ​​of the pixels in the fourth part of the second image are set differently according to different second K-line data sequences, the color values ​​of the pixels in the fifth and sixth parts are set according to the second K-line data sequence corresponding to the second time period with the longest duration.

[0193] As can be seen from the above, in one embodiment of this application, pixels with different grayscale values ​​in the fourth part of the second image can represent multiple different second K-line data sequences collected from the target financial product according to different second time periods. That is, multiple second K-line data sequences can be integrated into a single second image. This results in a higher information content and a higher signal-to-noise ratio in the second image. In other words, this application can represent a large amount of financial data with a single second image, further reducing the computational load required for subsequent data analysis.

[0194] In one embodiment of this application, the data analysis module 603 is specifically used for:

[0195] The generated image is input into an image analysis model to obtain the data analysis results of the target financial product output by the image analysis model. The image analysis model contains convolutional layers, and the convolutional layers contain convolutional filters with different gradient scales.

[0196] Because the convolutional layers contain convolutional filters with different gradient scales, the image analysis model used in this embodiment can extract image information from image regions of different sizes in the first image, thereby extracting multi-scale correlations in the first image. For example, these correlations include "no change," "slight increase," "significant increase," "bottom reversal," and "high-level collapse" in the price and / or trading volume of the target financial product. This improves the accuracy of the output data analysis results.

[0197] This application also provides an electronic device, such as... Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.

[0198] Memory 703 is used to store computer programs;

[0199] The processor 701, when executing the program stored in the memory 703, implements the K-line sequence data analysis method for any financial product in the embodiments of this application.

[0200] When performing K-line sequence data analysis of financial products using the electronic device provided in this application embodiment, a first image can be generated based on the first K-line data sequence of the target financial product. The color values ​​of the pixels in the first image can represent various data recorded in the first K-line data sequence. In other words, this application can integrate the information recorded in the large amount of data in the first K-line data sequence into a single first image. Subsequently, the data analysis process of the financial product can be completed by processing a single first image, saving the computing resources required for subsequent data analysis. Furthermore, the first image only contains pixels with color values ​​of either the first color value or the second color value. The color information of the image is relatively simple, and it does not introduce a large amount of noise due to complex pixel colors. Therefore, the signal-to-noise ratio of the first image is high, which is beneficial to improving the accuracy and efficiency of subsequent data analysis.

[0201] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0202] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0203] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0204] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0205] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described financial product K-line sequence data analysis method.

[0206] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the financial product K-line sequence data analysis methods in the above embodiments.

[0207] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0208] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0209] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0210] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A method for analyzing candlestick chart data of financial products, characterized in that, The method includes: Obtain the first candlestick data sequence of the target financial product, wherein the first candlestick data sequence includes the highest price, lowest price, opening price, closing price, and trading volume of the target financial product in each first time period; Based on the first K-line data sequence, a first image is generated, the first image including a first part, a second part and a third part that do not overlap; Each first pixel column in the first image corresponds to a first time period, each first pixel row in the first part corresponds to a price value, the difference between the price values ​​corresponding to adjacent first pixel rows is a first preset value, and within each first pixel column, the color value of the pixel in the first pixel row corresponding to the highest price and the lowest price in the first time period corresponding to the first pixel column is set to a first color value. Each second pixel row in the second part corresponds to a price value. The difference between the price values ​​of adjacent second pixel rows is a second preset value. For each first time period, the minimum value between the original opening price and closing price collected for the first time period is subtracted to obtain the updated opening price and closing price. The updated opening price and closing price for each first time period are scaled to an integer value between 0 and a first value. The price value of the second pixel row at the bottom of the second part is 0, and the price value of the second pixel row at the top is the first value. The first value is the number of second pixel rows in the second part minus 1. In each first pixel column, the color value of the pixels between the second pixel rows corresponding to the scaled opening price and the scaled closing price in the first time period corresponding to the first pixel column is set to the first color value. Each third pixel row in the third part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent third pixel rows is a third preset value. In each first pixel column, the color values ​​of the pixels between the third pixel row corresponding to the transaction volume in the first time period and the third pixel row corresponding to the first preset minimum transaction volume are all set to the first color value. The color value of the unset pixel in the first image is the second color value. The first color value is different from the second color value. The first color value is the color value corresponding to white and the second color value is the color value corresponding to black, or the first color value is the color value corresponding to black and the second color value is the color value corresponding to white. The first image is a single-channel image. The generated image is input into an image analysis model to obtain the data analysis results of the target financial product output by the image analysis model. The image analysis model contains convolutional layers, and the convolutional layers contain convolutional filters with different gradient scales.

2. The method according to claim 1, characterized in that, Before performing data analysis on the target financial product based on the generated image, the method further includes: Obtain the second candlestick data sequence of the target financial product, wherein the second candlestick data sequence includes the highest price, lowest price, opening price, closing price, and trading volume of the target financial product in each second time period, and the duration of the second time period is shorter than the duration of the first time period; Based on the second candlestick data sequence, a second image is generated, which includes a fourth part, a fifth part, and a sixth part. Each second pixel column in the second image corresponds to a second time period, each fourth pixel row in the fourth part corresponds to a price value, the difference between the price values ​​corresponding to adjacent fourth pixel rows is a fourth preset value, and within each second pixel column, the color value of the pixel in the fourth pixel row corresponding to the highest and lowest prices in the second time period corresponding to that second pixel column is set to a third color value. Each fifth pixel row in the fifth part corresponds to a price value, and the difference between the price values ​​corresponding to adjacent fifth pixel rows is a fifth preset value. In each second pixel column, the color values ​​of the pixels between the fifth pixel rows corresponding to the opening price and the closing price in the second time period corresponding to the second pixel column are all set to the third color value. Each sixth pixel row in the sixth part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent sixth pixel rows is the sixth preset value. In each second pixel column, the color values ​​of the pixels between the sixth pixel row corresponding to the transaction volume in the second time period and the sixth pixel row corresponding to the second preset minimum transaction volume are all set to the third color value. The color value of the unset pixels in the second image is the fourth color value, and the third color value is different from the fourth color value.

3. The method according to claim 1, characterized in that, Before performing data analysis on the target financial product based on the generated image, the method further includes: Obtain a third data sequence of the trading market for the target financial product, wherein the third data sequence includes trading indicator data for the trading duration within each third time period; Based on the third data sequence, a third image is generated; In the third image, each second pixel column corresponds to a third time period, each seventh pixel row corresponds to a transaction indicator data value, the difference between the transaction indicator data values ​​corresponding to adjacent seventh pixel rows is a seventh preset value, and within each third pixel column, the color value of the pixel in the third pixel row corresponding to the transaction indicator data in the third time period is set to a fifth color value. The color value of the unset pixels in the third image is the sixth color value, and the fifth color value is different from the sixth color value.

4. The method according to claim 1, characterized in that, The acquisition of the first candlestick data sequence of the target financial product includes: Obtain multiple first candlestick data sequences of the target financial product. The duration of the first time period corresponding to different first candlestick data sequences is different, and the number of data items contained in each first candlestick data sequence is the same. The grayscale values ​​of pixels in the first part of the first image are set differently based on different first K-line data sequences; the color values ​​of pixels in the second and third parts are set based on the first K-line data sequence corresponding to the shortest first time period.

5. The method according to claim 2, characterized in that, The acquisition of the second candlestick data sequence of the target financial product includes: Obtain multiple second candlestick data sequences of the target financial product. The duration of the second time period corresponding to different second candlestick data sequences is different, and the number of data items contained in each second candlestick data sequence is the same. Based on the fact that the grayscale values ​​of the pixels in the fourth part of the second image are set differently according to different second K-line data sequences, the color values ​​of the pixels in the fifth and sixth parts are set according to the second K-line data sequence corresponding to the second time period with the longest duration.

6. A device for analyzing candlestick chart data of financial products, characterized in that, The device includes: The first sequence acquisition module is used to acquire the first K-line data sequence of the target financial product, wherein the first K-line data sequence includes the highest price, lowest price, opening price, closing price and trading volume of the target financial product in each first time period; The first image generation module is used to generate a first image based on the first K-line data sequence. The first image includes a first part, a second part, and a third part that do not overlap with each other. Each first pixel column in the first image corresponds to a first time period, each first pixel row in the first part corresponds to a price value, the difference between the price values ​​corresponding to adjacent first pixel rows is a first preset value, and within each first pixel column, the color value of the pixel in the first pixel row corresponding to the highest price and the lowest price in the first time period corresponding to the first pixel column is set to a first color value. Each second pixel row in the second part corresponds to a price value. The difference between the price values ​​of adjacent second pixel rows is a second preset value. For each first time period, the minimum value between the original opening price and closing price collected for the first time period is subtracted to obtain the updated opening price and closing price. The updated opening price and closing price for each first time period are scaled to an integer value between 0 and a first value. The price value of the second pixel row at the bottom of the second part is 0, and the price value of the second pixel row at the top is the first value. The first value is the number of second pixel rows in the second part minus 1. In each first pixel column, the color value of the pixels between the second pixel rows corresponding to the scaled opening price and the scaled closing price in the first time period corresponding to the first pixel column is set to the first color value. Each third pixel row in the third part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent third pixel rows is a third preset value. In each first pixel column, the color values ​​of the pixels between the third pixel row corresponding to the transaction volume in the first time period and the third pixel row corresponding to the first preset minimum transaction volume are all set to the first color value. The color value of the unset pixel in the first image is the second color value. The first color value is different from the second color value. The first color value is the color value corresponding to white and the second color value is the color value corresponding to black, or the first color value is the color value corresponding to black and the second color value is the color value corresponding to white. The first image is a single-channel image. The data analysis module is used to input the generated image into the image analysis model to obtain the data analysis results of the target financial product output by the image analysis model. The image analysis model contains convolutional layers, and the convolutional layers contain convolutional filters with different gradient scales.

7. The apparatus according to claim 6, characterized in that, The device further includes: The second sequence acquisition module is used to acquire the second K-line data sequence of the target financial product, wherein the second K-line data sequence includes the highest price, lowest price, opening price, closing price and trading volume of the target financial product in each second time period, and the duration of the second time period is shorter than the duration of the first time period. The second image generation module is used to generate a second image based on the second K-line data sequence. The second image includes a fourth part, a fifth part, and a sixth part. Each second pixel column in the second image corresponds to a second time period, each fourth pixel row in the fourth part corresponds to a price value, the difference between the price values ​​corresponding to adjacent fourth pixel rows is a fourth preset value, and within each second pixel column, the color value of the pixel in the fourth pixel row corresponding to the highest and lowest prices in the second time period corresponding to that second pixel column is set to a third color value. Each fifth pixel row in the fifth part corresponds to a price value, and the difference between the price values ​​corresponding to adjacent fifth pixel rows is a fifth preset value. In each second pixel column, the color values ​​of the pixels between the fifth pixel rows corresponding to the opening price and the closing price in the second time period corresponding to the second pixel column are all set to the third color value. Each sixth pixel row in the sixth part corresponds to a transaction volume value. The difference between the transaction volume values ​​corresponding to adjacent sixth pixel rows is the sixth preset value. In each second pixel column, the color values ​​of the pixels between the sixth pixel row corresponding to the transaction volume in the second time period and the sixth pixel row corresponding to the second preset minimum transaction volume are all set to the third color value. The color value of the unset pixels in the second image is the fourth color value, and the third color value is different from the fourth color value.

8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method steps of any one of claims 1-5.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method steps of any one of claims 1-5.