A k-line data processing method, system, device and medium

By storing candlestick data for specific targets and specific candlestick chart types in a local cache, and combining this with historical user data, the problem of excessive cache storage resources is solved, achieving efficient data retrieval and information display.

CN116467348BActive Publication Date: 2026-01-02HANGZHOU LONGBU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310299822.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-20
Publication Date
2026-01-02
Estimated Expiration
2043-03-20

AI Technical Summary

Technical Problem

Existing technologies in the financial market focus excessively on the efficiency of data acquisition and information display, resulting in excessive consumption of cache storage resources, which cannot be effectively avoided.

Method used

By storing candlestick data for specific targets and specific candlestick chart types in a local cache, and using historical user behavior data to determine the criteria for interest, the system first checks the local cache to see if the candlestick data to be retrieved exists. If not found, it retrieves the data from the data source. Furthermore, if there are missing timestamps in the local cache, only the missing data is retrieved, thus avoiding the storage of massive amounts of data.

Benefits of technology

It effectively avoids excessive consumption of cache storage resources, ensures the efficiency of data acquisition and information display, and guarantees the timeliness and accuracy of data, thereby improving the efficiency of data acquisition and information display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116467348B_ABST
    Figure CN116467348B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a kind of k line data processing method, system, equipment and medium, to solve the problem of how to guarantee the efficiency of data acquisition and information display to a certain extent in prior art, while avoiding the problem of excessive consumption of storage resources for cache.The method comprises: determining the target target identification corresponding to the k line data to be acquired and target k line chart type;According to target target identification and target k line chart type, it is inquired whether there is corresponding stored k line data in local cache with target target identification and target k line chart type;If corresponding stored k line data is found in local cache, corresponding stored k line data is acquired;If corresponding stored k line data is not found in local cache, target target identification and target k line chart type are sent to data source to acquire k line data corresponding to target target identification and target k line chart type from data source.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular, relates to a k-line data processing method, system, device and computer readable storage medium. BACKGROUND

[0002] In the financial market, investors often need to view k-line charts (Candlestick Charts, also known as candlestick charts, Japanese line charts, Yin-Yang line charts, stick-line charts, etc.) and make investment analysis according to the k-line charts.

[0003] In order to facilitate data acquisition and information display, a financial management application will obtain all types of k-line data of all targets in a target financial market (such as the Shanghai Stock Exchange) in a past historical trading period before the opening of the current trading day, and store the k-line data in the local cache of the application. In this way, when a user needs to query a certain type of k-line chart of a certain target through the application in the current trading day, the application can obtain the k-line data corresponding to the generation of the k-line chart of the type from the cache to generate the k-line chart and display it, thereby ensuring the efficiency of data acquisition and information display.

[0004] Among them, the target refers to the trading object of the financial market, such as various currencies, futures, stocks, precious metals, etc. The k-line data generally refers to the opening price, the highest price, the lowest price, and the closing price, and the corresponding time stamp; the k-line chart type refers to the type obtained by dividing the k-line chart according to the statistical period of the price value presented in the k-line chart, such as 1-minute k-line, 5-minute k-line, daily k-line, weekly k-line, monthly k-line, annual k-line, etc.

[0005] For the server corresponding to the application, in order to ensure the efficiency of providing data to the data requestor (such as the application), the above-mentioned similar method will also be used to store all types of k-line data of all targets in the target financial market in the historical trading period to the local cache of the server.

[0006] The problem of the above prior art is that excessive attention is paid to the efficiency of data acquisition and information display, and the storage of massive k-line data to the cache will cause excessive consumption of storage resources of the cache.

[0007] How to ensure the efficiency of data acquisition and information display to a certain extent while avoiding excessive consumption of storage resources of the cache is a technical problem that needs to be solved by the prior art. SUMMARY

[0008] To solve the problem of how to ensure the efficiency of data acquisition and information display to a certain extent while avoiding excessive consumption of storage resources for cache in the prior art, the embodiments of the present application provide a k-line data processing method, system, device and medium.

[0009] One of the embodiments of the present application provides a k-line data processing method, comprising: determining a target target identification corresponding to to-be-acquired k-line data and a target k-line chart type; querying whether there is stored k-line data corresponding to the target target identification and the target k-line chart type in a local cache according to the target target identification and the target k-line chart type; wherein the local cache is used to store the identification of a specific target, the specific k-line chart type of the specific target, and the k-line data corresponding to the specific k-line chart type of the specific target; the specific target is selected from all targets of a target financial market according to a preset target attention condition; the specific k-line chart type is selected from various k-line chart types according to a preset chart type attention condition; the target attention condition and the chart type attention condition are determined based on historical acquisition behavior data of the user for the k-line data of the target financial market; if it is queried that the corresponding stored k-line data exists in the local cache, the corresponding stored k-line data is acquired; if it is queried that the corresponding stored k-line data does not exist in the local cache, the target target identification and the target k-line chart type are sent to a data source to acquire k-line data corresponding to the target target identification and the target k-line chart type from the data source.

[0010] One of the embodiments of the present application provides a kind of k-line data processing system, comprising: determination module, for determining the target target identification and target k-line chart type corresponding to the k-line data to be acquired;Query module, for according to the target target identification and the target k-line chart type, query whether there is the k-line data corresponding to the target target identification and the target k-line chart type stored in local cache;Wherein, the local cache, for corresponding storage specific target identification, the specific k-line chart type of the specific target, and the k-line data corresponding to the specific k-line chart type of the specific target;The specific target is selected from all targets of target financial market according to preset target attention condition;The specific k-line chart type is selected from various k-line chart types according to preset chart type attention condition;The target attention condition and the chart type attention condition are determined based on the historical acquisition behavior data of the target financial market k-line data of user;First acquisition module, for if the corresponding storage k-line data is found in the local cache, then the corresponding storage k-line data is acquired;Second acquisition module, for if the corresponding storage k-line data is not found in the local cache, then the target target identification and the target k-line chart type are sent to data source, to acquire the k-line data corresponding to the target target identification and the target k-line chart type from the data source.

[0011] One of the embodiments of the present application provides an electronic device, comprising: memory and processor, wherein the memory is used to store computer program;The processor is coupled with the memory, and is used to execute the computer program stored in the memory, to execute k-line data processing method.

[0012] One of the embodiments of the present application provides a computer readable storage medium, the computer readable storage medium stores computer program, the computer program is executed by processor to realize k-line data processing method.

[0013] The above at least one technical scheme adopted by the embodiments of the present application can at least achieve the following beneficial effects:

[0014] 1, in local cache, the specific k-line chart type of specific target and the k-line data corresponding to the specific k-line chart type of specific target are stored, first in local cache query whether the k-line data to be acquired can be found, if not found again to data source acquisition, instead of prior art massive k-line data is stored to local cache, so setting can avoid for cache to consume too much storage resources.

[0015] 2、The k-line data stored in the local cache is the k-line data corresponding to a specific k-line chart type of a specific target. In the process of determining the specific target and the specific k-line chart type, the historical acquisition behavior data of the k-line data of the target financial market is required, so that the k-line data stored in the local cache is related to the historical acquisition behavior data of the user. The k-line data to be acquired by the user next time may exist in the local cache, so that the data can be acquired in time and the information can be displayed quickly.

[0016] 3、When the corresponding stored k-line data does not exist in the local cache, the stored k-line data corresponding to the target target identifier and the target k-line chart type is determined by merging the k-line data in the local cache, without having to acquire from the data source, further improving the efficiency of data acquisition and information display.

[0017] 4、When the corresponding stored k-line data exists in the local cache, it is judged whether the time stamp in the corresponding stored k-line data is missing in the time stamp range, so as to ensure the accuracy of the data in the local cache. When there is a missing time stamp, the k-line data corresponding to the missing time stamp, the target target identifier and the target k-line chart type is acquired from the data source. In this way, only the k-line data corresponding to the missing time stamp, the target target identifier and the target k-line chart type can be acquired, avoiding the acquisition of all k-line data in the time stamp range from the data source due to the missing data in the local cache, further improving the efficiency of data acquisition and information display.

[0018] 5、The k-line data stored in the local cache can be updated, ensuring the timeliness and accuracy of the data in the local cache. BRIEF DESCRIPTION OF DRAWINGS

[0019] The drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a schematic diagram of an application scenario of a k-line data processing system according to some embodiments of the present application;

[0021] Figure 2 is an exemplary schematic diagram of a k-line data processing system according to some embodiments of the present application;

[0022] Figure 3 shows an exemplary k-line chart for displaying k-line data of a certain target in the prior art;

[0023] Figure 4 is an exemplary flowchart of a k-line data processing method according to some embodiments of the present application;

[0024] Figure 5 is another exemplary flowchart of a k-line data processing method according to some embodiments of the present application.

[0025] Figure 6 is still another exemplary flowchart of a k-line data processing method according to some embodiments of the present application. DETAILED DESCRIPTION

[0026] For the purposes of the present application, the technical solutions and advantages, the following will be combined with the specific embodiments of the present application and the corresponding drawings to clearly and completely describe the technical solutions of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.

[0027] Those of ordinary skill in the art can know that, as technology develops and new scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0028] The terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, and this is only a way of distinguishing the objects with the same attributes used in the description of the embodiments of the present application. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, so that the processes, methods, systems, products or devices containing a series of units do not have to be limited to those units, but can include other units not clearly listed or inherent to these processes, methods, products or devices.

[0029] To solve the problem of how to ensure the efficiency of data acquisition and information display to a certain extent while avoiding excessive consumption of storage resources for cache in the prior art, the embodiments of the present application provide a k-line data processing method, system, device and medium.

[0030] Figure 1 is an application scenario schematic diagram of a k-line data processing system according to some embodiments of the present application. As shown in Figure 1 application scenario 100 can include server 110, network 120, terminal device 130 and data source 140. Server 110 can include a processing device (not shown in the figure).

[0031] The server 110 can be configured to manage resources and process data and / or information from at least one component of the system or an external data source (e.g., a cloud data center). In some embodiments, the server 110 can be a single server or a group of servers. In some embodiments, the server 110 can be local or remote. In some embodiments, the server 110 can be implemented on a cloud platform or provided in a virtual manner.

[0032] The processing device can be configured to process information and / or data related to the application scenario 100, such as target subject identification, target k-line chart type, etc. In some embodiments, the processing device can include one or more processing engines (e.g., single-chip processing engines or multi-chip processing engines). For example only, the processing device can include a central processing unit (CPU). The processing device can process data, information, and / or processing results obtained from other devices or system components, and execute program instructions based on the data, information, and / or processing results to perform one or more functions described in this specification.

[0033] In some embodiments, the processing device can include a local cache. The local cache can be configured as a level one cache, a level two cache, a level three cache, etc.

[0034] The network 120 can connect components of the application scenario 100 and / or connect the application scenario 100 with external resource components. The network 120 enables communication between components and between the application scenario 100 and other components outside the application scenario 100, facilitating exchange of data and / or information. The network 120 can be a local area network, a wide area network, the Internet, etc., and can be a combination of various network structures.

[0035] The terminal device 130 can include one or more terminal devices or software. For example, the terminal device 130 can include a mobile phone 130-1, a tablet computer 130-2, a laptop computer 130-3, etc. A user of the terminal device 130 can be one or more users. In some embodiments, the user can view information and / or input data and / or instructions through the terminal device 130. For example, the user can input a query instruction for k-line data through the terminal device 130. For another example, the user can view k-line data through the terminal device 130.

[0036] The data source 140 can be configured to store data. For example, all k-line data of a certain target since its listing. For another example, all k-line data of all targets in a financial market since their listing. In some embodiments, the data source 140 can be configured to provide data to a processing device based on a request of the processing device. For example, the processing device needs k-line data of target A from March 2, 2020 to March 6, 2020, the processing device can send a request to the data source 140 through the network 120, and the data source 140 sends the k-line data of target A from March 2, 2020 to March 6, 2020 to the processing device through the network 120 based on the request of the processing device.

[0037] It should be noted that the application scenario 100 is provided only for illustrative purposes and is not intended to limit the scope of the present application. Those of ordinary skill in the art can make various modifications or changes according to the description of the present application. For example, the application scenario can also include a database. For another example, the application scenario can be implemented on other devices to achieve similar or different functions. However, changes and modifications will not depart from the scope of the present application.

[0038] Figure 2 is an exemplary schematic diagram of a k-line data processing system according to some embodiments of the present application. As shown in Figure 2 the k-line data processing system 200 includes a determination module 210, a query module 220, a first acquisition module 230, and a second acquisition module 240. In some embodiments, the k-line data processing system 200 can be part of or implemented by the server 110.

[0039] The determination module 210 is configured to determine a target target identification and a target k-line chart type corresponding to k-line data to be acquired.

[0040] The query module 220 is configured to query whether there is stored k-line data corresponding to the target target identification and the target k-line chart type in a local cache according to the target target identification and the target k-line chart type. The local cache is configured to store a specific target identification, a specific k-line chart type of a specific target, and k-line data corresponding to the specific k-line chart type of the specific target. The specific target is selected from all targets of a target financial market according to a preset target attention condition. The specific k-line chart type is selected from various k-line chart types according to a preset chart type attention condition. The target attention condition and the chart type attention condition are determined based on historical acquisition behavior data of k-line data of the target financial market of a user.

[0041] The first acquisition module 230 is configured to acquire the stored k-line data if the corresponding stored k-line data is queried in the local cache.

[0042] The second obtaining module 240 is configured to, if it is found that the corresponding stored k-line data does not exist in the local cache, send the target target identification and the target k-line chart type to the data source to obtain the k-line data corresponding to the target target identification and the target k-line chart type from the data source.

[0043] For more details of the determining module 210, the querying module 220, the first obtaining module 230, and the second obtaining module 240, see Figure 4 and Figure 5 and the related descriptions.

[0044] In some embodiments, the first obtaining module 230 can be further configured to:

[0045] If it is found that the corresponding stored k-line data exists in the local cache, determine, according to the time stamp range corresponding to the k-line data to be obtained, whether a time stamp contained in the time stamp range is missing in the time stamp of the corresponding stored k-line data.

[0046] If it is determined that the time stamp is missing, send the missing time stamp, the identification of the target target, and the target k-line chart type to the data source to obtain the k-line data corresponding to the missing time stamp, the target target identification, and the target k-line chart type from the data source.

