Automatic market source switching method, device and equipment and storage medium

By performing data quality and availability tests on the default and backup market data sources, and automatically switching to the optimal backup market data source, the problem of data interruption caused by the failure of a single market data source is solved, ensuring the continuity and accuracy of financial transactions.

CN122023017APending Publication Date: 2026-05-12JIN 10 INFORMATION TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIN 10 INFORMATION TECH LTD
Filing Date
2026-01-30
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In financial transactions, a single market data source is prone to data interruption due to malfunctions, and there is a lack of timely and effective anomaly detection and handling mechanisms.

Method used

By acquiring data from the default and backup market data sources, and performing data quality and availability checks, the system automatically switches to the backup market data source with the best availability, ensuring the continuity and accuracy of trading.

Benefits of technology

It enables timely switching in the event of a market data source failure, ensuring normal trading and data validity, and reducing the risk of system failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122023017A_ABST
    Figure CN122023017A_ABST
Patent Text Reader

Abstract

The invention provides a market information source automatic switching method and device, equipment and a storage medium, and the method comprises the steps: respectively obtaining the market information data of a default market information source and the market information data of a plurality of standby market information sources, carrying out the data quality detection of the market information data of the default market information source, and determining a quality detection result; automatic quality detection is carried out, market information source switching operation is triggered based on a quality detection result, data availability detection is carried out on market information data of a standby market information source, an availability detection result is determined, the standby market information source is provided except a default market information source, and the availability detection is automatically carried out when the market information source needs to be switched; and the target standby market information source is determined and switched based on the availability detection result, so that the timeliness of switching the market information source and the data validity are ensured, and the normal proceeding of the transaction is favorably maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial data processing technology, and in particular to a method, apparatus, device and storage medium for automatic switching of market data sources. Background Technology

[0002] In the financial trading field, the accuracy, real-time nature, and continuity of market data are crucial for trading decisions. Currently, software vendors mainly rely on a single market data source. On the one hand, a single market data source is prone to data interruption due to malfunctions, affecting normal trading. On the other hand, manual intervention is required to detect and handle anomalies, lacking a timely and effective anomaly detection and handling mechanism. Summary of the Invention

[0003] This application provides a method, apparatus, device, and storage medium for automatic switching of market data sources to solve at least one problem existing in the related technology. The technical solution is as follows:

[0004] In a first aspect, embodiments of this application provide a method for automatic switching of market data sources, including: Retrieve market data from the default market data source and market data from several backup market data sources respectively; Perform data quality testing on the market data from the default market data source and determine the quality testing results; Based on the quality inspection results, a market data source switching operation is triggered, and data availability tests are performed on the market data of the backup market data sources to determine the availability test results. Based on the availability test results, a target backup market data source is identified and switched to.

[0005] In one implementation, the step of performing data quality testing on the market data from the default market data source and determining the quality testing result includes: Perform an integrity check on the market data from the default market data source to determine whether the data is complete and obtain the integrity check result; The market data from the default market data source is updated with timeliness detection to determine whether the time difference between the update time and the current time is greater than a time threshold, and the timeliness detection result is obtained. The market data from the default market data source is subjected to rule validation to determine whether the data meets the data rule restrictions, and the rule validation result is obtained. The quality inspection results include the integrity inspection results, the timeliness inspection results, and the rule verification results.

[0006] In one implementation, triggering the market data source switching operation based on the quality inspection result includes: When the integrity detection result is that the data is incomplete, or the timeliness detection result is that the time difference is greater than the time threshold, the market data source switching operation is triggered; If the integrity detection result indicates that the data is complete and the timeliness detection result indicates that the time difference is less than or equal to the time threshold, and if the rule verification result indicates that the data does not meet the data rule restrictions, an alarm is issued to prompt the user to trigger the market data source switching operation.

[0007] In one implementation, the step of performing data availability testing on the market data of the backup market data sources and determining the availability test results includes: The integrity of the market data from each of the backup market data sources is checked to determine whether the market data from each backup market data source is complete, and the integrity check result corresponding to the market data from each backup market data source is obtained. The update timeliness of the market data of each backup market data source is checked to determine whether the time difference between the update time of the market data of each backup market data source and the current time is greater than a time threshold, and the timeliness check result corresponding to the market data of each backup market data source is obtained. Determine the similarity between the market data of each of the backup market data sources and the market data of the default market data source; The availability detection results include the integrity detection results corresponding to the market data of each backup market data source, the timeliness detection results corresponding to the market data of each backup market data source, and the similarity between the market data of each backup market data source and the market data of the default market data source.

[0008] In one implementation, determining the similarity between the market data of each of the backup market data sources and the market data of the default market data source includes: According to the preset trading indicator rules, a number of first indicator data corresponding to a specified trading indicator are extracted from the market data of each of the backup market data sources, and a number of second indicator data corresponding to the specified trading indicator are extracted from the market data of the default market data source. Candidate market data sources are determined from the backup market data sources. Based on the first indicator data and the second indicator data corresponding to each specified trading indicator of the candidate market data sources, the data deviation value corresponding to each specified trading indicator is determined respectively. Normalize the data deviation values ​​corresponding to each of the specified trading indicators, calculate the average deviation value based on the normalized data deviation values ​​corresponding to all the specified trading indicators, and return to the step of determining the candidate market data source from the backup market data source, until the average deviation value of each backup market data source is determined. The average deviation value of each of the backup market data sources is used as the similarity to the market data of the default market data source.

[0009] In one implementation, determining the target backup market data source and switching it based on the availability detection result includes: Among all the backup market data sources, the available market data sources are those whose market data integrity test result is complete and whose timeliness test result is that the time difference between the market data update time and the current time is less than or equal to the time threshold. When there is only one available market data source, the available market data source is designated as the target backup market data source and switched to it. When there are multiple available market data sources, the available market data source with the lowest similarity is identified as the target backup market data source and switched. When the number of available market data sources is zero, the backup market data source with the lowest similarity is identified as the target backup market data source and switched to, or an alarm is issued to prompt the user to select the target backup market data source and switch to.

[0010] In one embodiment, the method further includes: Upon completion of the switch to the target backup market data source, update the market data source configuration of the default market data source according to the target backup market data source; Issue a market data source switching notification and clear the alarm count, which is the number of alarms recorded.

[0011] Secondly, embodiments of this application provide an automatic market data source switching device, comprising: The acquisition module is used to acquire market data from the default market data source and market data from several backup market data sources. The first detection module is used to perform data quality detection on the market data of the default market data source and determine the quality detection result; The second detection module is used to trigger a market data source switching operation based on the quality detection results, and to perform data availability detection on the market data of the backup market data source respectively, and determine the availability detection results. The switching module is used to determine the target backup market data source and switch to it based on the availability detection results.

[0012] In one implementation, the switching module is further configured to: Upon completion of the switch to the target backup market data source, update the market data source configuration of the default market data source according to the target backup market data source; Issue a market data source switching notification and clear the alarm count, which is the number of alarms recorded.

[0013] Thirdly, embodiments of this application provide an electronic device, including: a processor and a memory, wherein the memory stores instructions that are loaded and executed by the processor to implement the methods in any of the above-described embodiments.

[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed, implements the methods in any of the above-described embodiments.

[0015] The beneficial effects of the above technical solution include at least the following: By acquiring market data from the default market data source and several backup market data sources, the default market data source is subjected to data quality testing. The quality test results are determined, and the automatic quality test triggers a market data source switching operation based on the quality test results. The backup market data sources are subjected to data availability testing, and the availability test results are determined. In addition to the default market data source, backup market data sources are provided. When a market data source needs to be switched, availability testing is automatically performed, and the target backup market data source is determined and switched based on the availability test results. This ensures the timeliness of market data source switching and data validity, which is conducive to maintaining the normal operation of trading.

[0016] The above overview is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, these aspects, embodiments, and features will become readily apparent from the accompanying drawings and the following detailed description. Attached Figure Description

[0017] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments disclosed in this application and should not be construed as limiting the scope of this application.

[0018] Figure 1 This is a flowchart illustrating the steps of an embodiment of the automatic market data source switching method of this application; Figure 2 This is a structural block diagram of an automatic market data source switching device according to an embodiment of this application; Figure 3 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0019] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0020] Reference Figure 1 The flowchart illustrates an embodiment of an automatic market data source switching method according to this application. This automatic market data source switching method may include at least steps S100-S400: S100: Obtain market data from the default market data source and market data from several backup market data sources respectively.

[0021] S200: Perform data quality checks on the market data from the default market data source and determine the quality check results.

[0022] S300: Based on the quality inspection results, trigger the market data source switching operation, perform data availability testing on the market data of the backup market data source respectively, and determine the availability test results.

[0023] S400: Based on the availability test results, determine the target backup market data source and switch to it.

[0024] The technical solution of this application embodiment obtains market data from a default market data source and market data from several backup market data sources respectively. It performs data quality testing on the market data from the default market data source, determines the quality testing result, automatically performs quality testing, and triggers a market data source switching operation based on the quality testing result. It also performs data availability testing on the market data from the backup market data sources respectively, determines the availability testing result, provides backup market data sources in addition to the default market data source, and automatically performs availability testing when it is necessary to switch market data sources. Based on the availability testing result, it determines the target backup market data source and switches to it, ensuring the timeliness of market data source switching and data validity, which is conducive to maintaining the normal operation of transactions.

[0025] In one implementation, the default market data source refers to the market data source currently used by the financial trading system. The financial trading system includes, but is not limited to, stock, foreign exchange, futures, and quantitative trading systems. The backup market data source refers to other market data sources besides the currently used market data source. For example, the market data source can be Polygon, Alltick, Sina, etc., without specific limitations.

[0026] It should be noted that the financial trading system supports various trading instruments, such as stocks, funds, and futures. Each trading instrument has a corresponding default market data source to receive the relevant market data and corresponding trading hours. For example, stock trading hours are 9:30-11:30 and 13:00-15:00 on weekdays. The initial default market data source can be selected by the user (e.g., the system administrator) or automatically set by the system as the first market data source to receive the data. There are no specific restrictions. Furthermore, the market data from the default source and several backup market data sources can be cached in the system for later analysis. Users (e.g., administrators) can pre-configure an initialization configuration file, which can include settings such as backup market data sources (custom deletion or addition), trading instruments (e.g., types, corresponding instrument codes, default market data source), market data for each trading instrument (including trading hours, specified trading indicators), time thresholds, data rules, indicator weights, alarm rules, etc.

[0027] In this embodiment, during system initialization, the system loads the code for all configured trading instruments based on the configuration file, and then sets a default market data source for each instrument. For instruments with a configured default market data source, the system stores the default market data source information in a local cache and a Redis database to ensure that the previous market data source configuration can be restored after a system restart. After initialization, the system enters normal operation. If a certain instrument has not yet been configured with a market data source, the system will automatically set the first market data source that receives market data as the default market data source for that instrument.

[0028] In one implementation, the quality inspection results include integrity inspection results, timeliness inspection results, and rule verification results, and step S200 includes steps S210-S230: S210. Perform an integrity check on the market data from the default market data source to determine whether the data is complete and obtain the integrity check result.

[0029] In this embodiment, an integrity check can be performed at a pre-set interval, and the check is performed during transaction time, not non-transaction time. Furthermore, the transaction time can be divided into active and inactive times, and the interval for the transaction time can be appropriately extended to reduce false positives.

[0030] Optionally, market data may vary for different products. Taking stock market data as an example, the default market data source may include time, price (such as opening price, closing price, highest price, lowest price), trading volume, etc. An integrity check is performed on the default market data source to determine if the data is complete, and the integrity check result is obtained. For example, using a daily candlestick chart, the system checks whether the opening price, closing price, highest price, lowest price, and trading volume for each day are complete. Or, more precisely, it can check 1-minute, 5-minute, and 30-minute candlestick charts to see if the price, trading volume, etc., of each time dimension are complete, thus determining the data's completeness.

[0031] S220. Perform an update timeliness check on the market data from the default market data source, determine whether the time difference between the update time and the current time is greater than the time threshold, and obtain the timeliness check result.

[0032] Optionally, the timeliness of the market data from the default market data source can be checked. Taking stocks as an example, the update time of price and volume in each second of the intraday chart data of each stock (e.g., the final completion time of the update of the two data in one second) can be checked as the real-time update time. The time difference between the real-time update time and the current time is compared with a time threshold to obtain the timeliness check result. If it is greater than the time threshold (adjusted based on the actual situation), it means that there is a problem with the timeliness; otherwise, it means that there is no problem with the timeliness.

[0033] S230. Perform rule verification on the market data of the default market data source to determine whether the data meets the data rule restrictions and obtain the rule verification result.

[0034] Optionally, data rules for rule validation can be specifically set for different types of products. For example, stocks can have corresponding price fluctuation rules (such as ±10% or ±20%). This includes checking for unreasonable price jumps exceeding the fluctuation limits, or instances of spikes that do not conform to the data rules. This process determines the rule validation result. Therefore, if rule validation is performed on the market data from the default market data source and at least one rule is not met, it indicates that the data does not meet the data rule restrictions, and the rule validation result is "data does not meet the data rule restrictions."

[0035] In one implementation, step S300 triggers a market data source switching operation based on the quality inspection results, including steps S310-S320: S310. When the integrity check result is that the data is incomplete, or the timeliness check result is that the time difference is greater than the time threshold, the market data source switching operation is triggered.

[0036] Optionally, when the integrity check result is that the data is incomplete, or the timeliness check result is that the time difference is greater than the time threshold, the system determines that there is an abnormality in the default market data source and automatically triggers the market data source switching operation.

[0037] S320. When the integrity check result is that the data is complete and the timeliness check result is that the time difference is less than or equal to the time threshold, if the rule verification result is that the data does not meet the data rule restrictions, an alarm is issued to prompt the user to trigger the market data source switching operation.

[0038] Optionally, when the integrity check result is that the data is complete and the timeliness check result is that the time difference is less than or equal to the time threshold, if the rule check result is that the data does not meet the data rule restrictions, the system will issue an alarm to prompt the user to trigger the market data source switching operation. At this time, the user (e.g., the administrator) can observe and judge, for example, whether it is an occasional problem or other issues, to determine whether to trigger the market data source switching operation. If it is determined that the market data source switching operation has been triggered, the next step of the process will continue.

[0039] In one implementation, the availability detection results include the integrity detection results corresponding to the market data of each backup market data source, the timeliness detection results corresponding to the market data of each backup market data source, and the similarity between the market data of each backup market data source and the market data of the default market data source. Specifically, step S300 involves performing data availability detection on the market data of each backup market data source to determine the availability detection results, including steps S330-S350: S330. Perform integrity checks on the market data of each backup market data source to determine whether the market data of each backup market data source is complete, and obtain the integrity check result corresponding to the market data of each backup market data source.

[0040] Similarly, based on the principle of S210, the integrity of the market data of each backup market data source can be checked to determine whether the market data of each backup market data source is complete, and the integrity check result corresponding to the market data of each backup market data source can be obtained.

[0041] S340. Perform update timeliness checks on the market data of each backup market data source, determine whether the time difference between the update time of the market data of each backup market data source and the current time is greater than the time threshold, and obtain the timeliness check result corresponding to the market data of each backup market data source.

[0042] Similarly, based on the principle of step S220, the update timeliness of the market data of the backup market data sources can be detected separately, thereby determining whether the time difference between the update time of the market data of each backup market data source and the current time is greater than the time threshold, and obtaining the timeliness detection result corresponding to the market data of each backup market data source.

[0043] S350. Determine the similarity between the market data of each backup market data source and the market data of the default market data source.

[0044] First, according to the preset trading indicator rules, extract the first indicator data corresponding to several specified trading indicators from the market data of each backup market data source, and extract the second indicator data corresponding to several specified trading indicators from the market data of the default market data source.

[0045] It should be noted that different types of products may have different preset trading indicator rules. These preset trading indicator rules can be user-defined specific trading indicators that the user needs to focus on. Taking stocks as an example, the preset trading indicator rules may include price (such as at least one of closing price, opening price, highest price, and lowest price) and trading volume, etc. This allows the system to extract several first indicator data corresponding to the specified trading indicators from the market data of each backup market data source, and several second indicator data corresponding to the specified trading indicators from the market data of the default market data source. The data types of the first and second indicator data are the same.

[0046] Secondly, candidate market data sources are determined from the backup market data sources. Based on the first indicator data and the second indicator data corresponding to each specified trading indicator of the candidate market data sources, the data deviation value corresponding to each specified trading indicator is determined.

[0047] Optionally, a candidate market data source is randomly selected from the backup market data sources. Based on the first indicator data and the second indicator data corresponding to each specified trading indicator of the candidate market data source, the data deviation value corresponding to each specified trading indicator is determined. For example, taking the specified trading indicators including closing price, opening price, highest price, and lowest price as an example, the length of the analysis period can be determined based on preset trading indicator rules, such as one week, one month, or one quarter, etc. Then, using the closing price of the first indicator data and the closing price of the second indicator data, the closing price deviation (absolute value of the difference) for each day in the analysis period is calculated. Then, the average closing price deviation is calculated by summing all closing price deviations. Similarly, the average opening price deviation, average highest price deviation, and average lowest price deviation can be determined. If trading volume is involved, the average trading volume deviation can be determined, which are used as the data deviation values ​​corresponding to each specified trading indicator.

[0048] Then, the data deviation values ​​corresponding to each specified trading indicator are normalized. Based on the normalized data deviation values ​​corresponding to all specified trading indicators, the average deviation value is calculated, and the process of determining candidate market data sources from backup market data sources is repeated until the average deviation value of each backup market data source is determined.

[0049] Optionally, since the first and second indicator data may involve price and trading volume, the data deviation values ​​corresponding to each specified trading indicator can be normalized separately. Based on the normalized data deviation values ​​of all specified trading indicators, the average deviation value is calculated. For example, a corresponding indicator weight can be assigned to each specified trading indicator, and then a weighted calculation can be performed based on the normalized data deviation value and the corresponding indicator weight to obtain the average deviation value of the current candidate market data source. Then, the process returns to the step of determining candidate market data sources from the backup market data sources until the average deviation value of each backup market data source is determined.

[0050] Finally, the average deviation value of each backup market data source is used as the similarity to the market data from the default market data source.

[0051] In one embodiment, step S400 includes steps S410-S440: S410. Among all backup market data sources, identify the available market data sources whose market data integrity test result is complete and whose timeliness test result is that the time difference between the market data update time and the current time is less than or equal to the time threshold.

[0052] Optionally, among all backup market data sources, those with complete market data integrity and a timeliness test result indicating that the time difference between the market data update time and the current time is less than or equal to a time threshold are identified as available market data sources for subsequent switching.

[0053] S420. When there is only one available market data source, the available market data source is identified as the target backup market data source and switched.

[0054] Optionally, when there is only one available market data source, the system directly designates that available market data source as the target backup market data source and switches to it.

[0055] S430. When there are multiple available market data sources, the available market data source with the lowest similarity is identified as the target backup market data source and switched.

[0056] Optionally, when there are multiple available market data sources, the available market data source with the lowest similarity is selected as the target backup market data source and switched.

[0057] S440. When the number of available market data sources is zero, the backup market data source with the lowest similarity is identified as the target backup market data source and switched to, or an alarm is issued to prompt the user to select the target backup market data source and switch to.

[0058] Optionally, when the number of available market data sources is zero, the system can determine the backup market data source with the lowest similarity as the target backup market data source and switch to it. Alternatively, it can issue an alarm to the user, indicating that there are no available market data sources. The alarm message can include the similarity of all backup data sources, allowing the user to decide whether to select an available market data source as the target backup market data source and switch to it.

[0059] In one embodiment, the automatic market data source switching method of this application embodiment may further include steps S510-S520: S510. After completing the switch to the target backup market data source, update the market data source configuration of the default market data source according to the target backup market data source.

[0060] Optionally, upon completing the switch to the target backup market data source, the system updates the market data source configuration of the local cache and the default market data source in Redis based on the determined target backup market data source. For example, if the determined target backup market data source is the Alltick market data source, then the default market data source configuration of the Alltick market data source will be updated to the Alltick market data source configuration. Subsequently, the Alltick market data source will be used as the default market data source, and the original default market data source will become one of the backup market data sources. When periodically analyzing market data sources, the system returns to step S100, enabling continuous data quality checks and switching of the target backup market data source.

[0061] S520: Issue a market data source switching notification and clear the alarm count.

[0062] Optionally, a market data source switch notification can be sent to inform the user which data source has been successfully switched to, while simultaneously clearing the alarm count. It should be noted that the alarm count records the number of alarms issued. Alarms can be those resulting from the aforementioned rule validation that the data does not meet the data rule restrictions, or alarms issued when the number of available market data sources is zero, etc. After clearing the alarm count, users can clearly and intuitively observe the actual number of alarms from the current data source when reviewing the work logs, gaining a clear understanding of the current data source's specific situation.

[0063] Optionally, alerts can be sent via pop-ups, DingTalk, emails, SMS, etc.

[0064] In this embodiment, by introducing a backup market data source, the system automatically analyzes and detects both the default and backup market data sources, determines the target backup market data source for switching, and can process market data from both the backup and default sources concurrently using multiple threads during analysis. This ensures real-time and effective resolution of market data interruptions caused by a single market data source failure, improving the continuity and accuracy of market data. Intelligent integrity and availability detection select the optimal backup market data source for automatic switching, ensuring the accuracy of market data and guaranteeing high availability, thus reducing the risk of system failure. Furthermore, users can dynamically add and configure market data sources to easily adapt to different business needs, providing scalability. Configuration logs and alarm mechanisms facilitate system maintenance and troubleshooting, making it suitable for various financial trading scenarios.

[0065] Reference Figure 2 The diagram illustrates a structural block diagram of an automatic market data source switching device according to an embodiment of this application. The device may include: The acquisition module is used to acquire market data from the default market data source and market data from several backup market data sources. The first detection module is used to perform data quality detection on the market data from the default market data source and determine the quality detection result. The second detection module is used to trigger the market data source switching operation based on the quality detection results, and to perform data availability detection on the market data of the backup market data source to determine the availability detection results. The switching module is used to determine the target backup market data source and switch to it based on the availability test results.

[0066] In one implementation, the switching module is further configured to: After completing the switch to the target backup market data source, update the market data source configuration of the default market data source according to the target backup market data source; Send a notification message about the market data source switch and clear the alarm count. The alarm count is the number of alarms that have been issued.

[0067] The functions of each module in the device of this application embodiment can be found in the corresponding description in the above method, and will not be repeated here.

[0068] Reference Figure 3 The diagram illustrates a structural block diagram of an electronic device according to an embodiment of this application. The electronic device includes a memory 310 and a processor 320. The memory 310 stores instructions that can be executed on the processor 320. The processor 320 loads and executes these instructions to implement the automatic market data switching method described in the above embodiment. The number of memories 310 and processors 320 can be one or more.

[0069] In one embodiment, the electronic device further includes a communication interface 330 for communicating with external devices and exchanging data. If the memory 310, processor 320, and communication interface 330 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0070] Optionally, in a specific implementation, if the memory 310, processor 320 and communication interface 330 are integrated on a single chip, the memory 310, processor 320 and communication interface 330 can communicate with each other through an internal interface.

[0071] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the automatic market data switching method provided in the above embodiments.

[0072] This application also provides a chip, which includes a processor for calling and executing instructions stored in a memory, causing a communication device on which the chip is installed to perform the method provided in this application.

[0073] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in the application embodiment.

[0074] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or 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, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting the Advanced Reduced Instruction Set Computing (RISC) machine (ARM) architecture.

[0075] Further, optionally, the aforementioned memory may include read-only memory and random access memory, and may also include non-volatile random access memory. The memory may be volatile or non-volatile, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0076] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0077] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0078] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0079] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.

[0080] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0081] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.

[0082] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.

[0083] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for automatically switching market data sources, characterized in that, include: Retrieve market data from the default market data source and market data from several backup market data sources respectively; Perform data quality testing on the market data from the default market data source and determine the quality testing results; Based on the quality inspection results, a market data source switching operation is triggered, and data availability tests are performed on the market data of the backup market data sources to determine the availability test results. Based on the availability test results, a target backup market data source is identified and switched to.

2. The automatic market data source switching method according to claim 1, characterized in that: The step of performing data quality testing on the market data from the default market data source and determining the quality testing results includes: Perform an integrity check on the market data from the default market data source to determine whether the data is complete and obtain the integrity check result; The market data from the default market data source is updated with timeliness detection to determine whether the time difference between the update time and the current time is greater than a time threshold, and the timeliness detection result is obtained. The market data from the default market data source is subjected to rule validation to determine whether the data meets the data rule restrictions, and the rule validation result is obtained. The quality inspection results include the integrity inspection results, the timeliness inspection results, and the rule verification results.

3. The automatic market data source switching method according to claim 2, characterized in that: The step of triggering the market data source switching operation based on the quality inspection results includes: When the integrity detection result is that the data is incomplete, or the timeliness detection result is that the time difference is greater than the time threshold, the market data source switching operation is triggered; If the integrity detection result indicates that the data is complete and the timeliness detection result indicates that the time difference is less than or equal to the time threshold, and if the rule verification result indicates that the data does not meet the data rule restrictions, an alarm is issued to prompt the user to trigger the market data source switching operation.

4. The automatic market data source switching method according to any one of claims 1-3, characterized in that: The step of performing data availability testing on the market data from the backup market data sources and determining the availability test results includes: The integrity of the market data from each of the backup market data sources is checked to determine whether the market data from each backup market data source is complete, and the integrity check result corresponding to the market data from each backup market data source is obtained. The update timeliness of the market data of each backup market data source is checked to determine whether the time difference between the update time of the market data of each backup market data source and the current time is greater than a time threshold, and the timeliness check result corresponding to the market data of each backup market data source is obtained. Determine the similarity between the market data of each of the backup market data sources and the market data of the default market data source; The availability detection results include the integrity detection results corresponding to the market data of each backup market data source, the timeliness detection results corresponding to the market data of each backup market data source, and the similarity between the market data of each backup market data source and the market data of the default market data source.

5. The automatic market data source switching method according to claim 4, characterized in that: The step of determining the similarity between the market data of each of the backup market data sources and the market data of the default market data source includes: According to the preset trading indicator rules, a number of first indicator data corresponding to a specified trading indicator are extracted from the market data of each of the backup market data sources, and a number of second indicator data corresponding to the specified trading indicator are extracted from the market data of the default market data source. Candidate market data sources are determined from the backup market data sources. Based on the first indicator data and the second indicator data corresponding to each specified trading indicator of the candidate market data sources, the data deviation value corresponding to each specified trading indicator is determined respectively. Normalize the data deviation values ​​corresponding to each of the specified trading indicators, calculate the average deviation value based on the normalized data deviation values ​​corresponding to all the specified trading indicators, and return to the step of determining the candidate market data source from the backup market data source, until the average deviation value of each backup market data source is determined. The average deviation value of each of the backup market data sources is used as the similarity to the market data of the default market data source.

6. The automatic market data source switching method according to claim 4, characterized in that: The step of determining the target backup market data source and switching it based on the availability detection results includes: Among all the backup market data sources, the available market data sources are those whose market data integrity test result is complete and whose timeliness test result is that the time difference between the market data update time and the current time is less than or equal to the time threshold. When there is only one available market data source, the available market data source is designated as the target backup market data source and switched to it. When there are multiple available market data sources, the available market data source with the lowest similarity is identified as the target backup market data source and switched. When the number of available market data sources is zero, the backup market data source with the lowest similarity is identified as the target backup market data source and switched to, or an alarm is issued to prompt the user to select the target backup market data source and switch to.

7. The automatic market data source switching method according to claim 6, characterized in that: The method further includes: Upon completion of the switch to the target backup market data source, update the market data source configuration of the default market data source according to the target backup market data source; Issue a market data source switching notification and clear the alarm count, which is the number of alarms recorded.

8. An automatic market data source switching device, characterized in that, include: The acquisition module is used to acquire market data from the default market data source and market data from several backup market data sources. The first detection module is used to perform data quality detection on the market data of the default market data source and determine the quality detection result; The second detection module is used to trigger a market data source switching operation based on the quality detection results, and to perform data availability detection on the market data of the backup market data source respectively, and determine the availability detection results. The switching module is used to determine the target backup market data source and switch to it based on the availability detection results.

9. An electronic device, characterized in that, include: A processor and a memory, wherein instructions are stored in the memory and loaded and executed by the processor to implement the method as claimed in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program therein, which, when executed, implements the method as described in any one of claims 1-7.