CN113407525B - K-line data inspection method and device, computer equipment and readable storage medium - Google Patents

K-line data inspection method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN113407525B
CN113407525B CN202110883859.1A CN202110883859A CN113407525B CN 113407525 B CN113407525 B CN 113407525B CN 202110883859 A CN202110883859 A CN 202110883859A CN 113407525 B CN113407525 B CN 113407525B
Authority
CN
China
Prior art keywords
line
preset
missing
lines
abnormal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110883859.1A
Other languages
Chinese (zh)
Other versions
CN113407525A (en
Inventor
阳小鲜
许育珊
龚文
黄龙
彭晓东
何志东
赵楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huarui Distributed Technology Co.,Ltd.
Original Assignee
Shenzhen Archforce Financial Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Archforce Financial Technology Co Ltd filed Critical Shenzhen Archforce Financial Technology Co Ltd
Priority to CN202110883859.1A priority Critical patent/CN113407525B/en
Publication of CN113407525A publication Critical patent/CN113407525A/en
Application granted granted Critical
Publication of CN113407525B publication Critical patent/CN113407525B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Software Systems (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computational Linguistics (AREA)
  • Quality & Reliability (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention belongs to the technical field of market data storage in financial industry, and provides a K-line data inspection method and device, computer equipment and a computer-readable storage medium. According to the method, a plurality of preset security codes are obtained, the number of K lines corresponding to the preset type K line of each preset security code is obtained in parallel according to the preset security codes and the preset K line sequence number contained in the preset type K line, the number of the K lines is compared with the preset target number corresponding to the preset type K line, whether the number of the K lines is consistent with the preset target number or not is judged, if the number of the K lines is not consistent with the preset target number, the preset type K line is judged to be an abnormal K line, the number of the K lines corresponding to the preset type K line is obtained by means of the preset K line sequence number contained in the preset type K line, the number of the K lines corresponding to the preset type K line of each of the plurality of security codes is checked in parallel, the abnormal K lines can be found in time, and the integrity and the correctness of the historical K lines in the preset K line database are guaranteed.

Description

K-line data inspection method and device, computer equipment and readable storage medium
Technical Field
The invention relates to the technical field of market data storage in financial industry, in particular to a K-line data inspection method and device, computer equipment and a computer readable storage medium.
Background
In the financial industry, in the process of transmitting, processing and storing financial quotations, because the data volume of the quotation data is large, and the processing path from generation to storage of the quotation data is long, the requirements on the reliability, time delay, correctness and integrity of the whole transmission and storage system of the quotation data are high, for example, in the security industry, the K line for describing the quotation is most commonly used, and the data volume of the K line is also large.
In the conventional technology, for historical market storage of finance, generally, when historical market data of finance is used, the problem that market data is lost is found, and then the original data corresponding to the market data is repaired, so that when a large amount of market data are stored, incompleteness of the market data cannot be found in time, the whole process is lagged and tedious, manual intervention is more, and the correctness of the stored historical market is reduced.
Disclosure of Invention
The invention provides a method and a device for checking K line data, computer equipment and a computer readable storage medium, which can solve the technical problem of low checking efficiency of the K line data in the prior art.
In a first aspect, the present invention provides a method for checking K-line data, including: acquiring a plurality of preset security codes, and acquiring the number of K lines corresponding to the preset type K line of each preset security code in parallel from a preset K line database on the basis of the preset K line sequence number contained in the preset type K line according to the preset security codes; comparing the number of the K lines with a preset target number corresponding to the preset type K line, and judging whether the number of the K lines is consistent with the preset target number; and if the number of the K lines is not consistent with the preset target number, judging that the preset type K lines are abnormal K lines.
In a second aspect, the present invention further provides a K-line data inspection apparatus, including: the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a plurality of preset security codes and acquiring the number of K lines corresponding to the preset type K line of each preset security code in parallel from a preset K line database based on the preset K line sequence number contained in the preset type K line according to the preset security codes; the first judging unit is used for comparing the number of the K lines with a preset target number corresponding to the preset type K line and judging whether the number of the K lines is consistent with the preset target number or not; and the first judging unit is used for judging the preset type K line as an abnormal K line if the number of the K lines is inconsistent with the preset target number.
In a third aspect, the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the K-line data checking method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of the K-line data inspection method.
The invention provides a method and a device for checking K-line data, computer equipment and a computer readable storage medium. The invention obtains a plurality of preset security codes, parallelly obtains the number of K lines corresponding to the preset type K lines of each preset security code based on the preset K line sequence number contained in the preset type K lines according to the preset security codes, compares the number of the K lines with the preset target number corresponding to the preset type K lines, judges whether the number of the K lines is consistent with the preset target number, judges that the preset type K lines are abnormal K lines if the number of the K lines is not consistent with the preset target number, judges that the preset K lines are normal K lines if the number of the K lines is consistent with the preset target number, obtains the number of the K lines corresponding to the preset type K lines by means of the preset K line sequence number contained in the preset type K lines, and parallelly checks the number of the K lines corresponding to the preset type K lines of each of the plurality of security codes, the system can realize timely inspection of a large amount of K line data in the preset K line database, especially can realize timely inspection of a large amount of K line data put in storage on the same day, can greatly shorten the inspection time for inspecting the K line data stored in the preset K line database as the historical K line, improves the inspection efficiency of the historical K line, especially can find abnormal K line data in time, and further timely guarantees the completeness and correctness of the historical K line in the preset K line database.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a K-line data inspection method according to an embodiment of the present invention;
FIG. 2 is a first sub-flowchart of a K-line data checking method according to an embodiment of the present invention;
FIG. 3 is a second sub-flowchart of a K-line data checking method according to an embodiment of the present invention;
FIG. 4 is a third sub-flowchart of the method for checking K-line data according to the embodiment of the present invention;
FIG. 5 is a fourth sub-flowchart of the method for checking K-line data according to the embodiment of the present invention;
FIG. 6 is a fifth sub-flowchart of the method for checking K-line data according to the embodiment of the present invention;
FIG. 7 is a schematic block diagram of a K-line data checking apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Referring to fig. 1, fig. 1 is a schematic flow chart of a K-line data inspection method according to an embodiment of the invention. As shown in FIG. 1, the method includes the following steps S11-S14:
s11, obtaining a plurality of preset security codes, and obtaining the number of K lines corresponding to the preset type K lines of each preset security code in parallel from a preset K line database according to the preset security codes and based on the preset K line sequence numbers contained in the preset type K lines.
The K lines are K lines, the K lines in the stock market and the futures market are drawn according to the opening price, the highest price, the lowest price and the closing price of each time analysis period, the types of the K lines comprise minute K lines, day K lines, week K lines and month K lines, and the conditions corresponding to different time analysis periods respectively take minutes as the time analysis period (for example, 1 minute K lines or 5 minutes K lines), trade days as the time analysis period, one week as the time analysis period, one month as the time analysis period and the like.
The preset K line sequence number is used for describing the sequence of the K line and the time interval corresponding to the K line in the preset time period. For example, when storing the K-line data with a security trading day as a preset time period, if the trading time of the security trading day is 9:30 to 11:30 am, for the 1-minute K-line, the 1-minute K-line described in the market between 30 minutes at 9 am and 31 minutes at 9 am is the first K-line, the corresponding K line number 1 of the first K line is used for describing the K line sequence of the 1 st 1 minute K line, meanwhile, the time sequence of the time interval corresponding to 30 minutes at 9 am to 31 minutes at 9 am in the security trading day is described, similarly, the 1 minute K line described by the market between 31 minutes at 9 am and 32 minutes at 9 am is the second K line, the K line number 2 corresponding to the second K line is used to describe the K line sequence of the 2 nd 1 minute K line, also described is the time sequence of the time interval corresponding to 31 minutes at 9 am to 32 minutes at 9 am in the securities trading day.
Specifically, when all the K lines included in the preset type K lines of the preset security codes are sequentially stored in the preset K line database, the K lines may be stored according to a time sequence corresponding to the time interval of the quotation described by the K lines, and the K lines are correspondingly numbered according to the time sequence, so that the K lines stored in the preset K line database are a K line set composed according to the time sequence, and the K lines included in the K line set are sequentially numbered according to the corresponding time sequence, and at the same time, the K line serial numbers corresponding to the K lines may be obtained, that is, the K line serial numbers of the K lines and the time interval corresponding to the quotation are in a fixed correspondence relationship, the K line serial numbers may be described by serial number KEY, the serial number VALUEs (i.e., VALUEs) corresponding to the serial number KEY describe specific serial numbers of the K lines, the K line serial numbers are also sorted in the time sequence, and in the case that the K lines are not missing, the largest K-line sequence number may describe the number of K-lines corresponding to the number of all K-lines. For example, referring to table 1, when storing K-line data with a security trading day as a preset time period, if the trading time of the security trading day is 9:30 to 11:30 am and 13:00 to 15:00 pm, for 1 minute K-line, the K-line should be 240 in total, the 1 minute K-line corresponding to the time interval between 30 minutes am and 31 minutes am is the first K-line, the K-line sequence number of the first K-line is fixed to the time interval between 30 minutes am and 31 minutes am of the security trading day, the 1 minute K-line corresponding to the time interval between 31 minutes am and 32 minutes am may be the second K-line, and the K-line sequence number of the second K-line is fixed to the time interval between 31 minutes am and 32 minutes am of the security trading day, if the third K line is absent, the K line sequence number of the fourth K line fixedly corresponds to the time interval between 33 minutes at 9 am and 34 minutes at 9 am, so that the time interval corresponding to the K line time of the K line and the K line sequence number of the K line are in a fixed corresponding relationship, and by analogy, the time interval corresponding to the K line sequence number (that is, the time interval corresponding to the market scenario described by the K line, which may also be referred to as K line time or market scenario time) can be determined according to the K line sequence number of the K line, as shown in table 1, the K line time corresponding to the K line sequence number of the first K line is the time interval between 30 minutes at 9 am and 31 minutes at 9 am, and when the 1 minute K line is not missing, a total of 240K lines for 1 minute are available on one stock exchange day. Referring to table 2, table 2 is an example of 239K lines in total in the case of missing the 2 nd K line.
Table 1
Figure 511410DEST_PATH_IMAGE001
Table 2
Figure 223625DEST_PATH_IMAGE002
Further, the step of acquiring a plurality of preset security codes comprises:
and traversing a preset security code list to obtain a plurality of preset security codes contained in the preset security code list.
Specifically, for the securities industry, because the securities code is more, to the securities code that needs to carry out K line inspection, can store all securities codes through setting up the securities code list in advance, to more securities code, further through the mode of traversing preset securities code list is traversed in order to obtain a plurality of preset securities codes that preset securities code list contains, can be orderly carry out the inspection to the K line data of all securities codes to avoid omitting the K line data of securities code, perhaps repeatedly inspect the K line data of a certain securities code, improve the efficiency that obtains preset securities code in proper order, and then can improve the efficiency of K line data inspection.
When checking K line data of all security codes, a preset security code list can be traversed, a plurality of preset security codes contained in the preset security code list are sequentially obtained, the number of all preset K line sequence numbers is counted according to the security codes and based on preset K line sequence numbers contained in preset type K lines in a preset K line database, the number of K lines contained in the preset type K lines is further obtained, or all K lines contained in the preset type K lines are sequentially taken out from the preset K line database according to the preset K line sequence numbers, the number of K lines corresponding to all K lines is counted, the number of K lines corresponding to each preset type K line of each security code is obtained from the preset K line database, and the number of K lines corresponding to each preset type K line of the plurality of security codes can be obtained in parallel, the preset type K line can be a minute K line, a day K line, a week K line, a month K line, a season K line and other types of K lines. For example, on a security trading day, if the preset type K line is a 1-minute K line, for the security code a, the number KA1 of K lines corresponding to the number of all K lines included in the 1-minute K line of the security code a may be obtained according to the preset number KA lines included in the 1-minute K line, the number KA3 of K lines corresponding to 3-minute K lines of the security code a may be obtained, the number KA5 of K lines corresponding to 5-minute K lines of the security code a may be obtained, the numbers KA1 of K lines corresponding to 1-minute K lines of the security code B may be obtained, and the numbers KB3 of K lines corresponding to 3-minute K lines of the security code B may be obtained in parallel.
S12, comparing the number of the K lines with a preset target number corresponding to the preset type K line, and judging whether the number of the K lines is consistent with the preset target number.
Specifically, since the K lines are plotted every time analysis period, the number of K lines of the K lines within a preset time period can be predetermined. For example, for a preset type of K lines, which are minute K lines, if the trading time per security trading day is 4 hours, there should be 240K lines for 1 minute, 80K lines for 3 minutes, 48K lines for 5 minutes, etc. within one security trading day. Therefore, if the number of K lines of the preset type K line of the preset security code is to be checked, the preset target number corresponding to the preset type K line may be predetermined according to the preset time period.
And after the K line number corresponding to the preset type K line of the security code is obtained, comparing the K line number with the preset target number corresponding to the preset type K line, and judging whether the K line number is consistent with the preset target number.
S13, if the number of the K lines is not consistent with the preset target number, judging that the preset type K lines are abnormal K lines;
and S14, if the number of the K lines is consistent with the preset target number, judging that the preset type K lines are normal K lines.
Specifically, whether the number of the K lines is consistent with the preset target number or not is judged, if the number of the K lines is inconsistent with the preset target number, the preset type K lines are judged to be abnormal K lines, namely, the K lines contained in the preset type K lines have abnormal problems such as K line loss, and if the number of the K lines is consistent with the preset target number, the preset type K lines are judged to be normal K lines. For example, on the aforementioned stock exchange day, if the 1 minute K line of the stock code a is to be checked, the K line number KA1 of the 1 minute K line of the stock code a may be obtained from a preset K line database, it is determined whether the K line number KA1 is 240, if the K line number KA1 is 240, it is determined that the K line number of the 1 minute K line of the stock code a in the preset K line database is correct, and if the K line number KA1 is not 240, it is determined that the K line number of the 1 minute K line of the stock code a in the preset K line database is abnormal, and the K line numbers corresponding to the preset type K lines of the respective plurality of stock codes such as the stock code a, the stock code B, and the stock code C may also be checked simultaneously and in parallel.
In the embodiment of the invention, a plurality of preset security codes are obtained, the number of K lines corresponding to the preset type K line of each preset security code is obtained in parallel according to the preset security code and based on the preset K line sequence number contained in the preset type K line, the number of the K lines is compared with the preset target number corresponding to the preset type K line, whether the number of the K lines is consistent with the preset target number or not is judged, if the number of the K lines is not consistent with the preset target number, the preset type K line is judged to be an abnormal K line, if the number of the K lines is consistent with the preset target number, the preset K line is judged to be a normal K line, the number of the K lines corresponding to the preset type K line is obtained by means of the preset K line sequence number contained in the preset type K line, and the number of the K lines corresponding to the preset type K line of each of the plurality of security codes is checked in parallel, the system can realize timely inspection of a large amount of K line data corresponding to the financial market index data after calculation and processing in the preset K line database, particularly can realize timely inspection of a large amount of K line data stored in a warehouse on the same day, can greatly shorten the inspection time for inspecting the K line data stored in the preset K line database as historical K lines, improve the inspection efficiency of the historical K lines, particularly can timely find abnormal K line data, and further timely guarantee the completeness and correctness of the historical K lines in the preset K line database.
Referring to fig. 2, fig. 2 is a schematic sub-flowchart of a method for checking K-line data according to an embodiment of the present invention. As shown in fig. 2, in this embodiment, after the step of determining that the preset type K line is an abnormal K line if the number of the K lines is not consistent with the preset target number, the method further includes:
s15, acquiring sequence numbers of two adjacent preset K lines according to the sequence of all the sequence numbers of the preset K lines contained in the abnormal K lines, and calculating the difference value of the sequence numbers of the two adjacent preset K lines;
s16, judging whether the difference value is larger than 1;
s17, if the difference value is larger than 1, acquiring a middle sequence number included between two adjacent preset K line sequence numbers, taking the middle sequence number as a missing K line sequence number corresponding to a missing K line, and storing the missing K line sequence number into a preset missing K line data cache table;
and S18, if the difference is not greater than 1, further processing is not needed according to the sequence numbers of the two adjacent preset K lines.
Specifically, for an abnormal K line, it may be further determined which specific K lines included in the abnormal K line are missing. For example, for the above-mentioned 1-minute K line, on one stock exchange day, there should be 240 1-minute K lines, but if the number of K lines of 1-minute K lines of a certain stock code in the preset K line database is 238, it can be determined that 2 of the 1-minute K lines of the stock code are missing, and it can be further determined which two 1-minute K lines are missing. Because the preset K line serial numbers of the K lines have a corresponding relation with the K line time of the K lines and the preset K line serial numbers are sequentially numbered in a time sequence, the difference value between the preset K line serial numbers of two adjacent K lines is required to be 1, so that two adjacent preset K line serial numbers can be obtained at one time according to the sequence of all the preset K line serial numbers contained in the abnormal K lines, for example, the sequence of the preset K line serial numbers from large to small or the sequence of the preset K line serial numbers from small to large, the difference value of two adjacent preset K line serial numbers is calculated, whether the difference value is larger than 1 or not is judged, if the difference value is not larger than 1, the absence of the K lines between the two adjacent preset K line serial numbers is judged, the next pair of adjacent two preset K line serial numbers is obtained without further processing according to the two adjacent preset K line serial numbers, and calculating the difference value of the next pair of adjacent preset K line serial numbers, judging again, if the difference value is greater than 1, judging that the two adjacent preset K line serial numbers have K line loss, acquiring the intermediate serial numbers contained between the two adjacent preset K line serial numbers, taking the intermediate serial numbers as the lost K line serial numbers corresponding to the lost K lines, storing the lost K line serial numbers to a preset lost K line data cache table, acquiring the next pair of adjacent two preset K line serial numbers, calculating the difference value of the next pair of adjacent two preset K line serial numbers, judging again, and circulating the process until all the two adjacent preset K line serial numbers are judged. For example, if two adjacent predetermined K line sequence numbers are 2 and 3 respectively, the difference between the two is 1, there is no K line miss in the two adjacent predetermined K line sequence numbers, if two adjacent predetermined K line sequence numbers are 2 and 5 respectively, the difference between the two is 3, there is a K line miss in the two adjacent predetermined K line sequence numbers, the middle sequence numbers included between 2 and 5 are 3 and 4, 3 and 4 are respectively used as the missing K line sequence numbers corresponding to the missing K lines, and the missing K line sequence numbers are stored in the predetermined missing K line data cache table, and 2K lines are missed. Therefore, when the preset type K line is an abnormal K line, the K line serial number of the missing K line can be rapidly determined by calculating the difference value of the serial numbers of the two adjacent preset K lines through the preset K line serial numbers contained in the preset type K line.
Further, referring to fig. 3, fig. 3 is a second sub-flowchart of the method for checking K-line data according to the embodiment of the present invention. As shown in fig. 3, in this embodiment, the step of storing the missing K line sequence number into a preset missing K line data cache table includes:
s171, determining abnormal security codes corresponding to the abnormal type K lines according to the abnormal type K lines to which the missing K lines corresponding to the missing K line sequence numbers belong;
s172, determining a preset abnormal structure corresponding to the abnormal security code contained in a preset data container Unordered _ map according to the abnormal security code;
s173, determining a preset abnormal storage sub map table corresponding to the abnormal type K line contained in the preset abnormal structure according to the abnormal type K line;
and S174, storing the missing K line sequence number to a column corresponding to the missing sequence number key contained in a preset abnormal memory sub map table.
Specifically, for the serial number of the missing K line corresponding to the missing K line, a preset missing K line data cache table may be set based on the data container Unordered _ map, and is used to store the serial number of the missing K line, so as to supplement the corresponding missing K line according to the serial number of the missing K line in the following. For a preset data container Unordered _ map, security codes can be used as KEY, each preset security code generally comprises multiple types of K lines, and aiming at the possible situation that the multiple types of K lines contained in the same security code have missing K lines, in order to save the storage space for storing the serial numbers of the missing K lines of the multiple types of K lines, the storage structure for storing the serial numbers of the missing K lines is optimized, the storage efficiency of the serial numbers of the missing K lines is improved, each security code serving as a KEY VALUE VALUE corresponding to the KEY can be set into a structural body (namely a preset abnormal structural body), the preset abnormal structural body comprises a preset abnormal storage sub-map table corresponding to each type of K lines of the preset security codes, the missing K line sequence numbers are stored into the preset abnormal storage sub-map table, and therefore, the security code can store the missing K line sequence numbers corresponding to the multiple types of K lines through one structural body, especially for a large number of security codes in the security industry, if the K line data stored in the stock in the same day is checked, the large number of security codes have more missing K line serial numbers, and the K line data check is required every security trading day, more missing K line serial number data and larger system overhead are generated, so that the structure can be fully utilized to optimize the storage structure for storing the missing K line serial numbers, the storage space for storing the missing K line serial numbers of various types of K lines is saved, the storage efficiency for the missing K line serial numbers and the utilization rate of memory resources are improved, and the performance of the whole K line service system is improved. Further, the sub-KEY of the preset abnormal storage sub-map table may be the missing K line order number, the KEY VALUE corresponding to the sub-KEY may be a processing state of the K line corresponding to the missing K line order number, if the K line corresponding to the missing K line order number is repaired, the processing state of the K line corresponding to the missing K line order number may be set to "processed", and if the K line corresponding to the missing K line order number is not repaired, the processing state of the K line corresponding to the missing K line order number may be set to "unprocessed", so as to facilitate following up the processing progress of the K line corresponding to the missing K line order number, thereby improving the processing efficiency of the K line corresponding to the missing K line order number. For example, for a1 minute K line, a5 minute K line, a 15 minute K line, a 30 minute K line, a 60 minute K line, and a 120 minute K line included in a security code, an Unordered _ map may be set as a data cache table of default missing K lines, with the security code as a KEY, and a KEY Value corresponding to each KEY is a structure n (map 1, map5, map15, map30, map60, map 120), which is a default exception structure composed of 6 sub-map tables of map1, map5, map15, map30, map60, and map120, where the 6 sub-maps are storage sub-map tables of default exceptions corresponding to each type K line, where the sub-map 1 table is used for storing missing K line data of the 1 minute K line, the sub-map 5 table is used for storing missing K line data of the 5 minute K line, the sub-map 15 table is used for storing missing data of each type K line, and the number of missing sub-map tables of each type K lines is used for storing missing data of the type K lines, and the KEY lines of 15 minutes, value corresponding to KEY is the processing state of the missing K line corresponding to the missing K line sequence number, if the security code is a stock and a certain K line of the stock is lost, the missing K line sequence number corresponding to the missing K line is calculated, and the missing K line sequence number KEY is added to the corresponding sub-map table, so that the missing K line sequence number is stored in a preset missing K line data cache table.
When the missing K line sequence number is stored in a preset missing K line data cache table, according to an abnormal type K line to which the missing K line corresponding to the missing K line sequence number belongs, for example, the missing K line corresponding to the missing K line sequence number is a 1-minute K line, a 5-minute K line or a 15-minute K line, the K line type (i.e., abnormal type K line) corresponding to the K line corresponding to the missing K line sequence number can be determined, according to the abnormal type K line, an abnormal security code corresponding to the abnormal type K line is determined, according to the abnormal security code, a preset abnormal structure body corresponding to the abnormal security code included in a preset data container Unordered _ map is determined, according to the abnormal type K line, a preset abnormal storage sub map table corresponding to the abnormal type K line included in the preset abnormal structure body is determined, and finally the missing K line sequence number is stored in a column corresponding to a missing sequence number key word included in a preset abnormal storage sub map table .
Referring to fig. 4, fig. 4 is a third sub-flowchart of the method for checking K-line data according to the embodiment of the present invention. As shown in fig. 4, in this embodiment, after the step of storing the missing K-line sequence number into a preset missing K-line data cache table, the method further includes:
s19, acquiring the missing K line sequence number, and determining the quotation time of the quotation described by the missing K line corresponding to the missing K line sequence number according to the missing K line sequence number;
s20, acquiring initial market data corresponding to the market time according to the market time;
and S21, calculating the missing K line corresponding to the initial market data based on the initial market data, and storing the missing K line to the missing position of the K line corresponding to the missing K line in the preset K line database.
Specifically, since the K line serial number of the K line is in a fixed corresponding relationship with the time interval (i.e., the market time) corresponding to the market, after the missing K line serial number is obtained, the market time of the market described by the missing K line corresponding to the missing K line serial number can be determined according to the missing K line serial number, and then the initial market data corresponding to the market time can be obtained according to the market time, for example, the snapshot message can be consumed from Kafka to obtain the initial market data corresponding to the market time, and finally the missing K line corresponding to the initial market data is calculated based on the initial market data and is stored in the missing K line position corresponding to the missing K line in the preset K line database, that is, the missing K line is stored at the storage position corresponding to the initial preset storage order of the K line, meanwhile, the serial number of the missing K line is removed from the preset missing K line data cache table, so that missing of the stored K line data can be automatically and timely found out every day, automatic repairing of the missing K line is achieved, integrity and correctness of the historical K line in the preset K line database are guaranteed, and through K line data inspection, only the missing K line is repaired, compared with the fact that the checking and repairing of the K line data are achieved through calculating all K line data, the method not only achieves automatic finding of the local few missing K lines, but also enables the generated new correct K line to be locally recalculated and stored, achieves repairing of the K line data with small calculation amount, improves efficiency of repairing the data, and saves calculation resources of computer equipment.
Further, referring to fig. 5, fig. 5 is a fourth sub-flowchart of the method for checking K-line data according to the embodiment of the present invention. As shown in fig. 5, in this embodiment, after the step of calculating the missing K line corresponding to the initial market data, the method further includes:
s22, judging whether a related K line of the missing K line exists or not, wherein the related K line is a K line obtained by calculation based on the missing K line;
s23, if the associated K line exists, acquiring an associated K line sequence number corresponding to the associated K line, recalculating the associated K line based on the missing K line according to the associated K line sequence number, and storing the associated K line to an associated K line position corresponding to the associated K line in the preset K line database;
and S24, if the associated K line does not exist, processing is not required to be carried out according to the missing K line.
Specifically, among the plurality of types of K lines, there may be an association between different types of K lines, where some K lines may be calculated on the basis of other K lines. For example, at the same market time on one stock trading day, the 5-minute K line to which the market time belongs is calculated based on the 1-minute K line, and the 15-minute K line is calculated based on the 5-minute K line. Therefore, after the missing K line is determined by the K line data check, and the missing K line is repaired, it is necessary to further determine whether or not there is a correlated K line of the missing K line, and it is possible to determine whether or not there is a K line corresponding to the missing K line by the K line type corresponding to the missing K line, and if the K line type is a 1-minute K line and there are K line types depending on the 1-minute K line, such as a 5-minute K line and a 15-minute K line, it is determined that there is a correlated K line of the missing K line, and if the K line type is a 1-minute K line, there is no K line type depending on the 1-minute K line, such as a 5-minute K line and a 15-minute K line, and it is determined that there is no correlated K line of the missing K line.
Judging whether a correlated K line of the missing K line exists or not, wherein the correlated K line is a K line obtained through calculation based on the missing K line, if the correlated K line exists, obtaining a correlated K line sequence number corresponding to the correlated K line, obtaining related market data in market time corresponding to the correlated K line sequence number according to the correlated K line sequence number, recalculating the correlated K line based on the missing K line, storing the correlated K line to a correlated K line position corresponding to the correlated K line in a preset K line database, and if the correlated K line does not exist, processing according to the missing K line is not needed. For example, if only 1-minute K-line is lost, after repairing the 1-minute K-line, it is necessary to recalculate the K-line calculated from the 1-minute K-line for more than 1 minute, for example, for a 5-minute K-line based on the 1-minute K-line, the dependent 1-minute K-line sequence number index is calculated from the preset K-line number of the 5-minute K-line (5-minute K-line calculates the dependent 1-minute K-line sequence number [ index-5, index ]), the sequence number is converted into the K-line time kline _ time corresponding to the time range, the 1-minute K-line of the time range is taken out from the database, the 5-minute K-line is recalculated, and the recalculated 5-minute K-line is written into the preset K-line database. Meanwhile, since all the K lines of more than 5 minutes are affected by the K lines of 5 minutes, and all the K lines of more than 5 minutes need to be recalculated, the index number of 1 minute needs to be converted into the K line numbers of more than 5 minutes, such as the K line of 15 minutes, the K line of 30 minutes and the like, the range of the dependent K line of 1 minute needs to be calculated, the related quotation is taken out from the database for calculation, the calculated K line numbers are correspondingly updated into the database, if the updated K line numbers of the K lines exist in the preset missing K line data cache table, the updated K line numbers of the K lines are removed from the preset missing K line data cache table, and the processes are sequentially executed until the K lines of 120 minutes are completed. Similarly, the method for updating the K line in 15 minutes is the same as the method for updating the K line in 5 minutes, the influence range is the K line which is more than 15 minutes, the K line in 30 minutes is updated, the method is the same as the method for updating the K line in 5 minutes, the influence range is the K line which is more than 30 minutes, and the like are repeated until all the related K lines are updated.
Referring to fig. 6, fig. 6 is a fifth sub-flowchart of the method for checking K-line data according to the embodiment of the present invention. As shown in fig. 6, in this embodiment, after the step of storing the missing K line sequence number in a preset missing K line data cache table, the method further includes:
s25, counting the number of the serial numbers of all the missing K line serial numbers contained in the preset missing K line data cache table;
s26, judging whether the number of the serial numbers is larger than a preset number threshold value;
s27, if the number of the serial numbers is larger than a preset number threshold, recalculating K lines included in preset type K lines of all the preset security codes to obtain corresponding updated K lines, and replacing the corresponding initial K lines included in the preset K line database with the updated K lines;
and S28, if the number of the serial numbers is less than or equal to a preset number threshold, executing the step of obtaining the missing K line serial numbers and determining the market time of the market described by the missing K line corresponding to the missing K line serial numbers according to the missing K line serial numbers.
Specifically, when the number of missing K lines exceeds the number of K lines corresponding to the preset number threshold, the missing K lines are checked and repaired to realize that the back-repair corresponding data calculation amount of the K lines is too large, at this time, the K lines included in all preset type K lines of the preset security codes can be recalculated directly in a way of re-consuming snapshots to obtain corresponding updated K lines, and the updated K lines replace the corresponding initial K lines included in the preset K line database, especially for the timely inspection and repair of the day K line data, the day minute K lines can be recalculated and completely supplemented into the preset K line database, so that the completeness and correctness of the K line data of the preset K line database can be realized more quickly, and the repair way of the K line data of the preset K line database can be dynamically adjusted according to the missing number of the missing K lines, the flexibility and the efficiency of repairing the K line data of the preset K line database can be improved.
It should be noted that, the K-line data inspection methods described in the above embodiments may recombine technical features included in different embodiments as needed to obtain a combined implementation, but all of them are within the protection scope of the present invention.
Referring to fig. 7, fig. 7 is a schematic block diagram of a K-line data checking apparatus according to an embodiment of the present invention. Corresponding to the above-mentioned K-line data inspection method, an embodiment of the present invention further provides a K-line data inspection apparatus. As shown in fig. 7, the K-line data inspection apparatus includes a unit for performing the K-line data inspection method described above, and may be configured in a computer device. Specifically, referring to fig. 7, the K-line data checking apparatus 70 includes a first obtaining unit 701, a first determining unit 702, and a first determining unit 703.
The system comprises a first obtaining unit 701, a second obtaining unit and a third obtaining unit, wherein the first obtaining unit 701 is used for obtaining a plurality of preset security codes and obtaining the number of K lines corresponding to the preset type K line of each preset security code in parallel from a preset K line database according to the preset security codes and based on the preset K line sequence number contained in the preset type K line;
a first determining unit 702, configured to compare the number of K lines with a preset target number corresponding to the preset type K line, and determine whether the number of K lines is consistent with the preset target number;
a first determining unit 703 is configured to determine that the preset type K line is an abnormal K line if the number of the K lines is inconsistent with the preset target number.
In one embodiment, the K-line data checking device 70 further includes:
the second obtaining unit is used for obtaining the serial numbers of two adjacent preset K lines according to the sequence of all the serial numbers of the preset K lines contained in the abnormal K lines and calculating the difference value of the serial numbers of the two adjacent preset K lines;
a second judgment unit, configured to judge whether the difference is greater than 1;
and the storage unit is used for acquiring a middle sequence number contained between two adjacent preset K line sequence numbers if the difference value is greater than 1, taking the middle sequence number as a missing K line sequence number corresponding to a missing K line, and storing the missing K line sequence number to a preset missing K line data cache table.
In one embodiment, the memory unit includes:
the first determining subunit is used for determining the abnormal security code corresponding to the abnormal type K line according to the abnormal type K line to which the missing K line corresponding to the missing K line sequence number belongs;
the second determining subunit is used for determining a preset abnormal structural body corresponding to the abnormal security code contained in a preset data container Unordered _ map according to the abnormal security code;
a third determining subunit, configured to determine, according to the abnormal type K line, a preset abnormal storage sub-map table corresponding to the abnormal type K line included in the preset abnormal structural body;
and the storage subunit is used for storing the missing K line sequence number to a column corresponding to the missing sequence number key contained in a preset abnormal storage sub map table.
In one embodiment, the K-line data checking device 70 further includes:
a third obtaining unit, configured to obtain the missing K line sequence number, and determine, according to the missing K line sequence number, a market time of a market described by a missing K line corresponding to the missing K line sequence number;
the fourth acquisition unit is used for acquiring initial market data corresponding to the market time according to the market time;
and the calculating unit is used for calculating the missing K line corresponding to the initial market data based on the initial market data and storing the missing K line to the missing position of the K line corresponding to the missing K line in the preset K line database.
In one embodiment, the K-line data checking device 70 further includes:
a third judging unit, configured to judge whether there is a related K line of the missing K line, where the related K line is a K line calculated based on the missing K line;
and a fifth obtaining unit, configured to, if the associated K line exists, obtain an associated K line sequence number corresponding to the associated K line, recalculate the associated K line based on the missing K line according to the associated K line sequence number, and store the associated K line to an associated K line position corresponding to the associated K line in the preset K line database.
In one embodiment, the K-line data checking device 70 further includes:
the counting unit is used for counting the number of the serial numbers of all the missing K line serial numbers contained in the preset missing K line data cache table;
a fourth judging unit, configured to judge whether the number of sequence numbers is greater than a preset number threshold;
and the replacing unit is used for recalculating all K lines contained in the preset type K lines of the preset security codes to obtain corresponding updated K lines if the number of the serial numbers is greater than a preset number threshold, and replacing the corresponding initial K lines contained in the preset K line database with the updated K lines.
In an embodiment, the first obtaining unit 701 is specifically configured to traverse a preset security code list and obtain a plurality of preset security codes included in the preset security code list.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation processes of the K-line data checking apparatus and each unit may refer to the corresponding descriptions in the foregoing method embodiments, and for convenience and brevity of description, no further description is provided herein.
Meanwhile, the division and connection manner of each unit in the K-line data inspection apparatus are only used for illustration, in other embodiments, the K-line data inspection apparatus may be divided into different units as required, or each unit in the K-line data inspection apparatus may adopt different connection orders and manners to complete all or part of the functions of the K-line data inspection apparatus.
The above-mentioned K-line data checking apparatus may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 8.
Referring to fig. 8, fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device 500 may be a computer device such as a desktop computer or a server, or may be a component or part of another device.
Referring to fig. 8, the computer device 500 includes a processor 502, a memory, which may include a non-volatile storage medium 503 and an internal memory 504, which may also be a volatile storage medium, and a network interface 505 connected by a system bus 501.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, causes the processor 502 to perform a method for checking K-line data as described above.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 may be enabled to execute a method for checking K-wire data as described above.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 8 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 500 to which aspects of the present invention may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are consistent with those of the embodiment shown in fig. 8, and are not described herein again.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps: acquiring a plurality of preset security codes, and acquiring the number of K lines corresponding to the preset type K line of each preset security code in parallel from a preset K line database on the basis of the preset K line sequence number contained in the preset type K line according to the preset security codes; comparing the number of the K lines with a preset target number corresponding to the preset type K line, and judging whether the number of the K lines is consistent with the preset target number; and if the number of the K lines is not consistent with the preset target number, judging that the preset type K lines are abnormal K lines.
In an embodiment, after the processor 502 performs the step of determining that the preset type K line is an abnormal K line if the number of K lines is not consistent with the preset target number, the following steps are further performed:
acquiring two adjacent preset K line serial numbers according to the sequence of all the preset K line serial numbers contained in the abnormal K line, and calculating the difference value of the two adjacent preset K line serial numbers;
judging whether the difference value is larger than 1;
and if the difference value is greater than 1, acquiring a middle sequence number contained between two adjacent preset K line sequence numbers, taking the middle sequence number as a missing K line sequence number corresponding to the missing K line, and storing the missing K line sequence number to a preset missing K line data cache table.
In an embodiment, when the processor 502 implements the step of storing the missing K line sequence number into a preset missing K line data cache table, the following steps are specifically implemented:
determining an abnormal security code corresponding to the abnormal type K line according to the abnormal type K line to which the missing K line corresponding to the missing K line sequence number belongs;
determining a preset abnormal structure corresponding to the abnormal security code contained in a preset data container Unordered _ map according to the abnormal security code;
determining a preset abnormal storage sub map table corresponding to the abnormal type K line contained in the preset abnormal structure according to the abnormal type K line;
and storing the missing K line sequence number to a column corresponding to the missing sequence number key word contained in a preset abnormal memory sub map table.
In an embodiment, after the step of storing the missing K-line sequence number into a preset missing K-line data cache table, the processor 502 further performs the following steps:
acquiring the missing K line sequence number, and determining the quotation time of the quotation described by the missing K line corresponding to the missing K line sequence number according to the missing K line sequence number;
acquiring initial market data corresponding to the market time according to the market time;
and calculating the missing K line corresponding to the initial market data based on the initial market data, and storing the missing K line to a K line missing position corresponding to the missing K line in the preset K line database.
In an embodiment, after the step of calculating the missing K line corresponding to the initial market data, the processor 502 further implements the following steps:
judging whether a related K line of the missing K line exists or not, wherein the related K line is a K line obtained by calculation based on the missing K line;
and if the associated K line exists, acquiring an associated K line sequence number corresponding to the associated K line, recalculating the associated K line based on the missing K line according to the associated K line sequence number, and storing the associated K line to an associated K line position corresponding to the associated K line in the preset K line database.
In an embodiment, after the step of storing the missing K-line sequence number into a preset missing K-line data cache table, the processor 502 further performs the following steps:
counting the number of the serial numbers of all the missing K line serial numbers contained in the preset missing K line data cache table;
judging whether the number of the serial numbers is greater than a preset number threshold value or not;
if the number of the serial numbers is larger than a preset number threshold value, recalculating the K lines contained in the preset type K lines of all the preset security codes to obtain corresponding updated K lines, and replacing the corresponding initial K lines contained in the preset K line database with the updated K lines.
In an embodiment, when the processor 502 implements the step of acquiring a plurality of preset security codes, the following steps are specifically implemented:
and traversing a preset security code list to obtain a plurality of preset security codes contained in the preset security code list.
It should be understood that, in the embodiment of the present invention, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, 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, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiments may be implemented by a computer program, and the computer program may be stored in a computer readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a computer-readable storage medium. The computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, the computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of:
a computer program product which, when run on a computer, causes the computer to perform the steps of the K-line data inspection method described in the embodiments above.
The computer readable storage medium may be an internal storage unit of the aforementioned device, such as a hard disk or a memory of the device. The computer readable storage medium may also be an external storage device of the device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the apparatus.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The storage medium is an entity and non-transitory storage medium, and may be various entity storage media capable of storing computer programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing an electronic device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A K-line data inspection method, comprising:
acquiring a plurality of preset security codes, and acquiring the number of K lines corresponding to the preset type K line of each preset security code in parallel from a preset K line database on the basis of the preset K line sequence number contained in the preset type K line according to the preset security codes;
comparing the number of the K lines with a preset target number corresponding to the preset type K line, and judging whether the number of the K lines is consistent with the preset target number;
if the number of the K lines is not consistent with the preset target number, judging that the preset type K lines are abnormal K lines;
acquiring two adjacent preset K line serial numbers according to the sequence of all the preset K line serial numbers contained in the abnormal K line, and calculating the difference value of the two adjacent preset K line serial numbers;
if the difference value is larger than 1, acquiring a middle sequence number included between two adjacent preset K line sequence numbers, taking the middle sequence number as a missing K line sequence number corresponding to a missing K line, and storing the missing K line sequence number to a preset missing K line data cache table;
the step of storing the missing K line sequence number into a preset missing K line data cache table comprises the following steps:
determining an abnormal security code corresponding to the abnormal type K line according to the abnormal type K line to which the missing K line corresponding to the missing K line sequence number belongs;
determining a preset abnormal structure corresponding to the abnormal security code contained in a preset data container Unordered _ map according to the abnormal security code, wherein the preset abnormal structure comprises a preset abnormal storage sub-map table corresponding to each type of K line of the preset security code, the sub-keyword of the preset abnormal storage sub-map table is the serial number of the missing K line, and the key value corresponding to the sub-keyword is the processing state of the K line corresponding to the serial number of the missing K line;
determining a preset abnormal storage sub map table corresponding to the abnormal type K line contained in the preset abnormal structure according to the abnormal type K line;
and storing the missing K line sequence number to a column corresponding to the missing sequence number key word contained in a preset abnormal memory sub map table.
2. The method for checking K-line data according to claim 1, wherein after the step of storing the missing K-line sequence number in a preset missing K-line data cache table, the method further comprises:
acquiring the missing K line sequence number, and determining the quotation time of the quotation described by the missing K line corresponding to the missing K line sequence number according to the missing K line sequence number;
acquiring initial market data corresponding to the market time according to the market time;
and calculating the missing K line corresponding to the initial market data based on the initial market data, and storing the missing K line to a K line missing position corresponding to the missing K line in the preset K line database.
3. The method for checking K-line data according to claim 2, wherein after the step of calculating the missing K-line corresponding to the initial market data, the method further comprises:
judging whether a related K line of the missing K line exists or not, wherein the related K line is a K line obtained by calculation based on the missing K line;
and if the associated K line exists, acquiring an associated K line sequence number corresponding to the associated K line, recalculating the associated K line based on the missing K line according to the associated K line sequence number, and storing the associated K line to an associated K line position corresponding to the associated K line in the preset K line database.
4. The method for checking K-line data according to claim 1, wherein after the step of storing the missing K-line sequence number in a preset missing K-line data cache table, the method further comprises:
counting the number of the serial numbers of all the missing K line serial numbers contained in the preset missing K line data cache table;
judging whether the number of the serial numbers is greater than a preset number threshold value or not;
if the number of the serial numbers is larger than a preset number threshold value, recalculating the K lines contained in the preset type K lines of all the preset security codes to obtain corresponding updated K lines, and replacing the corresponding initial K lines contained in the preset K line database with the updated K lines.
5. The K-line data inspection method according to claim 1, wherein the step of acquiring a plurality of preset security codes comprises:
and traversing a preset security code list to obtain a plurality of preset security codes contained in the preset security code list.
6. A K-line data inspection apparatus, comprising:
the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a plurality of preset security codes and acquiring the number of K lines corresponding to the preset type K line of each preset security code in parallel from a preset K line database based on the preset K line sequence number contained in the preset type K line according to the preset security codes;
the first judging unit is used for comparing the number of the K lines with a preset target number corresponding to the preset type K line and judging whether the number of the K lines is consistent with the preset target number or not;
the first judging unit is used for judging the preset type K line as an abnormal K line if the number of the K lines is inconsistent with the preset target number;
the second obtaining unit is used for obtaining the serial numbers of two adjacent preset K lines according to the sequence of all the serial numbers of the preset K lines contained in the abnormal K lines and calculating the difference value of the serial numbers of the two adjacent preset K lines;
the storage unit is used for acquiring a middle sequence number contained between two adjacent preset K line sequence numbers if the difference value is larger than 1, taking the middle sequence number as a missing K line sequence number corresponding to a missing K line, and storing the missing K line sequence number into a preset missing K line data cache table;
wherein the storage unit includes:
the first determining subunit is used for determining the abnormal security code corresponding to the abnormal type K line according to the abnormal type K line to which the missing K line corresponding to the missing K line sequence number belongs;
a second determining subunit, configured to determine, according to the abnormal security code, a preset abnormal structure corresponding to the abnormal security code included in a preset data container Unordered _ map, where the preset abnormal structure includes a preset abnormal storage sub-map table corresponding to each type of K line of the preset security code, a sub-keyword of the preset abnormal storage sub-map table is the serial number of the missing K line, and a key value corresponding to the sub-keyword is a processing state of the K line corresponding to the serial number of the missing K line;
a third determining subunit, configured to determine, according to the abnormal type K line, a preset abnormal storage sub-map table corresponding to the abnormal type K line included in the preset abnormal structural body;
and the storage subunit is used for storing the missing K line sequence number to a column corresponding to the missing sequence number key contained in a preset abnormal storage sub map table.
7. A computer device, comprising a memory and a processor coupled to the memory; the memory is used for storing a computer program; the processor is adapted to run the computer program to perform the steps of the method according to any of claims 1-5.
8. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when being executed by a processor, realizes the steps of the method according to any one of claims 1 to 5.
CN202110883859.1A 2021-08-03 2021-08-03 K-line data inspection method and device, computer equipment and readable storage medium Active CN113407525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110883859.1A CN113407525B (en) 2021-08-03 2021-08-03 K-line data inspection method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110883859.1A CN113407525B (en) 2021-08-03 2021-08-03 K-line data inspection method and device, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113407525A CN113407525A (en) 2021-09-17
CN113407525B true CN113407525B (en) 2021-11-09

Family

ID=77688231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110883859.1A Active CN113407525B (en) 2021-08-03 2021-08-03 K-line data inspection method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113407525B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113989011B (en) * 2021-12-28 2022-04-22 深圳华锐分布式技术股份有限公司 Market data processing method and device, computer equipment and readable storage medium
CN116630048B (en) * 2023-06-08 2023-12-22 深圳华锐分布式技术股份有限公司 Trading method, device, equipment and medium based on futures quotation K line

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143138A (en) * 2019-09-22 2020-05-12 苏州浪潮智能科技有限公司 PCIe Bus fault positioning method, system, terminal and storage medium
CN112541824A (en) * 2020-12-11 2021-03-23 中信银行股份有限公司 K-line candle drawing method and system and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10270788B2 (en) * 2016-06-06 2019-04-23 Netskope, Inc. Machine learning based anomaly detection

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143138A (en) * 2019-09-22 2020-05-12 苏州浪潮智能科技有限公司 PCIe Bus fault positioning method, system, terminal and storage medium
CN112541824A (en) * 2020-12-11 2021-03-23 中信银行股份有限公司 K-line candle drawing method and system and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
K线数据库表结构;比特量化;《CSDN》;20171031;第1页 *
探讨股票数据库的设计;洛阳小散户的雪球专栏;《雪球》;20161023;第1-6页 *

Also Published As

Publication number Publication date
CN113407525A (en) 2021-09-17

Similar Documents

Publication Publication Date Title
CN113407525B (en) K-line data inspection method and device, computer equipment and readable storage medium
WO2020220860A1 (en) Blockchain system-based transaction processing method and apparatus
CN107832062B (en) Program updating method and terminal equipment
US11929985B2 (en) Network-based authentication rule cleaning and optimization
CN110990233A (en) Method and system for displaying SOAR by using Gantt chart
CN107133233B (en) Processing method and device for configuration data query
CN108121774B (en) Data table backup method and terminal equipment
CN101533370B (en) Memory abnormal access positioning method and device
CN111382028B (en) Method, device and server for processing date switching errors of batch processing system
CN115547508B (en) Data correction method, data correction device, electronic equipment and storage medium
CN110795308A (en) Server inspection method, device, equipment and storage medium
CN114511314A (en) Payment account management method and device, computer equipment and storage medium
CN114116799A (en) Abnormal transaction loop identification method, device, terminal and storage medium
CN110765148B (en) Service data processing method and device
CN112800040A (en) Service data checking method and device, computer equipment and storage medium
CN112241889A (en) Account detail repairing method, device, equipment and storage medium
CN111857604A (en) Method, apparatus, device and medium for quickly reconstructing packet management mapping reverse lookup table
CN110716747B (en) Program operation efficiency optimization method based on function parameter statistics and terminal equipment
CN116012123B (en) Wind control rule engine method and system based on Rete algorithm
US11868207B2 (en) System, method, and computer program for intelligent self-healing optimization for fallout reduction
CN108876570B (en) Electronic device, method for processing abnormal fund problem and storage medium
CN112035364B (en) Function test result evaluation method and device
CN109885402B (en) Method for testing function output data overflow, terminal equipment and storage medium
CN116187794A (en) Data calibration method, device, electronic equipment and storage medium
CN116755914A (en) Abnormality log investigation method, abnormality log investigation device, computer equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen, Guangdong 518000

Patentee after: Shenzhen Huarui Distributed Technology Co.,Ltd.

Address before: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen, Guangdong 518000

Patentee before: SHENZHEN ARCHFORCE FINANCIAL TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder