Financial market data processing method, device, equipment, medium and product

By writing hardware timestamps into the financial market data processing system and constructing a unified time-anchored sequence, combined with a multi-scale structured convolutional model and a large language model of financial corpus, the problem of insufficient time alignment accuracy in financial high-frequency trading systems is solved, and stable and accurate decision-making in high-frequency trading is achieved.

CN120707283APending Publication Date: 2025-09-26INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510819096.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In existing technologies, financial high-frequency trading systems find it difficult to maintain millisecond-level time alignment accuracy during long-term operation, which affects the accuracy and stability of high-frequency trading decisions.

Method used

By acquiring market data and text events from the financial market, writing hardware timestamps and calculating time offsets, a unified time-anchored sequence is constructed. Furthermore, a multi-scale structured convolutional model and a large language model of financial corpus are used to generate a fusion vector to achieve predictive control of jump point risks.

Benefits of technology

It achieves millisecond-level time alignment accuracy in long-term operation, reduces misjudgments in high-frequency trading decisions, and improves the stability and accuracy of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707283A_ABST
    Figure CN120707283A_ABST
Patent Text Reader

Abstract

The invention provides a financial market data processing method and device, equipment, a medium and a product, and relates to the technical field of financial science and technology. Financial market public market information data, text events, arrival moments and source identifiers are taken; market information data containing timestamps are obtained; obtaining a unified time anchoring sequence according to the time offset, the event and the market data containing the timestamp; writing the basic transaction information into an annular buffer area in an ascending order; extracting and denoising features of the buffer area to obtain three-dimensional tensors arranged according to time; building a multi-scale structure convolution model through the three-dimensional tensor and the initial convolution model, and obtaining a multi-scale market feature sequence; obtaining a text event embedding sequence according to the newest volatility interval, the dominant transaction direction vector, the pre-established financial corpus large language model and the anchoring sequence; a fusion vector is obtained through the market features and the embedded sequence; and obtaining a prediction probability and a confidence interval according to the fusion vector and the structure convolution model, and transmitting the probability, the interval and the corresponding time to a risk control end. And the millisecond-level time alignment precision can be maintained during long-term operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology, and in particular to a method, apparatus, equipment, medium and product for processing financial market data. Background Art

[0002] In the multimodal data processing architecture of high-frequency financial trading systems, the time alignment of market data and text events is a key prerequisite for ensuring the accuracy of cross-modal analysis. Since these two heterogeneous data streams have different collection sources and transmission paths, the physical synchronization of their timestamps directly determines the reliability of subsequent analysis.

[0003] In existing technical solutions, a static delay compensation mechanism is generally adopted, that is, the two data pipelines of market data and text events are manually calibrated through pre-measured fixed delay parameters. After actual operation, as network congestion and content distribution paths change, the load fluctuations of the network infrastructure will continuously change the real-time delay characteristics of data transmission. The dynamic optimization strategy of the content distribution network will also lead to random changes in the transmission path. These dynamic factors make the pre-calibrated static parameters quickly lose their timeliness, and it is difficult for the system to maintain millisecond-level time alignment accuracy in long-term operation, which in turn affects the accuracy and stability of high-frequency trading decisions. Summary of the Invention

[0004] The present application provides a financial market data processing method, apparatus, device, medium and product to solve the problem caused by the existing technology that it is difficult to maintain millisecond-level time alignment accuracy in long-term operation.

[0005] In a first aspect, the present application provides a method for processing financial market data, comprising:

[0006] Obtain public market data on financial markets;

[0007] Obtaining text events, arrival times, and source identifiers publicly available in financial markets;

[0008] Writing a hardware timestamp into the market data to obtain market data containing a timestamp;

[0009] Calculating a time offset based on the text event, the arrival time of the text event, and the source identifier, and performing merging processing based on the time offset, the text event, and the market data with timestamps to obtain a unified time anchor sequence;

[0010] Extracting basic transaction information for the same transaction target in sequence according to the unified time anchor sequence, and writing the basic transaction information into a ring buffer of a preset capacity in ascending order;

[0011] Performing microstructure feature extraction and adaptive denoising on the ring buffer to obtain a three-dimensional tensor arranged in time sequence;

[0012] Based on the three-dimensional tensor and the initial convolution model, a multi-scale structured convolution model is constructed and a multi-scale market feature sequence is generated;

[0013] When constructing the multi-scale structure convolutional model, the latest volatility range and the dominant transaction direction vector are read, and a text event embedding sequence is determined based on the latest volatility range, the dominant transaction direction vector, the pre-built financial corpus large language model, and the unified time anchor sequence;

[0014] Obtaining a fusion vector according to the multi-scale market feature sequence and the text event embedding sequence;

[0015] A predicted probability and a confidence interval are obtained based on the fusion vector and the multi-scale structure convolution model, and the predicted probability, the confidence interval, and a corresponding timestamp are output to a risk control end, so that the risk control end can achieve predictive control of the trip point risk.

[0016] In one possible design, obtaining text events disclosed in the financial market, text event arrival times, and source identifiers includes:

[0017] Establish socket channels for different text event sources and configure corresponding independent ring buffers for different socket channels;

[0018] Receive text events sent by different text event sources, and write each text event into a corresponding independent ring buffer through a specific socket channel to record the arrival time of each text event and append the source identifier corresponding to each text event.

[0019] In one possible design, the merging process is performed based on the time offset, the text event, and the market data with timestamp to obtain a unified time-anchored sequence, including:

[0020] Correcting the timestamp of the text event according to the time offset to obtain a text event containing a corrected timestamp;

[0021] The text events containing the correction timestamps are stably sorted and merged in ascending time order to obtain a unified time-anchored sequence.

[0022] In a possible design, the microstructure feature extraction and adaptive denoising processing are performed on the ring buffer to obtain a three-dimensional tensor arranged in time sequence, including:

[0023] Continuously reading the transaction direction indicators and corresponding order cancellation counts of a preset number of transaction targets on the ring buffer to calculate the activity index;

[0024] Dynamically adjust the Hampel window width based on the transaction direction indicator, and perform center-median deviation detection on the price series and depth series. When it is detected that the current point deviates from the median of the current window by more than a preset multiple of the scale statistic and there are no abnormal points in the same direction on both sides, the current point is determined to be an abnormal point and replaced with the most recent valid quote.

[0025] Obtain real-time annualized volatility and, based on the real-time annualized volatility and pre-stored hardware output rate, determine a millisecond sampling interval to perform zero-order hold interpolation on missing quotes within an equally spaced grid. Apply sparse convolution to refine high-frequency information and construct a chronologically ordered three-dimensional tensor.

[0026] In one possible design, the three-dimensional tensor is an equally spaced three-dimensional tensor, and the initial convolution model includes multiple layers of residual convolution blocks;

[0027] Accordingly, the multi-scale structure convolution model is constructed based on the three-dimensional tensor and the initial convolution model, and a multi-scale market feature sequence is generated, including:

[0028] Performing one-dimensional linear projection and splicing processing on the equally spaced three-dimensional tensors to obtain an input base of uniform dimension;

[0029] When the input base of uniform dimension enters the first residual convolution block of the initial convolution model, the dominant driving chain in the scene is explicitly characterized based on three-way cross convolution, so that the convolution receptive field of the initial convolution model is adaptively scaled with the market state, thereby obtaining an adaptive convolution model;

[0030] Applying a strict causal mask to all convolution kernels of the adaptive convolution model to obtain a strict causal convolution model;

[0031] Repeatedly stacking residual blocks on the strictly causal convolutional model to obtain a multi-scale structured convolutional model;

[0032] The multi-scale structure convolution model is subjected to cascading and dimensionality reduction processing on both the channel axis and the layer axis to obtain a multi-scale market feature sequence.

[0033] In one possible design, when constructing the multi-scale structure convolutional model, the latest volatility range and the dominant trading direction vector are read, and a text event embedding sequence is determined based on the latest volatility range, the dominant trading direction vector, a pre-built financial corpus language model, and the unified time anchor sequence, including:

[0034] Traversing the unified time anchor sequence within a sliding window of a preset time length to filter out calibrated message instances;

[0035] When constructing the multi-scale structure convolution model, the latest volatility range and the dominant trading direction vector are read, and text event encoding processing is performed according to the latest volatility range and the dominant trading direction vector to obtain discrete prompt segments;

[0036] constructing the discrete prompt segments into a guided input string, and inputting the guided input string into a pre-built financial corpus large language model based on displayed frozen parameters to output a two-branch result, wherein the two-branch result includes a latent vector;

[0037] performing a source-specific projection operation on the latent vector to obtain a cross-source aligned event representation;

[0038] The cross-source aligned event representation is element-wise scaled by a fluctuation-time double factor decay function to obtain a text event embedding sequence.

[0039] In a second aspect, the present application provides a financial market data processing device, comprising:

[0040] Market data acquisition module, used to obtain public market data from financial markets;

[0041] The text event acquisition module is used to obtain text events disclosed in the financial market, the arrival time of the text events, and the source identification;

[0042] A first writing module is used to write a hardware timestamp into the market data to obtain market data containing a timestamp;

[0043] a unified time anchor sequence acquisition module, configured to calculate a time offset based on the text event, the arrival time of the text event, and the source identifier, and perform a merging process based on the time offset, the text event, and the market data containing the timestamp to obtain a unified time anchor sequence;

[0044] A second writing module is configured to sequentially extract basic transaction information for the same transaction subject according to the unified time anchor sequence, and write the basic transaction information into a ring buffer of a preset capacity in ascending order;

[0045] a three-dimensional tensor acquisition module, configured to perform microstructure feature extraction and adaptive denoising on the ring buffer to obtain a three-dimensional tensor arranged in chronological order;

[0046] A construction module, configured to construct a multi-scale structured convolution model and generate a multi-scale market feature sequence based on the three-dimensional tensor and the initial convolution model;

[0047] a text event embedding sequence acquisition module, configured to read the latest volatility range and the dominant transaction direction vector when constructing the multi-scale structure convolutional model, and determine the text event embedding sequence based on the latest volatility range, the dominant transaction direction vector, the pre-built financial corpus large language model, and the unified time anchor sequence;

[0048] A fusion vector acquisition module, configured to obtain a fusion vector based on the multi-scale market feature sequence and the text event embedding sequence;

[0049] A prediction control module is configured to obtain a prediction probability and a confidence interval based on the fusion vector and the multi-scale structure convolution model, and output the prediction probability, the confidence interval, and the corresponding timestamp to a risk control terminal, so that the risk control terminal can achieve predictive control of the trip point risk.

[0050] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0051] The memory stores computer-executable instructions;

[0052] The processor executes the computer-executable instructions stored in the memory to implement the financial market data processing method provided in the first aspect of the present application.

[0053] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the financial market data processing method provided in the first aspect of the present application.

[0054] Fifthly, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, is used to implement the financial market data processing method provided in the first aspect of the present application.

[0055] The present application provides a financial market data processing method, apparatus, device, medium and product, including: obtaining public market data of the financial market; obtaining text events, text event arrival times and source identifiers disclosed in the financial market; writing hardware timestamps to the market data to obtain market data with timestamps; calculating time offsets based on text events, text event arrival times and source identifiers, and merging the time offsets, text events and market data with timestamps to obtain a unified time anchor sequence; extracting basic transaction information for the same transaction target in sequence based on the unified time anchor sequence, and writing the basic transaction information in ascending order into a ring buffer with a preset capacity; extracting microstructure features and adaptively merging the ring buffer; Denoising is performed to obtain a chronologically ordered three-dimensional tensor. Based on the three-dimensional tensor and the initial convolutional model, a multi-scale structural convolutional model is constructed to generate a multi-scale market feature sequence. When constructing the multi-scale structural convolutional model, the latest volatility range and dominant trading direction vector are read. Based on the latest volatility range, dominant trading direction vector, a pre-built large language model of financial corpus, and a unified time anchor sequence, a text event embedding sequence is determined. A fusion vector is obtained based on the multi-scale market feature sequence and the text event embedding sequence. Based on the fusion vector and the multi-scale structural convolutional model, a predicted probability and confidence interval are obtained. These predicted probability, confidence interval, and corresponding timestamp are output to the risk control terminal, enabling the risk control terminal to predict and control the risk of tripping point. The above method achieves the following technical effects: After a text event arrives at the server, the arrival time of the text event is recorded, and a time offset is calculated based on the text event, the arrival time of the text event, and the source identifier. After text events and timestamp-containing market data are corrected by this time offset, they are written into the same ring buffer using a stable merging processing algorithm to obtain a unified time-anchored sequence. This allows all heterogeneous information to share a monotonically increasing time index at the microsecond granularity. The resulting real-time alignment pipeline eliminates the long-term accumulated errors caused by relying on static delay compensation mechanisms and can maintain millisecond-level time alignment accuracy during long-term operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0057] Figure 1 Schematic diagram of the process of the financial market data processing method provided in the embodiment of this application Figure 1 ;

[0058] Figure 2Schematic diagram of the process of the financial market data processing method provided in the embodiment of this application Figure 2 ;

[0059] Figure 3 A schematic diagram of the structure of a financial market data processing device provided in an embodiment of the present application;

[0060] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0061] Description of reference numerals:

[0062] 801 - processor; 802 - memory; 803 - communication component; 804 - bus. DETAILED DESCRIPTION

[0063] The exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0064] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit differences. It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described in this application as "exemplary" or "for example" should not be interpreted as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.

[0065] It should be noted that the phrase "at the time" in the embodiments of this application can refer to the instant a certain event occurs or a period of time after the event occurs, and this is not specifically limited in this embodiment of the application. Furthermore, the financial market data processing method provided in the embodiments of this application is merely an example, and the financial market data processing method may include more or less content.

[0066] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and corresponding operation entrances must be provided for users to choose to authorize or refuse.

[0067] The model designed in this application provides users with corresponding operation entrances for them to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.

[0068] In order to clearly understand the technical solution of this application, some terms are first explained in detail.

[0069] Micro-Burst: In financial markets, sudden and dramatic price or volume fluctuations within a very short period of time, typically on the order of milliseconds to seconds, are typically caused by high-frequency trading, the instantaneous execution of large orders, or sudden changes in liquidity.

[0070] Slow-Drift: reflects the mid- to long-term trend changes in the financial market at the minute to hour level, such as the flow of major funds, the accumulation of macro sentiment, or the slow decay of liquidity.

[0071] In order to clearly understand the technical solution of the present application, the solution of the prior art is introduced.

[0072] In the existing technology, a static delay compensation mechanism is generally adopted, that is, the two data pipelines of market data and text events are manually calibrated through pre-measured fixed delay parameters. After actual operation, as network congestion and content distribution paths change, the load fluctuations of the network infrastructure will continuously change the real-time delay characteristics of data transmission. The dynamic optimization strategy of the content distribution network will also lead to random changes in the transmission path. These dynamic factors make the pre-calibrated static parameters quickly lose their timeliness, and it is difficult for the system to maintain millisecond-level time alignment accuracy in long-term operation, which in turn affects the accuracy and stability of high-frequency trading decisions.

[0073] In summary, how to design a method that can solve the problem of the difficulty in maintaining millisecond-level time alignment accuracy in long-term operation caused by existing technologies is an urgent problem to be solved in this application.

[0074] Therefore, in response to the above-mentioned technical problems existing in the prior art, the embodiments of the present application provide a financial market data processing method, device, equipment, medium and product, which aim to maintain millisecond-level time alignment accuracy during long-term operation.

[0075] The following describes the application scenarios of the financial market data processing method provided by the embodiments of the present application. The following application scenarios are merely examples, intended to help those skilled in the art understand the technical content of the present application, but do not mean that the embodiments of the present application cannot be used in other devices, systems, environments, or scenarios.

[0076] Algorithmic trading risk control system: Monitors the correlation between market anomalies such as flash crashes and sudden drops in liquidity and risk events such as exchange warnings, triggering circuit breakers or frequency reductions in real time. The financial market data processing method provided by the embodiments of this application can maintain millisecond-level time alignment accuracy during long-term operation, reducing misjudgments.

[0077] Figure 1 Schematic diagram of the process of the financial market data processing method provided in the embodiment of this application Figure 1 , the financial market data processing method provided in this embodiment includes the following steps:

[0078] S101. Obtain public market data from the financial market.

[0079] In this example, a single-mode optical fiber L1 is directly connected to the optical port of the exchange's matchmaker in the computer room. An FPGA packet capture card F1 is installed in the server's PCIe slot. Leveraging a high-speed SerDes link and an on-chip 64KiB ring buffer, F1 intercepts ten levels of downstream data from the exchange using out-of-order detection logic based on the first frame sequence number, providing public financial market data.

[0080] S102: Obtain text events disclosed in the financial market, text event arrival times, and source identifiers.

[0081] As an optional implementation method, by connecting to the application programming interface (API) of financial information providers such as Reuters and Bloomberg or the announcement system of exchanges, structured text data can be crawled in real time, stored in the event pool after denoising and key information extraction, and a hybrid method based on rules and machine learning is used to automatically filter out irrelevant content to obtain text events that are public in the financial market.

[0082] As an optional implementation, a high-precision clock synchronization protocol is deployed at the data receiving end. When text events arrive at the server, they are immediately timestamped locally, along with metadata such as the time the text event was published and the transmission delay. A time correction algorithm is used to eliminate the effects of network jitter and ensure timestamp accuracy.

[0083] As an optional implementation, a source identifier is attached to each text event, and the source identifier is embedded in the text event header through a metadata field to support subsequent traceability and quality analysis.

[0084] S103: Write a hardware timestamp into the market data to obtain market data containing the timestamp.

[0085] In this embodiment, the Pulses Per Second (PPS) signal output by the GPS timing module G1 is used to drive the OCXO time base O1, providing a 10 MHz reference clock C ref , the FPGA internal counter is C ref Working, resolution t ref =100ns. Each market data k j Enter the FPGA packet capture card F1 and write the hardware timestamp τ for the first shot hw (j)=n j t ref , where n j The FPGA packet capture card writes the hardware timestamp upon receiving the first beat of each market data entry. This hardware-level processing mechanism effectively avoids time jitter introduced by the operating system.

[0086] After obtaining the market data with timestamp, write the market data with timestamp into the monotonically increasing sequence number. j Write monotonically increasing sequence number σ j =σ j-1 +1, optional, write serial number σ to market data k1 j =1, write serial number σ to market data k2 j =2, write serial number σ to market data k3 j =3, and so on. A monotonically increasing serial number is added to the market data with timestamps to ensure the temporal traceability of the data stream and provide a reliable basis for subsequent conflict arbitration.

[0087] S104: Calculate the time offset based on the text event, the text event arrival time and the source identifier, and merge the time offset, the text event and the market data with the timestamp to obtain a unified time anchor sequence.

[0088] In this embodiment, the text event arrival time τ is recorded arr (m), record the parsing time τ when the parsing is completed dec (m). Get the parsing time δ proc (m) = τ dec (m)-τ arr (m), and use this value as the maximum allowable adjustment threshold of the subsequent dynamic compensation algorithm.

[0089] The server and the matchmaker perform a two-way Network Time Protocol (NTP) session with a five-second period to obtain the round-trip delay rtt(t m ) and the original clock offset θ raw (t m ). In the NTP session, the original clock offset θ raw (t m ) is the round trip delay rtt(t m ) half.

[0090] The updated offset is calculated by the exponential smoothing coefficient γ∈(0,1) . is the current moment (t m ) The offset after smoothing is used as the time offset; θ raw (t m ) is the current moment (t m The raw clock offset measured by the NTP session, that is, the unsmoothed instantaneous value; is the previous moment (t m-1 )’s historical estimated offset.

[0091] As an optional implementation method, after obtaining the time offset, the text events and market data with timestamps are first standardized, and the timing deviation between the source data is eliminated through a dynamic time offset calibration algorithm; then, based on a sliding time window strategy, the text event features with the same reference time are associated and matched with the market features; finally, a unified time-anchored sequence is generated through time axis alignment and feature fusion to ensure strict synchronization of cross-modal data with millisecond-level accuracy, providing time-consistent multi-modal input for subsequent analysis.

[0092] S105 . Extract basic transaction information for the same transaction target in sequence according to a unified time anchor sequence, and write the basic transaction information into a ring buffer of a preset capacity in ascending order.

[0093] In this embodiment, after obtaining the unified time anchor sequence, the server reads the unified time anchor sequence and extracts the basic transaction information of the same transaction target, including price, transaction volume and ten-level depth fields, and writes the basic transaction information into a preset capacity N in ascending order of nanoseconds. b Ring buffer B ξ .

[0094] S106 , performing microstructure feature extraction and adaptive denoising processing on the ring buffer to obtain a three-dimensional tensor arranged in chronological order.

[0095] As an optional implementation method, the data content written into the ring buffer is first subjected to a sliding window mechanism to extract the microstructural features within each time slice, including order book dynamics, trading volume distribution, and spread fluctuations. Subsequently, a volatility-aware adaptive filtering algorithm is used to perform dynamic threshold suppression on the noise component. Finally, the processed features are reorganized according to the time, space, and channel dimensions to output a three-dimensional tensor with temporal continuity.

[0096] S107. Based on the three-dimensional tensor and the initial convolution model, a multi-scale structure convolution model is constructed and a multi-scale market feature sequence is generated.

[0097] As an optional implementation method, based on the input three-dimensional tensor data, the basic feature representation is first extracted through the initial convolution model; then a multi-scale structured convolutional network is constructed, and parallel convolution kernels with different expansion rates are used to capture millisecond-level micro-fluctuations and second-level macro-trend features respectively; finally, the outputs of each level are aligned and spliced ​​in the time dimension through the cross-scale feature fusion module to generate a multi-scale market feature sequence with multi-scale spatiotemporal representation capabilities.

[0098] S108. When constructing a multi-scale structure convolutional model, the latest volatility range and dominant trading direction vector are read, and a text event embedding sequence is determined based on the latest volatility range, dominant trading direction vector, a pre-built financial corpus large language model, and a unified time anchor sequence.

[0099] As an optional implementation, when constructing a multi-scale structured convolutional model, the latest volatility range and dominant trading direction vector are first read in real time. A pre-built large language model for financial corpus is then used to semantically encode text events. A unified time anchor sequence is used to align the timing deviations between events and market data to obtain text embeddings. Finally, a cross-modal attention mechanism is used to fuse the latest volatility range, dominant trading direction vector, and text embeddings to generate a text event embedding sequence. This process achieves an end-to-end conversion from raw data to multi-scale semantic representations, providing a joint representation that combines numerical features and text semantics for subsequent time series prediction or trading decisions.

[0100] S109: Obtain a fusion vector based on the multi-scale market feature sequence and the text event embedding sequence.

[0101] Specifically, the following steps are included:

[0102] 1) Synchronously capture the multi-scale market feature sequence Y(t) and the text event embedding sequence within a time window of 3 seconds T(t)=[t-3 s,t] Both sets of sequences are indexed by millisecond grids. During the reading phase, a stable sort is performed according to the ascending order of timestamps, and then the circular queue is used to cut them to the same length T. wThis coarse sorting action can ensure the comparability of the two types of tensors in subsequent calculations, while avoiding matrix operation mismatch caused by inconsistent dimensions.

[0103] 2) To mitigate the system-level delay between text events in the publishing platform, network transmission, and market feedback, a learnable time offset Δ is declared for the current batch.

[0104] During the training phase, Δ is slid along the time axis on the text event embedding sequence and dynamic alignment is completed by minimizing the cross-correlation residual. The optimal solution for the offset is given by the following formula:

[0105]

[0106] in, is the optimal solution for the offset; τ s is the start and end time of the window; τ e is the window termination time; Y(t) is the multi-scale market feature sequence; β is the weight of the cross-correlation alignment term; tr[⋅] is the matrix trace operation; λ Δ is the offset regularization term, used to prevent excessive translation; ||⋅|| F is the Frobenius norm. The objective function can be solved iteratively using gradient descent with projection within the convex constraint interval.

[0107] 3) After Δ* converges, a calibration event matrix E'(t) = E(t-Δ*) is generated, and its time index is aligned point-by-point with Y(t). This ensures that each subsequent millisecond segment contains both market characteristics and event embeddings, laying the foundation for time alignment for cross-modal fusion.

[0108] 4) In the fusion stage, Y(t) is used as the query end and E'(t) is used as the key value end, and the residual gated interactive attention mechanism is introduced. The gate weight g(t) is determined by the volatility σ 60 (t) is obtained through Sigmoid transformation and is used to adjust the size of cross-modal traffic. The calculation formula of the gating weight g(t) is:

[0109]

[0110] Among them, g(t) is the gating weight; σ 60 (t) is the annualized volatility of the latest minute; σ base is the out-of-sample static volatility benchmark; γ is the volatility sensitivity coefficient; σ(⋅) is the Sigmoid transformation.

[0111] The calculation formula of the fusion vector Z(t) is:

[0112]

[0113] Among them, Z(t) is the fusion vector; Y(t) is the multi-scale market feature sequence; g(t) is the gating weight; 、W k and is the trainable projection matrix; E'(t) is the calibration event matrix; is the unit residual compensation term, used to ensure numerical stability; d k is the dimension after feature projection.

[0114] 5) When the gate weight g(t) is higher than the threshold θ g When , the system applies a suppression factor ε to the diagonal elements in the attention matrix s , automatically suppressing irrelevant event dimensions. When g(t)<θ g When the above inhibition is released and the attention weight on the event side is amplified ε s , thereby strengthening the text signal and achieving focus allocation for jump point sensitivity. This gating strategy is designed and constructed based on the technical law that high volatility in the scene is mainly driven by the microstructure of the market, while low volatility is more easily triggered by external events.

[0115] 6) Concatenate the fused vector Z(t) with the multi-scale market feature sequence Y(t) along the channel dimension to obtain the joint feature representation F(t), specifically: F(t) = Z(t) || Y(t). Simultaneously, the system writes the attention weight matrix A(t) and gating weight g(t) to a read-only buffer, providing a visual heatmap for strategy backtracking and risk control interpretation.

[0116] S110. Based on the fusion vector and the multi-scale structure convolution model, a prediction probability and a confidence interval are obtained, and the prediction probability, confidence interval, and the corresponding timestamp are output to the risk control end, so that the risk control end can achieve predictive control of the trip point risk.

[0117] Specifically, the following steps are included:

[0118] A) Receives the fused vector Z(t) and writes it to a ring buffer of constant length of 100ms in timestamp order. The ring buffer advances one grid per millisecond, achieving a constant-size sliding window input and providing real-time, non-dynamically resized tensors for the subsequent convolution stage.

[0119] B) Within the ring buffer, a single depthwise separable convolution is performed based on a multi-scale convolutional model. Convolution is performed only along the time dimension, with kernels assigned to each channel and no cross-channel weight sharing. The convolution results are then point-wise squared and accumulated within the kernel width to extract short-term cumulative momentum features on the order of hundreds of milliseconds, preserving channel independence and enhancing the temporal energy representation of jump precursors.

[0120] C) The convolutional output is expanded into a one-dimensional vector in time-channel order and fed into the first fully connected layer. This fully connected layer is followed by a GELU nonlinear activation to map the local temporal potential to a higher dimension, explicitly capturing the potential combinatorial relationships between channels and cross-modal interactions.

[0121] D) The high-dimensional representation is compressed back to a single logarithmic domain output through a second-layer fully connected network and converted into a preliminary probability estimate of the jump point occurring in the next millisecond through a Sigmoid function, achieving the low-latency output required for millisecond-level decision-making.

[0122] E) A dropout panel with a fixed deactivation rate is inserted between two fully connected layers, and the analysis phase remains enabled. This structure injects uncertainty, allowing multiple forward analyses to be performed on the same input, generating a set of independent probability samples and obtaining a Bayesian predictive distribution from within the model structure.

[0123] F) Calculate the mean of all sample probabilities as the predicted probability, convert the sample variance into a confidence interval, and output the predicted probability, confidence interval, and corresponding millisecond timestamp to the risk control terminal. The risk control terminal triggers liquidity protection or position reduction based on this information, achieving predictive control of jump risk.

[0124] When a text event arrives at the server, its arrival time is recorded. A time offset is calculated based on the text event, its arrival time, and its source identifier. After being corrected for this time offset, the text event and timestamped market data are written to the same ring buffer using a stable merging algorithm, resulting in a unified time-anchored sequence. This allows all heterogeneous information to share a monotonically increasing time index at a microsecond granularity. The resulting real-time alignment pipeline eliminates the long-term cumulative errors associated with static delay compensation mechanisms, maintaining millisecond-level time alignment accuracy over the long term.

[0125] The present application provides a financial market data processing method, comprising: obtaining market data disclosed by the financial market; obtaining text events, text event arrival times and source identifiers disclosed by the financial market; writing hardware timestamps into the market data to obtain market data with timestamps; calculating time offsets based on text events, text event arrival times and source identifiers, and merging the time offsets, text events and market data with timestamps to obtain a unified time anchor sequence; extracting basic transaction information for the same transaction target in sequence based on the unified time anchor sequence, and writing the basic transaction information in ascending order into a ring buffer with a preset capacity; performing microstructure feature extraction and adaptive denoising on the ring buffer to obtain The method converts the data into a chronologically ordered three-dimensional tensor. Based on the three-dimensional tensor and the initial convolutional model, a multi-scale structural convolutional model is constructed to generate a multi-scale market feature sequence. When constructing the multi-scale structural convolutional model, the latest volatility range and dominant trading direction vector are read, and a text event embedding sequence is determined based on the latest volatility range, dominant trading direction vector, a pre-built large language model of financial corpus, and a unified time anchor sequence. A fusion vector is obtained based on the multi-scale market feature sequence and the text event embedding sequence. Based on the fusion vector and the multi-scale structural convolutional model, a predicted probability and confidence interval are obtained. The predicted probability, confidence interval, and corresponding timestamp are output to the risk control terminal, enabling the risk control terminal to predict and control the jump risk. Through the above method, the following technical effects are achieved: after the text event arrives at the server, the arrival time of the text event is recorded, and the time offset is calculated based on the text event, the text event arrival time, and the source identifier. After text events and timestamp-containing market data are corrected by this time offset, they are written into the same ring buffer using a stable merging processing algorithm to obtain a unified time-anchored sequence. This allows all heterogeneous information to share a monotonically increasing time index at the microsecond granularity. The resulting real-time alignment pipeline eliminates the long-term accumulated errors caused by relying on static delay compensation mechanisms and can maintain millisecond-level time alignment accuracy during long-term operation.

[0126] Figure 2 Schematic diagram of the process of the financial market data processing method provided in the embodiment of this application Figure 2 This embodiment further explains the financial market data processing method based on the above embodiment. Figure 2 As shown, S102 includes:

[0127] S201 : Establishing socket channels for different text event sources respectively, and configuring corresponding independent ring buffers for different socket channels.

[0128] In this embodiment, text event sources include news agency application programming interfaces (APIs), the central bank's Really Simple Syndication (RSS), and social media feeds. Socket channels {C1, C2, C3} are established for each of these channels, and independent ring buffers {B1, B2, B3} are configured for each.

[0129] S202: Receive text events sent by different text event sources, and write each text event into a corresponding independent ring buffer through a specific socket channel to record the arrival time of each text event and append a source identifier corresponding to each text event.

[0130] In this embodiment, a text event e1 sent by an API is received, and e1 is written to an independent ring buffer B1 through a socket channel C1; a text event e2 sent by an RSS is received, and e2 is written to an independent ring buffer B2 through a socket channel C2; a text event e3 sent by a social media push is received, and e3 is written to an independent ring buffer B3 through a socket channel C3. The moment when each text event is written to its corresponding independent ring buffer is recorded, and the source identifier corresponding to each text event is appended. The source identifier corresponding to text event e1 is news, the source identifier corresponding to text event e2 is rss, and the source identifier corresponding to text event e3 is sns. By writing each text event to a corresponding independent ring buffer through a specific socket channel, the transmission process of text events from different sources can be effectively isolated, avoiding mutual blocking between data streams.

[0131] Based on the above embodiment, this embodiment provides a method for processing financial market data. In S104, the time offset, text events, and market data with timestamps are merged to obtain a unified time anchor sequence, including:

[0132] S301: Correct the timestamp of a text event according to a time offset to obtain a text event containing a corrected timestamp.

[0133] In this embodiment, the calculation formula for correcting the timestamp of the text event according to the time offset is:

[0134]

[0135] Among them, τ m * is a text event with a correction timestamp, τ arr (m) is the arrival time of the text event, τ dec (m) records the time of analysis completion. is the time offset, ψ λm is the static link delay correction pre-measured for the source ID.

[0136] S302: Stably sort and merge text events containing correction timestamps in ascending time order to obtain a unified time-anchored sequence.

[0137] In this embodiment, a text event with a correction timestamp is constructed and a collection of market data with timestamps , and perform stable sorting and merging in ascending order of time. The calculation formula is as follows:

[0138]

[0139] Among them, τ hw (j) is the timestamp of market data point j; τ m * is the correction timestamp of the text event; s q is the qth data item; k j is the jth market data point; e m is the mth text event; ⊕ is the timestamp-based union operation.

[0140] After the processing, a unified time anchor sequence is obtained , Q represents the total number of data points in the sequence U. A specific method for obtaining a unified time anchor sequence is provided, which provides a reliable physical layer input for the subsequent residual-event dual-mode learning algorithm.

[0141] Based on the above embodiment, this embodiment provides a method for processing financial market data. S106 includes:

[0142] S401: Continuously read the transaction direction indicators and corresponding order cancellation counts of a preset number of transaction targets in the ring buffer to calculate the activity index.

[0143] In this embodiment, the preset number of records is 200.

[0144] In ring buffer B ξ The sliding window method is used to continuously read the transaction direction indicators of the last 200 transactions. p (t) and the order cancellation count κ in the same time period p (t), and then calculate the activity index μ(t). The activity index reflects the difference in buying and selling intentions and incorporates the squeeze effect of order cancellation intensity on liquidity.

[0145] The calculation formula of activity index μ(t) is as follows:

[0146]

[0147] Wherein, μ(t) is the activity index; p is the number of transactions; ιp(t) is the transaction direction index of the p-th transaction target. In this embodiment, buy is 1 and sell is -1. The count of order cancellations for the p-th transaction in the same time period.

[0148] S402. Dynamically adjust the Hampel window width based on the transaction direction indicator, and perform center-median deviation detection on the price series and the depth series. When it is detected that the current point deviates from the median of the current window by more than a preset multiple of the scale statistic and there are no abnormal points in the same direction on both sides, the current point is determined to be an abnormal point and replaced with a recent valid quote.

[0149] In this embodiment, the calculation formula of the Hampel window width w(t) is as follows:

[0150]

[0151] Where w(t) is the Hampel window width; μ(t) is the activity index; w min The minimum window width allowed by the system; w max is the maximum window width allowed by the system; μ max is the pre-measured activity saturation value.

[0152] Dynamically adjust the Hampel window width w(t) based on μ(t), and preset the timescaling statistic to n h The system performs center-median deviation detection on the price sequence P(t) and the depth sequence D(t) in each millisecond time slot, and detects the deviation only when the current point deviates from the median of the current window by more than n. h Only when the scaled statistic is equal to the current point and there are no anomalies in the same direction on either side of the price is the current point identified as an outlier and replaced with a recent valid quote, thereby suppressing microsecond jitter and preserving the continuous trend. The Hampel window width w(t) adaptively scales with the activity index μ(t), preventing under-filtering or over-filtering caused by a fixed window length in extreme market conditions.

[0153] S403. Obtain the real-time annualized volatility and, based on the real-time annualized volatility and the pre-stored hardware output rate, determine the millisecond sampling interval to perform zero-order hold interpolation on missing quotes within an equally spaced grid. Apply sparse convolution to refine high-frequency information and construct a three-dimensional tensor arranged in chronological order.

[0154] In this embodiment, the real-time annualized volatility σ(t) is calculated based on the recent 60-second history immediately after the denoising is completed. If the instantaneous increase of dσ / dt is detected to be greater than the threshold ϑ σ, immediately shorten the Hampel window width w(t) proportionally to make the Hampel diagnosis more sensitive, thereby preventing the jump point from being over-smoothed. The component also obtains the actual output rate ρ(t) of the matchmaker and determines the sampling interval δ in conjunction with σ(t). s (t), when the fluctuation is high and the output rate is low, δ s (t) tends to the minimum value to fully preserve details; otherwise it increases to suppress redundancy.

[0155] Sampling interval δ s The calculation formula of (t) is as follows:

[0156]

[0157] Among them, δ s (t) is the sampling interval; ρ max is the peak output rate of the matchmaker, i.e. the pre-stored hardware output rate; σ base is the out-of-sample static volatility benchmark; α and β are pre-stored power exponents used to control the effect of the two factors on δ s (t) the influence elasticity; δ min is the minimum lower limit of the sampling interval; δ max is the upper limit of the sampling interval; ρ(t) is the actual output rate of the matching machine; σ(t) is the real-time annualized volatility.

[0158] After the sampling interval is assigned, a uniform millisecond-aligned time grid G={g n}, which is the millisecond sampling interval.

[0159] If any node on G is missing a quote, the algorithm first uses the transaction price closest to the node to perform zero-order hold interpolation on the missing quote within the equally spaced grid, and then applies sparse convolution to the padded segment to refine the high-frequency information, that is, applying a one-dimensional sparse convolution kernel K sc The convolution kernel is only activated in the high-sensitivity frequency band of the jump point, which refines the high-frequency information and effectively suppresses the step distortion generated by the interpolation process, thereby completely preserving the market microstructure characteristics.

[0160] Finally, the equally spaced prices, trading volumes, and depths are concatenated into a three-dimensional tensor in chronological order.

[0161] A specific method for constructing a three-dimensional tensor arranged in chronological order is provided. Only when the current point deviates from the median of the current window by more than a preset multiple of the scale statistic and there are no anomalies in the same direction on both sides of the adjacent window, the current point is determined to be an abnormal point and replaced by a recent valid quotation. This can ensure that microsecond-level jitter is suppressed and the continuous trend is preserved. Zero-order hold interpolation processing is performed on the missing quotes in an equally spaced grid, and sparse convolution is applied to refine the high-frequency information. This can effectively suppress the step distortion generated by the interpolation process, thereby fully preserving the market microstructure characteristics.

[0162] Based on the above embodiment, this embodiment provides a method for processing financial market data. The three-dimensional tensor is an equally spaced three-dimensional tensor, and the initial convolution model includes multiple layers of residual convolution blocks. S107 includes:

[0163] S501. Perform one-dimensional linear projection and splicing processing on the equally spaced three-dimensional tensors to obtain an input base of uniform dimension.

[0164] In this embodiment, the three-dimensional tensor is an equally spaced three-dimensional tensor, and the equally spaced three-dimensional tensor is obtained. Then, the continuous time dimension T corresponds to the millisecond-level aligned sampling grid, and the feature dimension is composed of the price group X p (t), trading volume group X v (t) and depth group X d (t) are spliced ​​together in sequence.

[0165] To address the dimensional differences of high-frequency order flows in different dimensions, this embodiment applies one-dimensional linear projection to each of the three sets of feature dimensions, and then completes the splicing process on the channel axis to obtain an input base H0(t) of unified dimension. The formula is as follows:

[0166]

[0167] Where H0(t) is the input base of uniform dimension; X p (t) is the price group; X v (t) is the trading volume group; X d (t) is the depth group; is the bias corresponding to the price group; is the bias corresponding to the volume group; is the bias corresponding to the depth group; b0 is the global bias term; || represents the splicing process.

[0168] Based on the above, the three types of heterogeneous inputs are normalized into the same feature space at the millisecond granularity, laying the foundation for the subsequent convolution to share kernel weights, while avoiding the problem of low-dimensional price dominating the high-dimensional depth.

[0169] S502. When the input base of uniform dimension enters the first layer residual convolution block of the initial convolution model, the dominant driving chain in the scene is explicitly characterized based on the three-way cross convolution, so that the convolution receptive field of the initial convolution model is adaptively scaled with the market state to obtain an adaptive convolution model.

[0170] In this embodiment, when H0(t) enters the first residual convolutional block of the initial convolutional model, a three-way cross convolution explicitly characterizes the dominant driving chain in the scene. This allows the initial convolutional model's receptive field to adaptively scale with market conditions, resulting in an adaptive convolutional model. Rapid price changes affect trading volume, and this impact directly consumes the order depth, which in turn in turn regulates quote updates.

[0171] The specific implementation is:

[0172] Slide three independent convolution kernels C in one direction on the time axis p→v 、C v→d and C d→p And write the convolution result into the residual main branch after adding the channel axis, and then embed the channel-by-channel DepthwiseGating in the residual bypass:

[0173]

[0174] Among them, Z1(t) is the feature tensor; r is the sliding window offset of the convolution kernel; k1 is the kernel width; K p→v,r is the convolution kernel weight driving the direction from price group to volume group; K v→d,r K is the convolution kernel weight in the driving direction from the volume group to the depth group; d→p,r The convolution kernel weight driving the direction from the depth group to the price group; is the price channel subtensor of H0(t); is the volume channel sub-tensor of H0(t); is the depth channel subtensor of H0(t); R(t) is the noise ratio vector; σ(⋅) represents the Sigmoid activation function; ⊙ is the Hadamard product.