[0047] In some embodiments, the first obtaining module 230 can be further configured to:

[0048] Determine the time stamp range according to the start time stamp and the end time stamp corresponding to the k-line data to be obtained, or

[0049] Determine the time stamp range according to the end time stamp corresponding to the k-line data to be obtained and the target k-line number.

[0050] In some embodiments, the k-line data processing system 200 can further include a data updating module 250, which can be configured to:

[0051] After receiving the data source k-line data for updating the data in the local cache, find, based on the identification of the target corresponding to the data source k-line data and the k-line chart type, the k-line data stored in the local cache corresponding to the identification of the target corresponding to the data source k-line data and the k-line chart type; the data source k-line data is the k-line data obtained from the data source;

[0052] Update the k-line data stored in the local cache corresponding to the identification of the target corresponding to the data source k-line data and the k-line chart type found by using the data source k-line data.

[0053] In some embodiments, the k-line data processing system 200 can further include a second determining module 260, which can be configured to:

[0054] If it is found that the corresponding stored k-line data does not exist in the local cache, it is determined whether k-line data meeting the data merging condition exists in the local cache. The k-line data meeting the data merging condition meets the following condition: corresponding to the target target identifier, and after being merged according to the preset data merging rule, the k-line data corresponding to the target k-line chart type can be obtained.

[0055] If the k-line data meeting the data merging condition exists, the k-line data meeting the data merging condition is merged according to the preset data merging rule to obtain the merged k-line data as the k-line data stored corresponding to the target target identifier and the target k-line chart type.

[0056] For more details of the data updating module 250 and the second determining module 260, see Figure 4 and Figure 6 and the related descriptions thereof.

[0057] It should be noted that the above description of the system and its modules is for convenience of description only and cannot limit the application to the scope of the embodiments. It can be understood that, for those skilled in the art, after understanding the principle of the system, the modules can be combined arbitrarily or connected with other modules to form a subsystem without departing from the principle. For example, the determining module 210, the querying module 220 and the first obtaining module 230 can be integrated in one module. For another example, the modules can share one storage device, and the modules can also have respective storage devices. Such variations are within the protection scope of the application.

[0058] Figure 3 An exemplary k-line chart showing k-line data of a certain target in the prior art is shown. As described in the background, the types of k-line charts generally include: 1-minute k-line, 5-minute k-line, daily k-line, weekly k-line, monthly k-line, annual k-line, etc. Only as an example, Figure 3 A k-line chart of 1-minute k-line of a certain target in the Shanghai Stock Exchange from 13:31 on March 7, 2023 to 14:11 on March 7, 2023 is shown.

[0059] For the convenience of data acquisition and information display, a financial management application will acquire all types of k-line data of all targets in a target financial market (such as the Shanghai Stock Exchange) in a plurality of historical trading periods before the opening of the current trading day, and store the k-line data in the local cache of the application. For example, the current trading day is March 8, 2023, in order to quickly display the k-line data before March 8, 2023 to the user, the financial management application will acquire all types of k-line data of all targets in the target financial market (such as the Shanghai Stock Exchange) in a plurality of historical trading periods before March 8, 2023 before the opening of March 8, 2023, and store the k-line data in the local cache of the financial management application.

[0060] For the server corresponding to the financial management application, in order to ensure the efficiency of providing data to the data requester (such as the financial management application), the prior art will also use the above-mentioned similar method, the server will acquire all types of k-line data of all targets in a target financial market (such as the Shanghai Stock Exchange) in a plurality of historical trading periods before the opening of the current trading day, and store the k-line data in the local cache of the server.

[0061] Using the above-mentioned prior art, excessive attention is paid to the efficiency of data acquisition and information display, and the storage of massive k-line data into the cache will cause excessive consumption of storage resources of the cache. Therefore, the present specification provides a k-line data processing method. The k-line data processing method provided by the present specification can be executed only by a terminal device, only by a server, or by both a terminal device and a server. For the purpose of illustration, the present specification will be illustrated by taking the execution by the server only as an example.

[0062] Figure 4 is an exemplary flowchart of a k-line data processing method according to some embodiments of the present application. In some embodiments, the flow 400 can be executed by a processing device. As shown in Figure 4 , the flow 400 can include the following steps:

[0063] Step 410, determining the target target identification and target k-line chart type corresponding to the k-line data to be acquired.

[0064] In some embodiments, step 410 can be executed by the determination module 210.

[0065] The target target identification can refer to an identification that can distinguish other targets and the target corresponding to the k-line data to be acquired. For example, name, code, etc.

[0066] The target k-line chart type can refer to the k-line chart type corresponding to the k-line data to be acquired. For example, if the k-line data to be acquired is the opening price, the highest price, the lowest price and the closing price on March 7, 2023, the target k-line chart type is the daily k-line.

