Coding algorithm for price or index change with high-compression and lossless quantization

By employing a high-compression lossless quantization encoding algorithm, the problems of large space occupation and insufficient data quantization in traditional candlestick charts when expressing financial data are solved, enabling efficient data querying and analysis, and supporting big data and artificial intelligence applications.

WO2024192610A1PCT designated stage expired Publication Date: 2024-09-26DING NING
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/082412
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-20
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

Traditional candlestick charts suffer from problems such as excessive space usage, insufficient data quantification, and difficulty in querying and analyzing when expressing changes in the prices and indices of financial products.

Method used

It employs a highly compressed lossless quantization encoding algorithm, which combines encoding units and indicator items to describe price or index changes using combinations of letters, characters, and special characters, and supports regular expression parsing and big data analysis.

Benefits of technology

It achieves high data compression and lossless quantization, simplifies data length, improves data readability and query analysis efficiency, and supports big data and artificial intelligence applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023082412_26092024_PF_FP
    Figure CN2023082412_26092024_PF_FP
Patent Text Reader

Abstract

Disclosed in the present invention is a coding algorithm for a price or index change of a financial product with high-compression and lossless quantization. Coding of a price or index change within a certain time period comprises a plurality of code units, each code unit indicates a price or index change in a unit time period within the time period, each code unit comprises a plurality of indicator items, each indicator item indicates a price or index change percentage of a specific indicator, and a coding algorithm is uniformly defined for the indicator items: when a transaction is suspended, the code is equal to "-"; when the indicator item is equal to 0, the code is equal to "0"; when the indicator item is equal to an integer multiple of +10%, the code is equal to " integer multiple + Z"; when the indicator item is equal to an integer multiple of -10%, the code is equal to " integer multiple + z"; and when the indicator item is equal to neither 0 nor an integer multiple of ±10%, the code is equal to " prefix + letter", wherein the prefix is the integer-only portion of the result obtained after the absolute value of the indicator item is divided by 10%, the letter is one of 50 letters, namely, "A-Y and a-y", and the letter is determined according to a rise / fall interval of the indicator item.
Need to check novelty before this filing date? Find Prior Art

Description

A high compression lossless encoding algorithm for quantized price or index changes Technical Field

[0001] The present invention belongs to the field of financial industry data analysis, and specifically relates to a high-compression lossless coding algorithm for quantifying price or index changes. Background Art

[0002] As living standards improve, my country's financial products are experiencing a boom in development. As of 2022, there are as many as 4,600 stocks listed on the Shanghai and Shanghai stock exchanges, with a total market capitalization approaching 100 trillion yuan. The number of stock investors nationwide has exceeded 200 million, resulting in a vast expanse of financial data and information. This has led to a significant development of online media and the financial industry. K-line charts are often used to illustrate price trends in financial assets. K-line charts were first developed by a Japanese grain merchant named Homma Munehisa during the Tokugawa shogunate to predict rice prices, a practice with a history of over 300 years. While K-line charts are highly intuitive in displaying price and index changes in financial products, they have achieved significant success. However, graphical representations also suffer from limitations such as excessive space usage, insufficient data quantification, and difficulty in querying and analyzing.

[0003] This invention uses a novel combination of numbers, letters, and characters to describe price or index changes. The advantages of this encoding algorithm lie in its high compression and lossless quantization of trend expression. Financial data can be parsed, queried, counted, calculated, analyzed, and trend-forecasted directly or with the aid of tools such as regular expressions, potentially enabling the development of various big data and artificial intelligence products. Furthermore, through color and staggered display, changes in the benchmark can be visually displayed, facilitating easy reading. Given the current vast volume of financial data, this encoding algorithm has significant and long-term potential for widespread adoption.

[0004] Summary of the Invention

[0005] Currently, the scale of financial data and financial information is growing. Traditional K-line charts occupy a large space, have insufficient data quantification, and lack query and analysis methods. This paper has invented a high-compression and lossless coding algorithm for quantifying the price or index changes of financial products.