[0175] The above formula accurately captures the cross-modal dynamic coupling relationship between price, volume, and depth data with millisecond-level time accuracy. Furthermore, the σ(R(t)) gating mechanism effectively suppresses occasional noise caused by extreme quote spikes, thereby avoiding misjudgments of the price-volume relationship caused by abnormal fluctuations in high-frequency matching scenarios. This architectural design directly addresses the challenge of market microstructure distortion caused by sudden changes in order flow, enabling robust analysis of high-frequency trading signals.

[0176] After the DepthwiseGating process is completed, Z1(t) is superimposed on the residuals through two layers of causal convolution, and then the volatility-aware controller reads the latest one-minute annualized volatility σ 60(t), dynamically adjust the dilation interval d(t) of the adaptive convolution model according to the fluctuation level.

[0177] The volatility-aware controller introduces an adaptive convolution model that takes both volatility and liquidity into account. Specifically:

[0178]

[0179] Where d(t) is the expansion interval of the adaptive convolution model; δ min is the minimum lower limit of the sampling interval; δ max is the upper limit of the sampling interval; ρ(t) is the actual output rate of the matching machine; ρ max is the peak output rate of the matchmaker; σ 60 (t) is the annualized volatility of the latest minute; σ base is the out-of-sample static volatility benchmark; α and β are pre-stored power exponents; ⌈⋅⌉ is rounded up.

[0180] Based on the above formula, the convolution receptive field of the initial convolutional model is adaptively scaled with market conditions, resulting in an adaptive convolutional model. Under conditions of extreme volatility and low liquidity, the initial convolutional model automatically shrinks, maintaining high sensitivity to abrupt structural changes near a jump point. During periods of stability and high liquidity, the receptive field of the initial convolutional model is expanded to avoid over-response to noise.

[0181] S503. Apply a strict causal mask to all convolution kernels of the adaptive convolution model to obtain a strict causal convolution model.

[0182] In this embodiment, a strict causal mask is applied to all convolution kernels of the adaptive convolution model, that is, the weights of future moments are set to zero and the step size is set to 1, thereby obtaining a strict causal convolution model, thereby meeting the regulatory requirements of high-frequency trading real-time estimation that future information cannot be leaked. At the same time, the direct path from input to output is retained to form H j+1 =H j +F j H j , where H j is the input feature of the j-th layer residual module, H j+1 is the output feature of the j-th layer residual module, F j is the residual function of the jth layer. The direct path can significantly alleviate the vanishing problem of deep residual links under high-frequency sparse gradients.

[0183] S504. Repeatedly stack residual blocks on the strictly causal convolutional model to obtain a multi-scale structured convolutional model.

[0184] In this example, a strictly causal convolutional model is repeatedly stacked with residual blocks to produce a multi-scale structured convolutional model. Each convolution kernel shares the triple constraints of noise shielding, fluctuation regulation, and causal masking, but is independently updated over the dilation interval d(t). This forms a top-down family of increasing receptive fields, fully covering sequence spans from milliseconds to seconds.

[0185] Based on this hierarchical design, the multi-time scale structure bred by the corresponding jump points is constructed: the short window captures the Micro-Burst, and the long window describes the Slow-Drift.

[0186] S505. Perform cascade and dimensionality reduction processing on the multi-scale structure convolution model on the channel axis and the layer axis simultaneously to obtain a multi-scale market feature sequence.

[0187] In this embodiment, when the last layer residual module outputs H L After generation, the multi-scale structure convolution model is simultaneously cascaded and dimensionally reduced on the channel axis and layer axis to obtain a multi-scale market feature sequence specifically for use in the event fusion layer. In order to clearly record the range of feature sources at each moment, a set of learnable scale encoding vectors is constructed , and after splicing through the matrix W agg Complete linear fusion, the formula is as follows:

[0188]

[0189] Among them, Y(t) is the multi-scale market feature sequence; M(t) is based on the preset window w m Calculated market circuit breaker risk metric; θ m is the warning threshold; W agg is the linear projection matrix; is the scale encoding vector; For the Market characteristics of the layer; is the number of layers of the residual module; is the indicator function.

[0190] When the circuit breaker risk metric is higher than the warning threshold, the corresponding moment feature is set to zero through Hadamard multiplication to avoid the unstable impact of abnormal and drastic market conditions on the event fusion output.

[0191] A dynamic circuit breaker gating mechanism at the output enables real-time robust control of extreme market conditions, ensuring the system's rapid response to unexpected risks in high-frequency trading risk management scenarios. The collaborative design of multi-scale feature fusion and risk perception effectively balances market analysis accuracy with risk control compliance requirements, precisely adapting to the stringent stability and security demands of high-frequency trading environments.

[0192] Based on the above embodiment, this embodiment provides a method for processing financial market data. S108 includes:

[0193] S601: Traverse the unified time anchor sequence within a sliding window of a preset time length to filter out calibrated message instances.

[0194] In this embodiment, the preset time length is 5s. Traverse the unified time anchor sequence U in the sliding window W(t)=[t-5 s,t] with a length of 5s, and filter the marked message instances, that is, filter all the message instances ζ that have been marked as news, announcements and tweets i =⟨text i ,τ i ,λ i >. To maintain thread safety, the extraction results are assembled into a batch buffer B(t)={ζ i ∣τ i ∈W(t)} and push it to the event processing pipeline after locking.

[0195] S602: When constructing a multi-scale structure convolution model, the latest volatility range and the dominant trading direction vector are read, and text event encoding processing is performed based on the latest volatility range and the dominant trading direction vector to obtain discrete prompt segments.

[0196] In this embodiment, when constructing the multi-scale structure convolution model, the latest one-minute annualized volatility σ is read out. 60 (t) and the dominant transaction direction vector φ(t). Through the mapping matrix and , the latest volatility range and dominant trading direction vector are encoded into text events, that is, the two market states are encoded into discrete prompt fragments and then spliced ​​into a state statement , to achieve instruction guidance for language models.

[0197] S603: Construct the discrete prompt segments into a guide input string, and input the guide input string into a pre-built financial corpus large language model based on the displayed frozen parameters to output a dual-branch result.

[0198] In this embodiment, the dual-branch result includes a latent vector.

[0199] in accordance with Construct a guide input string, and based on the explicit freezing parameters, input the guide input string into the pre-built financial corpus language model to output a dual-branch result, a set of hidden vectors at a certain layer A human-readable summary with deep semantics Characterize the direction and magnitude of potential price shocks.

[0200] S604: Perform source-specific projection operations on the latent vector to obtain a cross-source aligned event representation.

[0201] In this embodiment, due to the differences in length and register between news, announcements, and tweets, a dedicated projection head is configured for each source. The latent vector is unified to dimension d after the source-specific projection operation. e , get the cross-source aligned event representation e i .

[0202] S605 , performing element-by-element scaling on the cross-source aligned event representation using a fluctuation-time dual-factor attenuation function to obtain a text event embedding sequence.

[0203] In this embodiment, in order to control the attenuation of the event impact in the time domain, the current moment is calculated The time when the message occurs τ i Difference Δ i =t-τ i Considering that price shocks in high-frequency scenarios are more sensitive to recent periods, this embodiment proposes a volatility-time dual-factor attenuation function:

[0204]

[0205] Among them, w i (t) is the fluctuation-time dual-factor decay function; Δ i For the current moment The time when the message occurs τ i Difference; λ t ,λ o and λ σ is the attenuation coefficient; σ 60 (t) is the annualized volatility of the latest minute; σ base is the out-of-sample static volatility benchmark; φ(t) is the dynamic market state vector; 1 {⋅} is the indicator function, when Δ i ≥Δ max Directly set to zero.

[0206] Then, element-by-element scaling is performed on the cross-source aligned event representation to obtain the text event embedding sequence .

[0207] Based on the above, we also consider the time distance, the polarity strength of the buying and selling directions, and the current volatility level to ensure that hot news maintains a higher weight during turbulent market conditions.

[0208] when When it is written to the millisecond event queue Otherwise, it is discarded directly to prevent inefficient redundant information from interfering with subsequent fusion layers. To prevent blocking, the queue adopts a ring structure and shares the time index with the multi-scale market feature sequence Y(t), ensuring that downstream cross-modal attention can retrieve text events that still have marginal impact within the same millisecond grid:

[0209]

[0210]

[0211] Among them, p i is the state prompt vector; M v is the directional signal matrix; M d is the volatility signal matrix; φ(t) is the dynamic market state vector; σ 60 (t) is the annualized volatility for the latest minute; is a set of preset volatility partitions; Map the market state into a sparse one-hot vector.

[0212] Embed sequence for text events; W λi is a learnable weight matrix; for Layer hidden vector; w i (t) is the fluctuation-time double factor decay function.

[0213] The above represents the state prompt vector p i Construction and text event embedding sequence The generation process. Through a matrix-element-by-element multiplication nesting approach, market microstructure information and text semantic information are integrated at the millisecond level. This representation is directly applied to simultaneous event-market predictions, explicitly modeling the instantaneous dynamic relationship between events and market changes. This enables the prediction model to simultaneously capture the synergistic effects of text-driven emotional impact and microstructure evolution, significantly improving the explanatory power and prediction accuracy of sudden market events.

[0214] Figure 3 This is a schematic diagram of the structure of the financial market data processing device provided in the embodiment of the present application. Figure 3 As shown, in this embodiment, the financial market data processing device can be located in an electronic device. The financial market data processing device includes:

[0215] The market data acquisition module 701 is used to obtain the market data disclosed by the financial market;

[0216] The text event acquisition module 702 is used to acquire text events disclosed in the financial market, the arrival time of the text events, and the source identifier;

[0217] The first writing module 703 is used to write a hardware timestamp into the market data to obtain the market data with a timestamp;

[0218] The unified time anchor sequence acquisition module 704 is used to calculate the time offset based on the text event, the text event arrival time and the source identifier, and merge the time offset, the text event and the market data with the timestamp to obtain the unified time anchor sequence;

[0219] The second writing module 705 is used to extract basic transaction information for the same transaction subject in sequence according to the unified time anchor sequence, and write the basic transaction information in ascending order into a ring buffer with a preset capacity;

[0220] A three-dimensional tensor acquisition module 706 is used to perform microstructure feature extraction and adaptive denoising on the ring buffer to obtain a three-dimensional tensor arranged in time sequence;

[0221] A construction module 707 is used to construct a multi-scale structured convolution model and generate a multi-scale market feature sequence based on the three-dimensional tensor and the initial convolution model;

[0222] The text event embedding sequence acquisition module 708 is used to read the latest volatility range and dominant trading direction vector when building the multi-scale structure convolutional model, and determine the text event embedding sequence based on the latest volatility range, dominant trading direction vector, the pre-built financial corpus large language model, and the unified time anchor sequence;

[0223] A fusion vector acquisition module 709 is used to obtain a fusion vector based on the multi-scale market feature sequence and the text event embedding sequence;

[0224] The prediction control module 710 is used to obtain the prediction probability and confidence interval based on the fusion vector and the multi-scale structure convolution model, and output the prediction probability, confidence interval and corresponding timestamp to the risk control end, so that the risk control end can achieve predictive control of the trip point risk.

[0225] The financial market data processing device provided in this embodiment can execute Figure 1 The technical solution of the embodiment of the financial market data processing method shown in the figure has the same implementation principle and technical effect as Figure 1 The embodiments of the financial market data processing method shown are similar and will not be described in detail here.

[0226] At the same time, the financial market data processing device provided by the present invention further refines the financial market data processing device provided by the previous embodiment.

[0227] Optionally, in this embodiment, the text event acquisition module 702 is further configured to:

[0228] Establish socket channels for different text event sources and configure corresponding independent ring buffers for different socket channels;

[0229] Receives text events sent by different text event sources and writes each text event into a corresponding independent ring buffer through a specific socket channel to record the arrival time of each text event and append the source identifier corresponding to each text event.

[0230] Optionally, in this embodiment, the unified time anchor sequence acquisition module 704 is further configured to:

[0231] Calculate the time offset based on the text event, the arrival time of the text event and the source identifier;

[0232] Correcting the timestamp of the text event according to the time offset to obtain a text event with a corrected timestamp;

[0233] The text events containing correction timestamps are stably sorted and merged in ascending time order to obtain a unified time-anchored sequence.

[0234] Optionally, in this embodiment, the three-dimensional tensor acquisition module 706 is further configured to:

[0235] Continuously read the transaction direction indicator and corresponding order cancellation count of a preset number of transaction targets in the ring buffer to calculate the activity indicator;

[0236] The Hampel window width is dynamically adjusted based on the transaction direction indicator, and the center-median deviation test is performed on the price series and the depth series. When the current point is detected to deviate from the median of the current window by more than the preset multiple of the scale statistic and there are no abnormal points in the same direction on both sides, the current point is identified as an abnormal point and replaced with the recent valid quote.

[0237] Obtain real-time annualized volatility and, based on the real-time annualized volatility and pre-stored hardware output rate, determine the millisecond sampling interval. Perform zero-order hold interpolation on missing quotes within an equally spaced grid, apply sparse convolution to refine high-frequency information, and construct a three-dimensional tensor arranged in chronological order.

[0238] Optionally, in this embodiment, the three-dimensional tensor is an equally spaced three-dimensional tensor, the initial convolution model includes multiple layers of residual convolution blocks, and the construction module 707 is further used to:

[0239] Perform one-dimensional linear projection and concatenation on the equally spaced three-dimensional tensors to obtain an input base of uniform dimension;

[0240] When the input base of uniform dimension enters the first residual convolution block of the initial convolution model, the dominant driving chain in the scene is explicitly characterized based on three-way cross convolution, so that the convolution receptive field of the initial convolution model can be adaptively scaled with the market state, thus obtaining an adaptive convolution model.

[0241] Apply strict causal masks to all convolution kernels of the adaptive convolution model to obtain a strictly causal convolution model;

[0242] The strictly causal convolutional model is repeatedly stacked with residual blocks to obtain a multi-scale structured convolutional model;

[0243] The multi-scale structure convolution model is simultaneously subjected to cascading and dimensionality reduction processing on the channel axis and the layer axis to obtain a multi-scale market feature sequence.

[0244] Optionally, in this embodiment, the text event embedding sequence acquisition module 708 is further configured to:

[0245] Traverse the unified time anchor sequence within a sliding window of preset time length and filter out the marked message instances;

[0246] When building the multi-scale structure convolution model, the latest volatility range and dominant trading direction vector are read, and text event encoding processing is performed based on the latest volatility range and dominant trading direction vector to obtain discrete prompt fragments;

[0247] Constructing discrete prompt segments as guided input strings, and inputting the guided input strings into a pre-built large language model of financial corpus based on displayed frozen parameters to output a dual-branch result, wherein the dual-branch result includes a latent vector;

[0248] Perform source-specific projection operations on the latent vector to obtain cross-source aligned event representations;

[0249] The cross-source aligned event representations are element-wise scaled by a fluctuation-time dual-factor decay function to obtain a text event embedding sequence.

[0250] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. This electronic device is intended to be used in various electronic devices capable of executing the financial market data processing method, such as a microcomputer, a single-chip microcomputer, and other suitable computers. The components shown herein, their connections and relationships, and their functions are provided for illustrative purposes only and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0251] like Figure 4 As shown, the electronic device includes: at least one processor 801 and a memory 802. The electronic device also includes a communication component 803. The processor 801, the memory 802 and the communication component 803 are connected via a bus 804.

[0252] In a specific implementation process, at least one processor 801 executes the computer-executable instructions stored in the memory 802 , so that the at least one processor 801 executes the financial market data processing method executed by the electronic device side as described above.

[0253] The specific implementation process of the processor 801 can be found in the above-mentioned embodiment of the financial market data processing method. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.

[0254] In the above embodiment, it should be understood that the processor 801 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor 801 may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.

[0255] The memory 802 may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.

[0256] Bus 804 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Bus 804 can be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, the bus 804 in the drawings of this application is not limited to a single bus or a single type of bus.

[0257] The above functions implemented by the electronic device and the main control device have been used to introduce the solutions provided in the embodiments of the present application. It is understandable that, in order to implement the above functions, the electronic device or the main control device includes hardware structures and / or software modules corresponding to the execution of each function. In combination with the units and algorithm steps of the various examples described in the embodiments disclosed in the embodiments of the present application, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiments of the present application.

[0258] The present application also provides a computer-readable storage medium, which stores computer-executable instructions. When a processor executes the computer-executable instructions, the above financial market data processing method is implemented.

[0259] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The computer-readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0260] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. The readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an application-specific integrated circuit (ASIC). The processor and the readable storage medium may also reside as discrete components in an electronic device or a host control device.