[0067] In some embodiments, the processing device can determine the target subject identifier and the target k-line chart type corresponding to the k-line data to be acquired based on the input of the user through the terminal device. The user can input in one or more forms such as voice, text, click, etc. on the terminal device. For example, the user inputs the text "the closing price of subject A on March 7, 2023" on the terminal device, and the processing device can determine that the target subject identifier corresponding to the k-line data to be acquired is A and the target k-line chart type is daily k-line.

[0068] Step 420, according to the target subject identifier and the target k-line chart type, query whether there is k-line data corresponding to the target subject identifier and the target k-line chart type stored in the local cache.

[0069] In some embodiments, step 420 can be performed by the query module 220.

[0070] In some embodiments, the local cache can be used to store the identifier of a specific subject, the specific k-line chart type of the specific subject, and the k-line data corresponding to the specific k-line chart type of the specific subject.

[0071] The specific subject can refer to a subject selected from all subjects of the target financial market according to a preset subject attention condition. The subject attention condition can refer to a condition set for a subject that needs to be paid attention to.

[0072] The specific k-line chart type can refer to a k-line chart type selected from various k-line chart types according to a preset chart type attention condition. The chart type attention condition can refer to a condition set for a chart type that needs to be paid attention to.

[0073] In some embodiments, the processing device can determine the subject attention condition and the chart type attention condition based on the historical acquisition behavior data of the user for the k-line data of the target financial market.

[0074] The historical acquisition behavior data can refer to behavior data related to the user acquiring the k-line data of the target financial market. For example, the frequency of the user clicking on the subject, the number of times the user views various k-line chart types, etc.

[0075] For example only, the processing device can analyze, based on historical acquisition behavior data, that the higher the frequency of a user clicking on a target, such as more than 15 times a week, the more likely the user is interested in the target, and determine that more than 15 times a week is a target interest condition. The more times a user views a certain type of k-line chart, such as more than 20 times, the more likely the user is interested in the type of k-line chart, and determine that more than 20 times is a chart type interest condition. After determining the target interest condition and the chart type interest condition, if the user now clicks on target A 16 times a week, views 10 times of the 1-minute k-line of target A, and views 30 times of the daily k-line of target A; clicks on target B 20 times a week, views 39 times of the 1-minute k-line of target B, and views 25 times of the daily k-line of target B; the processing device can determine that target A and target B are specific targets, determine that the daily k-line is a specific k-line chart type of target A, and determine that the 1-minute k-line and the daily k-line are specific k-line chart types of target B.

[0076] In some embodiments, the processing device can query whether there is stored k-line data corresponding to the target target identification and the target k-line chart type in the local cache according to the target target identification and the target k-line chart type.

[0077] In some embodiments, the processing device can execute step 430 based on querying that there is corresponding stored k-line data in the local cache. In some embodiments, the processing device can execute step 440 based on querying that there is no corresponding stored k-line data in the local cache.

[0078] Step 430, if it is queried that there is corresponding stored k-line data in the local cache, the corresponding stored k-line data is acquired.

[0079] In some embodiments, step 430 can be executed by the first acquisition module 230.

[0080] In some embodiments, the processing device can acquire the corresponding stored k-line data based on querying that there is corresponding stored k-line data in the local cache. For example, the processing device can query that there is corresponding stored k-line data of the daily k-line of target A in the local cache according to the target target identification A and the target k-line chart type daily k-line, and the processing device can acquire the part of data queried.

[0081] In some embodiments, the processing device can acquire the corresponding stored k-line data by data processing on the corresponding stored k-line data based on querying that there is corresponding stored k-line data in the local cache. Exemplary data processing can include, but is not limited to, data cleaning, data processing, data sampling, etc.

[0082] For details of the processing device obtaining the corresponding stored k-line data based on the query that the corresponding stored k-line data exists in the local cache, please refer to Figure 5 and the description thereof.

[0083] In step 440, if it is queried that the corresponding stored k-line data does not exist in the local cache, the target target identification and the target k-line chart type are sent to the data source to obtain the k-line data corresponding to the target target identification and the target k-line chart type from the data source.

[0084] In some embodiments, step 440 can be performed by the second obtaining module 240.

[0085] In some embodiments, the processing device can send the target target identification and the target k-line chart type to the data source based on the query that the corresponding stored k-line data does not exist in the local cache, and obtain the k-line data corresponding to the target target identification and the target k-line chart type from the data source in a variety of feasible ways.

[0086] With the above scheme provided by the embodiments of the present application, the identification of the specific target, the specific k-line chart type of the specific target, and the k-line data corresponding to the specific k-line chart type of the specific target are stored in the local cache. First, it is queried whether the to-be-obtained k-line data can be found in the local cache, and if not, the data source is accessed to obtain the k-line data. Instead of storing a large amount of k-line data in the local cache in the prior art, such a setting can avoid excessive consumption of storage resources of the cache.