[0006] The object of the present invention is achieved through the following technical solution: the price or index change code within a certain period includes multiple coding units, the coding unit is the price or index change of the unit period within the period, each coding unit includes multiple index items, the index item is the price or index change percentage of a specific index, that is, ±p m …p2p1.q1q2…q n % indicates that a unified coding algorithm is defined for the indicator items: when in the suspended trading state, the indicator item is equal to "-", when ±p m …p2p1.q1q2…q n %=0, the index item is equal to "0", when ±pm …p2p1.q1q2…q n %=+10% integer multiple, the index item is equal to "integer multiple + Z", when ±p m …p2p1.q1q2…q n %=-10% integer multiple, the index item is equal to "integer multiple + z", when ±p m …p2p1.q1q2…q n When %≠0 or an integer multiple of ±10%, the indicator item is equal to "prefix + letter", where the prefix is ​​equal to ±p m …p2p1.q1q2…q n The integer obtained by dividing the absolute value of % by 10% by taking only the integer part. When the integer is 0, the prefix should be omitted. The letter is equal to one of the 50 letters "AY" or "ay". The 25 uppercase letters of "AY" divide the interval (0%, 10%) into 25 rising intervals, and the 25 lowercase letters of "ay" divide the interval (0%, -10%) into 25 falling intervals. Take ±p m …p2p1.q1q2…q n The data of the sign, units place and decimal part of %, i.e. ±p1.q1q2…q n %, and the corresponding letter is determined according to the rise and fall range of the data.

[0007] Furthermore, the indicator item, when ±p m …p2p1.q1q2…q n When %≠0 and the integer multiple of ±10%, special characters can be added to improve the accuracy. The indicator item = "prefix + letter + special character", where the special character is equal to one of the 4 special characters "; <=>". The special characters are combined with the 50 letters "AY, ay" in pairs, and the (-10%, 10%) interval is further divided into 200 equally divided increase and decrease intervals. Take ±p m …p2p1.q1q2…q n The data of the sign, units place and decimal part of %, that is, ±p1.q1q2…qn%, determines the corresponding "letter + special character" combination according to the rise and fall range of the data.

[0008] Furthermore, the indicator item, when ±p m …p2p1.q1q2…q n When %≠0 or the integer multiple of ±10%, a suffix can be added to improve the accuracy, that is, the indicator item = "prefix + letter + suffix + special character", where the suffix is ​​equal to ±p m …p2p1.q1q2…q n The percentile and the decimal part after it, i.e. q2…q n , which can be omitted when the suffix is ​​0.

[0009] Furthermore, the special character can also use the Chinese Pinyin tone symbol "ˉˊˇˋ", and the four tone symbols "ˉˊˇˋ" are combined in pairs with the 50 letters "AY, ay", dividing the (-10%, 10%) interval into 200 rise and fall intervals, and 1 letter and 1 Chinese Pinyin tone symbol are combined to form a new character.

[0010] Furthermore, the letters or characters "AZ", "az", "0", and "-" may also be represented by letters or characters of any other type or number.

[0011] Furthermore, the four special characters “;<=>” may also be represented by letters or characters of any other type or number.

[0012] Furthermore, the coding units may be arranged in the same row and column according to the time sequence, or may be arranged in staggered rows and columns according to different change intervals.

[0013] Furthermore, the index items may be arranged in the same row according to an agreed order, or may be arranged in staggered rows and the same column according to different change intervals.

[0014] Furthermore, the index items and coding units can be distinguished by special symbols.

[0015] Furthermore, the data, letters or characters in the indicator items and coding units may use text modification symbols, including but not limited to foreground color, background color, bold, italic, and underline.

[0016] The beneficial effects of the present invention are as follows: 1. The encoded data is highly compressed. The encoded data is more concise, shortening the length of the original data. The maximum length of data recording can be shortened by 50%, and the maximum length of data display can be shortened by 75%. For example, if the decline is -0.1%, -0.1% can be encoded as a>, shortening the length from 4 to 2. When displayed, it can be displayed as á using tone symbols, further shortening the length to 1, saving 75% of the display space.