[0261] The memory 802 is a non-transitory computer-readable storage medium provided by the present invention. The non-transitory computer-readable storage medium of the present invention stores computer instructions, which are used to enable a computer to execute the financial market data processing method provided by the present invention.

[0262] The memory 802 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the program instructions / modules corresponding to the financial market data processing method in the embodiment of the present application (for example, Figure 3The processor 801 executes various functional applications and data processing by running the non-transient software programs, instructions, and modules stored in the memory 802, thereby implementing the financial market data processing method in the above-mentioned method embodiment.

[0263] At the same time, this embodiment also provides a computer program product, including a computer program, which is used to implement the financial market data processing method of the above embodiment when executed by a processor.

[0264] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required for this application.

[0265] It should be further noted that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0266] It should be understood that the above-described device embodiments are merely illustrative, and the device of the present application may also be implemented in other ways. For example, the division of units / modules in the above-described embodiments is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.

[0267] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present application may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.

[0268] If the integrated unit / module is implemented in hardware, the hardware may be digital circuits or analog circuits. The physical implementation of the hardware structure includes, but is not limited to, transistors and memristors. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), and Hybrid Memory Cube (HMC).

[0269] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, magnetic disk, or optical disk, etc., various media that can store program code.

[0270] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a particular embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined in any way. To keep the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0271] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0272] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for processing financial market data, characterized in that: include: Obtain public market data on financial markets; Obtaining text events, arrival times, and source identifiers publicly available in financial markets; Writing a hardware timestamp into the market data to obtain market data containing a timestamp; Calculating a time offset based on the text event, the arrival time of the text event, and the source identifier, and performing merging processing based on the time offset, the text event, and the market data with timestamps to obtain a unified time anchor sequence; Extracting basic transaction information for the same transaction target in sequence according to the unified time anchor sequence, and writing the basic transaction information into a ring buffer of a preset capacity in ascending order; Performing microstructure feature extraction and adaptive denoising on the ring buffer to obtain a three-dimensional tensor arranged in time sequence; Based on the three-dimensional tensor and the initial convolution model, a multi-scale structured convolution model is constructed and a multi-scale market feature sequence is generated; When constructing the multi-scale structure convolutional model, the latest volatility range and the dominant transaction direction vector are read, and a text event embedding sequence is determined based on the latest volatility range, the dominant transaction direction vector, the pre-built financial corpus large language model, and the unified time anchor sequence; Obtaining a fusion vector according to the multi-scale market feature sequence and the text event embedding sequence; A predicted probability and a confidence interval are obtained based on the fusion vector and the multi-scale structure convolution model, and the predicted probability, the confidence interval, and a corresponding timestamp are output to a risk control end, so that the risk control end can achieve predictive control of the trip point risk.

2. The financial market data processing method according to claim 1, characterized in that: The obtaining of text events disclosed in the financial market, text event arrival times, and source identifiers includes: Establish socket channels for different text event sources and configure corresponding independent ring buffers for different socket channels; Receive text events sent by different text event sources, and write each text event into a corresponding independent ring buffer through a specific socket channel to record the arrival time of each text event and append the source identifier corresponding to each text event.

3. The financial market data processing method according to claim 1, characterized in that: The merging process is performed according to the time offset, the text event, and the market data with the timestamp to obtain a unified time anchor sequence, including: Correcting the timestamp of the text event according to the time offset to obtain a text event containing a corrected timestamp; The text events containing the correction timestamps are stably sorted and merged in ascending time order to obtain a unified time-anchored sequence.

4. The financial market data processing method according to claim 1, characterized in that: The microstructure feature extraction and adaptive denoising processing are performed on the ring buffer to obtain a three-dimensional tensor arranged in time sequence, including: Continuously reading the transaction direction indicators and corresponding order cancellation counts of a preset number of transaction targets on the ring buffer to calculate the activity index; Dynamically adjust the Hampel window width based on the transaction direction indicator, and perform center-median deviation detection on the price series and depth series. When it is detected that the current point deviates from the median of the current window by more than a preset multiple of the scale statistic and there are no abnormal points in the same direction on both sides, the current point is determined to be an abnormal point and replaced with the most recent valid quote. Obtain real-time annualized volatility and, based on the real-time annualized volatility and pre-stored hardware output rate, determine a millisecond sampling interval to perform zero-order hold interpolation on missing quotes within an equally spaced grid. Apply sparse convolution to refine high-frequency information and construct a chronologically ordered three-dimensional tensor.

5. The financial market data processing method according to claim 1, characterized in that: The three-dimensional tensor is an equally spaced three-dimensional tensor, and the initial convolution model includes multiple layers of residual convolution blocks; Accordingly, the multi-scale structure convolution model is constructed based on the three-dimensional tensor and the initial convolution model, and a multi-scale market feature sequence is generated, including: Performing one-dimensional linear projection and splicing processing on the equally spaced three-dimensional tensors to obtain an input base of uniform dimension; When the input base of uniform dimension enters the first residual convolution block of the initial convolution model, the dominant driving chain in the scene is explicitly characterized based on three-way cross convolution, so that the convolution receptive field of the initial convolution model is adaptively scaled with the market state, thereby obtaining an adaptive convolution model; Applying a strict causal mask to all convolution kernels of the adaptive convolution model to obtain a strict causal convolution model; Repeatedly stacking residual blocks on the strictly causal convolutional model to obtain a multi-scale structured convolutional model; The multi-scale structure convolution model is subjected to cascading and dimensionality reduction processing on both the channel axis and the layer axis to obtain a multi-scale market feature sequence.

6. The financial market data processing method according to claim 5, characterized in that: The step of reading the latest volatility range and the dominant transaction direction vector when constructing the multi-scale structure convolutional model, and determining a text event embedding sequence based on the latest volatility range, the dominant transaction direction vector, a pre-built financial corpus large language model, and the unified time anchor sequence, includes: Traversing the unified time anchor sequence within a sliding window of a preset time length to filter out calibrated message instances; When constructing the multi-scale structure convolution model, the latest volatility range and the dominant trading direction vector are read, and text event encoding processing is performed according to the latest volatility range and the dominant trading direction vector to obtain discrete prompt segments; constructing the discrete prompt segments into a guided input string, and inputting the guided input string into a pre-built financial corpus large language model based on displayed frozen parameters to output a two-branch result, wherein the two-branch result includes a latent vector; performing a source-specific projection operation on the latent vector to obtain a cross-source aligned event representation; The cross-source aligned event representation is element-wise scaled by a fluctuation-time double factor decay function to obtain a text event embedding sequence.

7. A financial market data processing device, characterized in that: include: Market data acquisition module, used to obtain public market data from financial markets; The text event acquisition module is used to obtain text events disclosed in the financial market, the arrival time of the text events, and the source identification; A first writing module is used to write a hardware timestamp into the market data to obtain market data containing a timestamp; a unified time anchor sequence acquisition module, configured to calculate a time offset based on the text event, the arrival time of the text event, and the source identifier, and perform a merging process based on the time offset, the text event, and the market data containing the timestamp to obtain a unified time anchor sequence; A second writing module is configured to sequentially extract basic transaction information for the same transaction subject according to the unified time anchor sequence, and write the basic transaction information into a ring buffer of a preset capacity in ascending order; a three-dimensional tensor acquisition module, configured to perform microstructure feature extraction and adaptive denoising on the ring buffer to obtain a three-dimensional tensor arranged in chronological order; A construction module, configured to construct a multi-scale structured convolution model and generate a multi-scale market feature sequence based on the three-dimensional tensor and the initial convolution model; a text event embedding sequence acquisition module, configured to read the latest volatility range and the dominant transaction direction vector when constructing the multi-scale structure convolutional model, and determine the text event embedding sequence based on the latest volatility range, the dominant transaction direction vector, the pre-built financial corpus large language model, and the unified time anchor sequence; A fusion vector acquisition module, configured to obtain a fusion vector based on the multi-scale market feature sequence and the text event embedding sequence; A prediction control module is configured to obtain a prediction probability and a confidence interval based on the fusion vector and the multi-scale structure convolution model, and output the prediction probability, the confidence interval, and the corresponding timestamp to a risk control terminal, so that the risk control terminal can achieve predictive control of the trip point risk.

8. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the financial market data processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the financial market data processing method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program is used to implement the financial market data processing method according to any one of claims 1 to 6.