[0087] At the same time, the k-line data stored in the local cache is the k-line data corresponding to the specific k-line chart type of the specific target, and in the process of determining the specific target and the specific k-line chart type, the historical acquisition behavior data of the k-line data of the target financial market needs to be used. In this way, it is ensured that the k-line data stored in the local cache is related to the historical acquisition behavior data of the user, and the next to-be-acquired k-line data of the user may exist in the local cache. In this way, it is ensured that the data can be acquired in time and the information can be displayed quickly. Therefore, the above scheme provided by the embodiments of the present application can solve the problem in the prior art that the efficiency of data acquisition and information display is ensured to a certain extent, while excessive consumption of storage resources of the cache is avoided.

[0088] In some embodiments, the processing device can further include a second determining module 260, which can be configured to: if it is queried that the corresponding stored k-line data does not exist in the local cache, determine whether there is k-line data that meets the data merging condition in the local cache.

[0089] The data merging condition can refer to a condition that the data needs to meet when the data is merged. For example, at least two pieces of data to be merged have the same precision, format, etc. The data merging condition can be determined by a preset.

[0090] In some embodiments, the k-line data that meets the data merging condition satisfies: corresponding to the target subject identifier, and after being merged according to the preset data merging rule, k-line data of the target k-line chart type can be obtained. For example, the target subject identifier is A, the target k-line chart type is 5-minute k-line, there are currently 5 pieces of 1-minute k-line data of the identifier A, these 5 pieces of k-line data correspond to the target subject identifier and are all A, and if the second determination module 260 can obtain one piece of 5-minute k-line data after merging the 5 pieces of k-line data according to the preset data merging condition, the above-mentioned 5 pieces of k-line data can be referred to as k-line data that meets the data merging condition.

[0091] In some embodiments, the second determination module 260 can also be configured to: if there is k-line data that meets the data merging condition, merge the k-line data that meets the data merging condition according to the preset data merging rule to obtain merged k-line data as k-line data stored corresponding to the target subject identifier and the target k-line chart type. The second determination module 260 can compare the sizes of the data to perform the merging. For example, for the highest price, the highest value is determined as the merged highest price by comparing the highest prices of two pieces of data. For example, for the lowest price, the lowest value is determined as the merged lowest price by comparing the lowest prices of two pieces of data.

[0092] Still taking the above example as an example, the 5 pieces of 1-minute k-line data of the identifier A are k-line data that meets the data merging condition, and the second determination module 260 compares the opening price, the highest price, the lowest price and the closing price of the 5 pieces of 1-minute k-line respectively, and determines the comparison results as the opening price, the highest price, the lowest price and the closing price of the 5-minute k-line, that is, the merging of the 5 pieces of 1-minute k-line data of the identifier A is realized, and the obtained merged k-line data is taken as the k-line data of the 5-minute k-line of the identifier A.

[0093] Through the method in some embodiments, when the corresponding stored k-line data does not exist in the local cache, the k-line data corresponding to the target subject identifier and the target k-line chart type stored in the local cache can be determined by merging the k-line data, without having to obtain it from the data source, further improving the efficiency of data acquisition and information display.

[0094] Figure 5is another exemplary flowchart of the k-line data processing method according to some embodiments of the present application. In some embodiments, the local cache can also store the timestamps of the k-line data. In some embodiments, the flow 500 can be performed by the first acquisition module 230. As shown in Figure 5 the flow 500 can include the following steps:

[0095] At step 510, if it is found that the corresponding stored k-line data exists in the local cache, it is determined, according to the timestamp range corresponding to the to-be-acquired k-line data, whether the timestamps corresponding to the stored k-line data are missing the timestamps contained in the timestamp range.

[0096] The timestamp of the k-line data can refer to the timestamp corresponding to the k-line data. For example, the k-line data of the daily k-line on March 7, 2023 has a timestamp of March 7, 2023. For another example, the k-line data of the 1-minute k-line at 14:22 on March 7, 2023 has a timestamp of 14:22 on March 7, 2023.

[0097] In some embodiments, the processing device can determine the timestamp range according to the starting timestamp and the ending timestamp corresponding to the to-be-acquired k-line data. For example, the processing device can determine the timestamp range as 14:02 on March 7, 2023 to 14:42 on March 7, 2023 according to the starting timestamp of 14:02 on March 7, 2023 and the ending timestamp of 14:42 on March 7, 2023 corresponding to the to-be-acquired k-line data.

[0098] The processing device can acquire the starting timestamp and the ending timestamp in various feasible manners. For example, preset rules, manual input, etc. Exemplarily, the preset rules are: for 1-minute k-line, the ending timestamp is the current time, and the starting timestamp is 40 minutes before the current time; for daily k-line, the ending timestamp is the current date, and the starting timestamp is 60 days before the current date. If the to-be-acquired k-line data is the k-line data of the 1-minute k-line at 14:40 on March 7, 2023, the processing device can determine the ending timestamp as 14:40 on March 7, 2023 and the starting timestamp as 14:00 on March 7, 2023 based on the preset rules. If the to-be-acquired k-line data is the k-line data of the daily k-line on March 7, 2023, the processing device can determine the ending timestamp as March 7, 2023 and the starting timestamp as January 6, 2023 based on the preset rules.

[0099] In some embodiments, the processing device can determine the timestamp range according to the terminal timestamp corresponding to the k-line data to be acquired and the target number of k-line bars. For example, the processing device can determine the timestamp range as January 6, 2023 to March 7, 2023 according to the terminal timestamp of March 7, 2023 corresponding to the k-line data to be acquired and the target number of k-line bars of 60.

[0100] The processing device can acquire the target number of k-line bars in various feasible manners. For example, a preset rule, such as that the target number of k-line bars corresponding to 1-minute k-line bars is 40 and the target number of k-line bars corresponding to daily k-line bars is 60. For another example, manual input, such as that a user inputs through a terminal device to view k-line data of 60 days before March 7, 2023, and the processing device can determine the target number of k-line bars as 60 based on the above input.

[0101] In some embodiments, the processing device can query whether the timestamps contained in the timestamp range are missing from the timestamps of the corresponding stored k-line data in the local cache when it is queried that the corresponding stored k-line data exists in the local cache. For example, the timestamp range is from January 16, 2023 to March 7, 2023, and the processing device queries the timestamps of the k-line data in the local cache as from January 16, 2023 to March 4, 2023, and determines that the missing timestamps are March 5, 2023, March 6, 2023 and March 7, 2023.

[0102] Step 520, if it is determined that the timestamps are missing, the missing timestamps, the identification of the target and the target k-line chart type are sent to the data source to acquire the k-line data corresponding to the missing timestamps, the identification of the target and the target k-line chart type from the data source.

[0103] In some embodiments, the processing device can send the missing timestamps, the identification of the target and the target k-line chart type to the data source in various feasible manners based on the determination that the timestamps are missing to acquire the k-line data corresponding to the missing timestamps, the identification of the target and the target k-line chart type from the data source. Through the method in some embodiments, when the corresponding stored k-line data exists in the local cache, it is determined whether the timestamps contained in the timestamp range are missing from the timestamps of the corresponding stored k-line data, which ensures the accuracy of the data in the local cache; when there are missing timestamps, the k-line data corresponding to the missing timestamps, the identification of the target and the target k-line chart type are acquired from the data source. In this way, only the k-line data corresponding to the missing timestamps, the identification of the target and the target k-line chart type can be acquired, avoiding the acquisition of all k-line data in the timestamp range from the data source due to the missing data in the local cache, and further improving the efficiency of data acquisition and information display.

[0104] Figure 6 is another exemplary flowchart of a k-line data processing method according to some embodiments of the present application. In some embodiments, the processing device can further include a data updating module 250, which can be configured to perform the flow 600. As shown in Figure 6 the flow 600 can include the following steps:

[0105] At step 610, after receiving the data source k-line data for updating the data in the local cache, the k-line data corresponding to the subject identified by the data source k-line data and the k-line chart type is searched in the local cache.

[0106] The data source k-line data can refer to the k-line data obtained from the data source.

[0107] It can be understood that the data source k-line data corresponds to the subject identified by the data source k-line data and the k-line chart type. For example, the data source k-line data is the opening price, the highest price, the lowest price, and the closing price of the subject A on March 7, 2023, the subject identified by the data source k-line data is A, and the k-line chart type is daily k-line.

[0108] At step 620, the k-line data corresponding to the subject identified by the data source k-line data and the k-line chart type found in the local cache is updated using the data source k-line data.

[0109] In some embodiments, the data updating module 250 can update the k-line data corresponding to the subject identified by the data source k-line data and the k-line chart type found in the local cache using the data source k-line data. The update can be performed in various feasible ways. For example, adding, replacing, etc.

[0110] Through the method in some embodiments described above, the k-line data stored in the local cache can be updated. The timeliness and accuracy of the data in the local cache are ensured.

[0111] The embodiments of the present application also provide an electronic device, which includes a memory and a processor, wherein the memory is configured to store a computer program; the processor is coupled to the memory and is configured to execute the computer program stored in the memory to perform a k-line data processing method.

[0112] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, a k-line data processing method can be implemented.