[0017] 2. The encoded data is lossless. Changes in financial data or indices can be expressed losslessly using the "prefix + letter + suffix + special characters" format, ensuring data accuracy.

[0018] 3. The encoded data uses character strings to quantitatively express the changes in financial data or indices, making it convenient to directly or indirectly use software tools such as regular expressions to search, parse, query, count, calculate, analyze and predict trends on the data.

[0019] 4. The encoded data is highly readable. Each coding unit can be arranged in the same row in chronological order, or in staggered rows and columns according to different change intervals. The indicators within each coding unit can be arranged in the same row in the agreed order, or in staggered rows and columns according to different change intervals. Characters within the coding unit can be assigned different colors, allowing users to understand the data at a glance. Based on this, various big data and artificial intelligence products can be derived. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1: Flowchart of coding calculations for quantifying price or index changes of financial products.

[0021] Figure 2: Comparison chart of indicator letters and change ranges with an accuracy of 0.4%.

[0022] Figure 3: Comparison chart of letter and special character combinations and change ranges of indicator items with an accuracy of 0.1%.

[0023] Figure 4: Coding example of implementation case.

[0024] Figure 5: Arrangement diagram of coding units in different columns and rows of the implementation case (within 5 days). DETAILED DESCRIPTION

[0025] The detailed features and advantages of the present invention are described in detail below in the specific implementation, and the content is sufficient to enable anyone familiar with the relevant skills to understand the technical content of the present invention and implement it accordingly, and understand the relevant purposes and advantages of the present invention.

[0026] The following is an explanation using a specific implementation case to facilitate understanding.

[0027] Case description: Given the original closing price data of a financial product within 5 days, the encoding algorithm described in the present invention is used to encode the case. The encoding process is carried out according to Figure 1. The encoding example is shown in Figure 4. The present invention is used to encode the percentage increase or decrease in the closing price of the financial product within 5 days. The specific implementation method is described as follows.

[0028] Step 1: Obtain the original closing price data of a financial product within 5 days. See the first row of data in Figure 4 for specific data.

[0029] Step 2: Calculate the daily closing price increase or decrease difference. The closing price increase or decrease difference on the i-th day = the closing price on the i-th day - the closing price on the (i-1)-th day. For specific data, see the second row of data in Figure 4.

[0030] Step 3: Calculate the percentage increase or decrease of the closing price on day i. The calculation formula is:

[0031] For specific data, see the third row of data in Figure 4.

[0032] Step 4: Prefix. The prefix is ​​equal to the absolute value of the percentage increase or decrease in the closing price on day i divided by 10%, with only the integer portion being taken. If the absolute value is 0, the prefix is ​​omitted. The calculation formula is: Only the integer part is taken. For the specific encoding prefix, see the data in the fourth row of Figure 4.

[0033] Step 5: Query the code letter. According to the sign, units place and decimal part of the closing price increase or decrease percentage on the i-th day, check Figure 2 to obtain the letter corresponding to the change range, that is, for percentage: ±p m …p2p1.q1q2…q n %, take the sign, units place and decimal part: ±p1.q1q2…q n %, use this part of the data to query Figure 2 and obtain the corresponding letters. The specific corresponding letters are shown in the 5th row of data in Figure 4.

[0034] If the accuracy meets the requirements, proceed to step 8. If the accuracy requirement is higher, proceed to step 6:

[0035] Step 6: Query the coded letters and special symbols. According to the symbol and the unit and decimal parts of the closing price increase or decrease percentage on the i-th day, refer to Figure 3 to obtain the letter and special symbol combination corresponding to the change range, that is, for percentage: ±p m …p2p1.q1q2…q n %, take the sign, units place and decimal part: ±p1.q1q2…q n %, use this part of the data to query Figure 3 to obtain the corresponding combination of letters and special symbols. The specific corresponding letters are shown in the sixth row of data in Figure 4.

[0036] If the accuracy meets the requirements, proceed to step 8. If the accuracy requirement is higher, continue to step 7:

[0037] Step 7: Code the suffix. The suffix is ​​equal to the percentile of the price or index change percentage of the corresponding indicator item and the decimal number after it, that is, for a percentage: ±p m …p2p1.q1q2…q n %, take q2…q n For the data part, the number of decimal places can be selected according to the accuracy requirements. The specific corresponding letters are shown in the 7th row of data in Figure 4.

[0038] Step 8: Obtain the closing price code. The closing price code = "prefix + letter + suffix + special character". The specific corresponding letters are shown in the eighth row of data in Figure 4.

[0039] Step 9: Obtain the code unit. The code unit is equal to the combination of the indicator codes. Since there is only one closing price indicator, the code unit is equal to the indicator code. The specific corresponding letters are shown in the 9th row of data in Figure 4.

[0040] Step 10: Obtain the 5-day code. The 5-day code is equal to the chronological combination of coding units, and the coding unit is equal to the coding combination of the closing price = "prefix + letter + suffix + special character". The coding data is shown in the 10th row of Figure 4.

[0041] Step 11: Compress the 5-day code. The special characters use the combination of Chinese pinyin tone symbols "ˉˊˇˋ" to compress the 5-day code. The compressed coding data is shown in the 11th row of Figure 4.

[0042] Step 12: The code in Step 11 is arranged in staggered rows and different columns according to different times and change intervals, as shown in Figure 5.

[0043] From the above case, it can be seen that: (1) For the 5-day closing price increase and decrease "12.39% - 6.51% - 6.22% 13.71% - 30.85%" in the case, the code after being encoded by the coding algorithm described in the present invention is "1F9>q1<p2 = 1J1<3c5;", and after compression, it is The length before encoding is 31, and the length after encoding compression is 8, with a compression rate of 74%.

[0044] (2) For the 5-day closing price increase and decrease "12.39% - 6.51% - 6.22% 13.71% - 30.85%" in the case, the code after being encoded by the coding algorithm described in the present invention is completely consistent with the data accuracy before encoding, achieving lossless.

[0045] (3) For the 5-day closing price increase and decrease "12.39% - 6.51% - 6.22% 13.71% - 30.85%" in the case, the code after being encoded by the coding algorithm described in the present invention is convenient for data query, statistics, calculation, and analysis using software tools such as regular expressions, and various big data and artificial intelligence products can be derived based on this. For example, using the regular expression [-0]|(?:[1 - 9][0 - 9]*)?[a-zA-Z][0 - 9]*[;<=>] can obtain a single data, and using the regular expression: ^([-0]|(?:[1 - 9][0 - 9]*)?[a-zA-Z][0 - 9]*[;<=>])*$ can obtain the data within a time period.

[0046] (4) The code in the case can be arranged in staggered rows and different columns according to different times and change intervals, and text decoration symbols can also be used for the data, letters, or characters in the code, including but not limited to foreground color, background color, bold, italic, and underline, which facilitates the user's reading and use.

[0047] While the present invention is disclosed above, it is not limited thereto. Any modifications that do not depart from the spirit of the present invention, such as quantification of financial data such as shareholder equity and turnover, swapping prefixes and suffixes, replacing English letters with other letters, capitalizing falling prices, and various text modifications, are all within the scope of protection of the present invention.

Claims

1. A high compression lossless quantization price or index change encoding algorithm, Features: The price or index change code within a certain period of time includes multiple coding units, each coding unit is the price or index change of a unit period within the period, and each coding unit includes multiple indicator items, which are the price or index change percentage of a specific indicator, that is, ±p m …p 2 p 1 .q 1 q 2 …q n % indicates that a unified coding algorithm is defined for the index item: when in the suspended trading state, the index item is equal to "-", when ±p m …p 2 p 1 .q 1 q 2 …q n %=0, the index item is equal to "0", when ±p m …p 2 p 1 .q 1 q 2 …q n % = integer multiples of +10%, the index item is equal to "integer multiples + Z", when ±p m …p 2 p 1 .q 1 q 2 …q n % = integer multiple of -10%, the index item is equal to "integer multiple + z", when ±p m …p 2 p 1 .q 1 q 2 …q n When %≠0 or an integer multiple of ±10%, the indicator item is equal to "prefix + letter", where the prefix is ​​equal to ±p m …p 2 p 1 .q 1 q 2 …q n The integer obtained by dividing the absolute value of % by 10% and taking only the integer part. When the integer is 0, the prefix should be omitted. The letter is equal to one of the 50 letters "AY" and "ay". The 25 uppercase letters "AY" divide the interval (0%, 10%) into 25 rising intervals, and the 25 lowercase letters "ay" divide the interval (0%, -10%) into 25 falling intervals. Take ±p m …p 2 p 1 .q 1 q 2 …q n The data of the sign, units and decimal part of %, that is, ±p 1 .q 1 q 2 …q n %, and determine the corresponding letter based on the rise or fall range of the data.

2. A high compression lossless quantization price or index change encoding algorithm as claimed in claim 1, Features: The index item mentioned above, when ±p m …p 2 p 1 .q 1 q 2 …q n When %≠0 and the integer multiple of ±10%, special characters can be added to improve the accuracy. The indicator item = "prefix + letter + special character", where the special character is equal to one of the 4 special characters "; <=>". The special characters are combined with 50 letters "AY, ay" in pairs, and the (-10%, 10%) interval is further divided into 200 equally divided rise and fall intervals. Take ±p m …p 2 p 1 .q 1 q 2 …q n The data of the sign, units digit and decimal part of %, that is, ±p1.q1q2…qn%, is used to determine the corresponding "letter + special character" combination according to the rise and fall range of the data.

3. A high compression lossless quantization price or index change coding algorithm as claimed in claim 2, Features: The index item mentioned above, when ±p m …p 2 p 1 .q 1 q 2 …q n When %≠0, ±10% is an integer multiple, a suffix can be added to improve the accuracy, that is, the indicator item = "prefix + letter + suffix + special character", where the suffix is ​​equal to ±p m …p 2 p 1 .q 1 q 2 …q n The percentile and the decimal part after it, i.e. q 2 …q n , which can be omitted when the suffix is ​​0.

4. A high compression lossless quantization price or index change encoding algorithm as claimed in claim 2, Features: The special characters can also be Chinese Pinyin tone symbols "ˉˊˇˋ". The four tone symbols "ˉˊˇˋ" are combined in pairs with the 50 letters "AY, ay", dividing the (-10%, 10%) interval into 200 rise and fall intervals. One letter and one Chinese Pinyin tone symbol are combined to form a new character.

5. A high compression lossless quantization price or index change encoding algorithm as claimed in claim 1, Features: The letters or characters "AZ", "az", "0", and "-" may also be represented by letters or characters of any other type or number.

6. A high compression lossless quantization price or index change encoding algorithm as claimed in claim 2, Features: The four special characters ";<=>" may also be represented by any other type or number of letters or characters.

7. The high compression lossless quantization product price or index change encoding algorithm as claimed in claim 1, Features: The coding units may be arranged in the same row and in different columns according to the time sequence, or may be arranged in different rows and in different columns according to different change intervals.

8. The high compression lossless quantization product price or index change encoding algorithm as claimed in claim 1, Features: The index items may be arranged in the same row in an agreed order, or may be arranged in staggered rows and the same column according to different change intervals.

9. A high compression lossless quantization price or index change encoding algorithm as claimed in claim 1, Features: The index items and coding units can be distinguished by special symbols.

10. A high compression lossless quantization price or index change encoding algorithm as claimed in claim 1, Features: The index items, data, letters or characters in the coding units may use text modification symbols, including but not limited to foreground color, background color, bold, italic, and underline.

Citation Information

Patent Citations

  • Compressed encoding method for stock information data

    CN101212263A

  • An intelligent stock prediction method based on a news text

    CN108985941A

  • Coding algorithm for high-compression lossless quantization of price or index change

    CN114862595A

  • Financial big data optimization storage method

    CN115543946A

  • Digital encoding device

    JP2015109585A