[0113] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0114] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and necessary universal hardware platforms, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of software products, and the computer software products can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and include a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0115] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A k-line data processing method, characterized by, The method comprises the following steps: determining a target target identification and a target k-line chart type corresponding to the k-line data to be acquired; According to the target target identification and the target k-line chart type, query whether the k-line data corresponding to the target target identification and the target k-line chart type is stored in the local cache; wherein, the local cache is used for storing the identification of a specific target, the specific k-line chart type of the specific target, and the k-line data corresponding to the specific k-line chart type of the specific target, the timestamp of the k-line data; the specific target is selected from all targets of a target financial market according to a preset target attention condition; the specific k-line chart type is selected from various k-line chart types according to a preset chart type attention condition; the target attention condition and the chart type attention condition are determined based on the historical acquisition behavior data of the user for the k-line data of the target financial market; If the corresponding stored k-line data is found in the local cache, it is judged whether the timestamp of the corresponding stored k-line data is missing in the timestamp range corresponding to the k-line data to be acquired according to the timestamp range corresponding to the k-line data to be acquired; If it is determined that it is missing, the missing timestamp, the target target identification and the target k-line chart type are sent to the data source to acquire the k-line data corresponding to the missing timestamp, the target target identification and the target k-line chart type from the data source; If it is found that the corresponding stored k-line data does not exist in the local cache, it is judged whether the k-line data meeting the data merging condition exists in the local cache; the k-line data meeting the data merging condition meets the following conditions: corresponding to the target target identification, and after being merged according to the preset data merging rule, the k-line data corresponding to the target k-line chart type can be obtained; If the k-line data meeting the data merging condition exists, the k-line data meeting the data merging condition is merged according to the preset data merging rule to obtain the merged k-line data as the k-line data corresponding to the target target identification and the target k-line chart type.

2. The method of claim 1, wherein, The method further comprises: determining the timestamp range according to the start timestamp and the end timestamp corresponding to the k-line data to be acquired; or determining the timestamp range according to the end timestamp and the target k-line number corresponding to the k-line data to be acquired.

3. The method of claim 1, wherein, The method further comprises: After receiving the data source k-line data for updating the data in the local cache, the k-line data corresponding to the identification of the target and the k-line chart type corresponding to the identification of the target and the k-line chart type corresponding to the data source k-line data are searched in the local cache based on the identification of the target and the k-line chart type corresponding to the data source k-line data; the data source k-line data is the k-line data acquired from the data source; The k-line data corresponding to the identification of the target and the k-line chart type corresponding to the data source k-line data in the local cache is updated by using the data source k-line data.

4. A k-line data processing system characterized by, The method comprises the following steps: determining a target target identification and a target k-line chart type corresponding to the k-line data to be acquired; The query module is configured to query whether the k-line data corresponding to the target target identification and the target k-line chart type is stored in the local cache according to the target target identification and the target k-line chart type; the local cache is configured to store the identification of a specific target, the specific k-line chart type of the specific target, and the k-line data corresponding to the specific k-line chart type of the specific target and the timestamp of the k-line data; the specific target is selected from all targets of a target financial market according to a preset target attention condition; the specific k-line chart type is selected from various k-line chart types according to a preset chart type attention condition; and the target attention condition and the chart type attention condition are determined based on historical acquisition behavior data of the user for k-line data of the target financial market; The first acquisition module is configured to, if the corresponding stored k-line data is found in the local cache, determine whether the timestamp range included in the timestamp of the corresponding stored k-line data is missing according to a timestamp range corresponding to the k-line data to be acquired; If it is determined that the timestamp range is missing, the missing timestamp, the target target identification and the target k-line chart type are sent to a data source to acquire k-line data corresponding to the missing timestamp, the target target identification and the target k-line chart type from the data source; The second acquisition module is configured to, if the corresponding stored k-line data is not found in the local cache, determine whether the k-line data meeting the data merging condition is stored in the local cache; the k-line data meeting the data merging condition meets the following conditions: corresponding to the target target identification, and after being merged according to a preset data merging rule, the k-line data corresponding to the target k-line chart type can be obtained; If the k-line data meeting the data merging condition exists, the k-line data meeting the data merging condition is merged according to the preset data merging rule to obtain merged k-line data as the k-line data stored corresponding to the target target identification and the target k-line chart type.

5. The system of claim 4, wherein, The first acquisition module is further configured to: determine the timestamp range according to a start timestamp and an end timestamp corresponding to the k-line data to be acquired; or determine the timestamp range according to an end timestamp corresponding to the k-line data to be acquired and a target k-line number.

6. The system of claim 4, wherein, The system further comprises a data updating module, and the data updating module is configured to: after receiving data source k-line data for updating data in the local cache, find the k-line data stored corresponding to the identification of the target corresponding to the data source k-line data and the k-line chart type in the local cache based on the identification of the target corresponding to the data source k-line data and the k-line chart type; the data source k-line data is k-line data acquired from the data source; update the k-line data stored corresponding to the identification of the target corresponding to the data source k-line data and the k-line chart type in the local cache found by using the data source k-line data.

7. An electronic device, comprising: comprise: a memory and a processor, wherein The memory, configured to store a computer program; The processor, coupled with the memory, is configured to execute the computer program stored in the memory, so as to execute the steps of the method in any one of claims 1-3.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium has stored thereon a computer program, and the computer program is executed by a processor to implement the method in any one of claims 1-3.

Citation Information

Patent Citations

  • Dynamic data caching system and method

    CN113064860A

  • Market data storage method and device, computer device and readable storage medium

    CN113434516A