An intelligent spot-futures fusion autonomous pricing system and method

The intelligent futures-spot integrated autonomous pricing system solves the problems of heterogeneous futures-spot data misalignment and inaccurate pricing timing, enabling efficient and accurate trading decisions and risk control, and improving trading efficiency and accuracy.

CN122264933APending Publication Date: 2026-06-23PUSHAN TECHNOLOGY DEVELOPMENT (SICHUAN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PUSHAN TECHNOLOGY DEVELOPMENT (SICHUAN) CO LTD
Filing Date
2026-03-24
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies in the pricing model suffer from problems such as difficulty in aligning heterogeneous spot and futures data, inaccurate timing of pricing, lag in human decision-making, and high operational risks, resulting in low trading decision-making efficiency and increased risk.

Method used

The system employs an intelligent futures-spot fusion autonomous pricing system. Through a data access module, a futures-spot data alignment and cleaning module, a feature engineering database, an AI decision analysis engine, and an autonomous execution and risk control module, it achieves real-time acquisition of multi-source data, intelligent analysis of futures-spot basis, and autonomous execution. It utilizes a dual-channel spatiotemporal attention fusion prediction model and stream computing technology for data alignment and feature extraction, and combines risk control rules for autonomous trading.

Benefits of technology

It achieves efficient alignment and feature extraction of futures and spot data, improves the accuracy of pricing timing and the degree of automation in trading, reduces operational risks, enhances trading efficiency and accuracy, and significantly reduces the lag in human decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122264933A_ABST
    Figure CN122264933A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of intelligent futures and spot fusion point price system and method, method includes: initialization configuration real-time monitoring data stream, and data stream is washed, verified, futures and spot time axis alignment, multi-dimensional feature extraction and feature normalization processing;After the feature vector after feature normalization processing is input to AI decision engine, obtains point price signal probability, and is judged with the confidence threshold set to generate instruction;Real-time verification is carried out to the instruction generated, after passing through verification, standard CTP order structure body is constructed to send, and feedback optimization and front end push are carried out.The present application extracts the micro-morphology features of futures market and spot quotation by double-channel CNN structure respectively, and introduces gate attention mechanism to dynamically allocate futures and spot weight, effectively captures the complex nonlinear market rules such as "futures and spot departure" and "basis regression", strong adaptive ability, can adjust prediction logic in time when market sentiment switches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data processing, and in particular to an intelligent futures-spot fusion autonomous pricing system and method. Background Technology

[0002] "Point pricing" refers to a trade contract where the buyer and seller do not directly determine the final transaction price. Instead, they agree to use the futures price at a future point in time plus a basis (premium or discount) as the final settlement price. This model gives the buyer the right to choose the most favorable futures price within a specified period, thus transforming traditional "fixed-price" trade into "basis trading." Statistics show that in highly internationalized commodities such as non-ferrous metals and soybeans, the proportion of trade volume using point pricing has exceeded 60%. Enterprises use this method to flexibly mitigate the risks of drastic price fluctuations and lock in processing profits or trade spreads through hedging.

[0003] However, the widespread adoption of the spot pricing model also places extremely high demands on companies' trading decision-making capabilities. The core challenge in spot pricing lies in the accurate judgment of the "basis" (the difference between spot and futures prices) trend and the millisecond-level capture of pricing timing. Currently, the data environment supporting spot pricing decisions exhibits significant "binary heterogeneity," specifically as follows: Futures market data: Sourced from the official Level-1 or Level-2 market data interfaces of major futures exchanges (such as the Shanghai Futures Exchange, Dalian Commodity Exchange, and Zhengzhou Commodity Exchange). This type of data is highly standardized; during peak trading hours for mainstream commodities, the data packet refresh frequency reaches 500 milliseconds or even milliseconds, generating tens of millions of ticks daily. The rapid changes in futures prices require trading systems to possess extremely high concurrency processing capabilities. Spot market data: Sourced from spot e-commerce platforms (such as Zhaogang.com and SteelHome), industry information portals (such as Mysteel and SMM), or offline manual price inquiries. This type of data has highly inconsistent formats, vastly different update frequencies, and often exhibits discrete characteristics. For mainstream commodities, spot prices are updated approximately every 10 seconds to 1 minute; however, for some non-mainstream or regional commodities, the price update frequency is even lower, sometimes as low as several hours, and is often accompanied by unstructured text notes (such as "tax included, ex-factory", "self-pickup", etc.).

[0004] Therefore, existing pricing assistance technologies mainly remain at the following stages: 1. Manual statistics and Excel calculation: Traditional trade execution personnel (pricing staff) obtain spot quotations via telephone, WeChat, or QQ groups, manually enter them into Excel spreadsheets, and use simple linear formulas (e.g., basis = spot price - futures price) to calculate the price difference in real time. This method is inefficient and cannot perform multi-dimensional historical backtesting analysis. 2. Independent market data software comparison: Pricing staff use traditional futures trading software (such as WenHua Finance and Boyi Master) to monitor futures price trends in real time, while simultaneously viewing spot information websites through a browser. This "multi-screen, multi-window" operation mode forces manual cross-market information integration, lacking in-depth integrated analysis of the futures-spot linkage relationship. 3. Simple rule-based early warning: Some companies attempt to use scripts or simple programs based on fixed rules to set static thresholds for early warning, such as "prompt pricing when the basis is less than -100 yuan." However, when faced with complex market sentiment shifts and non-linear basis fluctuations, such rigid static rules often fail, or even produce erroneous and misleading signals. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide an intelligent futures-spot fusion autonomous pricing system and method, which solves the deficiencies of the prior art.

[0006] The objective of this invention is achieved through the following technical solution: an intelligent futures-spot fusion autonomous pricing system, the system comprising: a data access module, a futures-spot data alignment and cleaning module, a feature engineering database, an AI decision analysis engine, and an autonomous execution and risk control module;

[0007] The data access module is configured to establish physical connections with the trading interface of the futures exchange and the information source APIs of major spot e-commerce platforms to capture futures tick data and spot discrete quotes in real time.

[0008] The futures and spot data alignment and cleaning module is configured to perform timestamp alignment, noise reduction and completion on heterogeneous data based on a stream computing framework to construct a unified term data stream.

[0009] The feature engineering library is configured to store cleaned, standardized time-series data and calculate basis, momentum, and position structure in real time.

[0010] The AI ​​decision analysis engine is configured to be deployed on a GPU server cluster, load a pre-trained dual-channel spatiotemporal attention fusion prediction model, perform real-time inference on feature data, and output the probability and confidence of the pricing opportunity.

[0011] The autonomous execution and risk control module is configured to automatically generate pricing instructions based on AI decision results and preset risk control rules, and send them to the exchange to achieve autonomous pricing.

[0012] The dual-channel spatiotemporal attention fusion prediction model specifically performs the following:

[0013] A1. Construct two parallel input tensors, including the futures channel input. and spot channel input Introduce sinusoidal position code PE and add it to the futures channel input. and spot channel input This enables the model to perceive its current position within a historical cycle;

[0014] A2. By using three convolutional kernels of different sizes to capture the instantaneous fluctuations, local trends, and stationary patterns of the futures channel input and the spot channel input, respectively, the feature maps obtained from the convolutional kernels of different sizes are stitched together to obtain the high-level features of the futures channel. Advanced features of spot trading channels ;

[0015] A3. Advanced features of the futures trading channel are integrated through a gating attention fusion mechanism. Advanced features of spot trading channels By performing fusion, fusion characteristics are obtained. ;

[0016] A4. Integrating features The input is fed into the Transformer encoder layer, which uses a self-attention mechanism to directly focus on the turning points in the historical sequence when calculating the current state. Finally, the point price signal probability is output through a fully connected layer. .

[0017] The autonomous execution and risk control module specifically performs the following:

[0018] Set dynamic confidence threshold ,like > If the signal is determined to be a high-confidence price signal, the execution logic is entered to calculate the optimal order price and lot size.

[0019] like <1- If the signal is determined to be a reverse signal, the operation is suspended.

[0020] If 1- < < If the area is determined to be in a volatile zone, the current state will be maintained and no new instructions will be generated.

[0021] The checks will be performed sequentially, including fund checks, position checks, frequency checks, and checks to see if the circuit breaker mechanism has been triggered.

[0022] The autonomous trading gateway constructs a standard CTP order structure and sends it to the futures company's front-end machine via TCP protocol. At the same time, the system starts an order monitoring thread. If no response is received from the exchange within a set time, the system automatically initiates a cancellation request and resubmits the order.

[0023] The system listens for transaction reports, analyzes the transaction price, volume, and time, calculates the cost of this pricing, calculates the actual basis with the current futures price, updates the database, uses the pricing result as a label, stores it in the training dataset for incremental model training after the daily market close, and finally pushes the pricing and transaction signals to the client.

[0024] The timestamp alignment includes maintaining a 60-second spot price sliding window. When the time is received When the futures market is in, Find the spot price with the closest timestamp. ,like If there are no spot price updates within the time window, then the price change rate is based on the spot price change rate of the previous two time points. , calculation Theoretical spot price at any given time Construct aligned data pairs ( , , ), and calculate the instantaneous basis. .

[0025] A method based on an intelligent futures-spot fusion autonomous pricing system, the method comprising:

[0026] S1. After initial configuration, monitor the data stream in real time and perform cleaning, verification, futures-spot time axis alignment, multi-dimensional feature extraction and feature normalization on the data stream;

[0027] S2. Input the feature vector after feature normalization into the AI ​​decision engine to obtain the price signal probability. And it is used to generate instructions by comparing the results with the set confidence threshold;

[0028] S3. Perform real-time verification on the generated instructions. After passing the verification, construct a standard CTP message structure and send it. Also, perform feedback optimization and front-end push.

[0029] The feature vector, after feature normalization processing, is input into the AI ​​decision engine to obtain the probability of the pricing signal. include:

[0030] A1. Construct two parallel input tensors, including the futures channel input. and spot channel input Introduce sinusoidal position code PE and add it to the futures channel input. and spot channel input This enables the model to perceive its current position within a historical cycle;

[0031] A2. By using three convolutional kernels of different sizes to capture the instantaneous fluctuations, local trends, and stationary patterns of the futures channel input and the spot channel input, respectively, the feature maps obtained from the convolutional kernels of different sizes are stitched together to obtain the high-level features of the futures channel. Advanced features of spot trading channels ;

[0032] A3. Advanced features of the futures trading channel are integrated through a gating attention fusion mechanism. Advanced features of spot trading channels By performing fusion, fusion characteristics are obtained. ;

[0033] A4. Integrating features The input is fed into the Transformer encoder layer, which uses a self-attention mechanism to directly focus on the turning points in the historical sequence when calculating the current state. Finally, the point price signal probability is output through a fully connected layer. .

[0034] The method of generating instructions by determining and setting a confidence threshold includes:

[0035] B1. Setting dynamic confidence thresholds ,like > If the signal is determined to be a high-confidence price signal, the execution logic is entered to calculate the optimal order price and lot size.

[0036] B2, if <1- If the signal is determined to be a reverse signal, the operation is suspended.

[0037] B3. If 1- < < If the area is determined to be in a oscillation zone, the current state will be maintained and no new instructions will be generated.

[0038] S3 includes:

[0039] S301. Perform fund checks, position checks, frequency checks, and checks on whether the circuit breaker mechanism has been triggered in sequence.

[0040] S302. The autonomous trading gateway constructs a standard CTP order structure and sends it to the futures company's front-end machine via TCP protocol. At the same time, the system starts an order monitoring thread. If no response is received from the exchange within a set time, the system automatically initiates a cancellation request and resubmits the order.

[0041] S303: Listen to the transaction report, analyze the transaction price, volume and time, calculate the cost of this pricing, calculate the actual basis with the futures price at that time, update the database, use the pricing result as a label, store it in the training dataset for incremental model training after the daily market close, and finally push the pricing transaction signal to the client.

[0042] The aforementioned futures-spot timeline alignment includes: maintaining a 60-second sliding window for spot prices. When the time is received When the futures market is in, Find the spot price with the closest timestamp. ,like If there are no spot price updates within the time window, then the price change rate is based on the spot price change rate of the previous two time points. , calculation Theoretical spot price at any given time Construct aligned data pairs ( , , ), and calculate the instantaneous basis. .

[0043] The present invention has the following advantages:

[0044] 1. Through its unique futures-spot data alignment and cleaning module, the system fundamentally solves the problem of timeline misalignment between high-frequency futures tick data and discrete spot quotes. This module employs a stream computing framework, using millisecond-level timestamps in futures as a benchmark. It utilizes a "dynamic sliding window interpolation method" and a "holding pricing method" to map low-frequency spot quotes onto high-frequency futures time series in real time. Simultaneously, it combines a 3-Sigma outlier detection algorithm (standard deviation multiple = 3, sliding window = 100 data points) to automatically remove noise caused by network jitter or manual input errors.

[0045] 2. By using a dual-channel CNN structure to extract the micro-morphological features of futures market data and spot prices respectively, and introducing a gating attention mechanism to dynamically allocate the weights of futures and spot prices, it effectively captures complex nonlinear market patterns such as "futures-spot divergence" and "basis regression". Its strong adaptive capability can adjust the prediction logic in a timely manner when market sentiment changes.

[0046] 3. A fully automated closed-loop system has been built, encompassing data acquisition, feature extraction, model inference, and instruction issuance. The autonomous execution and risk control modules can complete the entire process from signal triggering to order placement within milliseconds, completely replacing the cumbersome process of traders simultaneously operating the CTP interface, Excel spreadsheets, and spot price quote webpages in the traditional model. In addition, real-time verification of funds, positions, and frequency is performed before the instruction is issued, effectively preventing operational risks such as "fat finger" errors. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the structure of the present invention;

[0048] Figure 2 This is a schematic flowchart of the method of the present invention;

[0049] Figure 3 This is a schematic diagram of the process for dual-channel spatiotemporal attention fusion prediction.

[0050] Figure 4 A comparison chart of basis distribution before and after alignment of current data;

[0051] Figure 5 This is a bar chart comparing the prediction accuracy of the present invention with that of existing methods;

[0052] Figure 6 This is a comparison chart of the time consumption of the present invention and the traditional process. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of this application provided below with reference to the accompanying drawings is not intended to limit the scope of protection of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application. The present invention will be further described below with reference to the accompanying drawings.

[0054] One embodiment of this invention relates to an intelligent futures-spot fusion autonomous pricing system, aiming to solve core problems in existing commodity trading pricing processes, such as the difficulty in aligning heterogeneous futures and spot data, inaccurate timing of pricing, lagging human decision-making, and high operational risks. This system, through deep fusion learning algorithms and stream computing technology, achieves a closed-loop process from real-time multi-source data acquisition and intelligent analysis of the futures-spot basis to autonomous execution of pricing instructions, helping physical enterprises and investment institutions accurately lock in optimal costs and profits in a rapidly changing market.

[0055] like Figure 1 As shown, this system includes a data access module, a futures-spot data alignment and cleaning module, a feature engineering database, an AI decision analysis engine, an autonomous execution and risk control module, and a visual monitoring terminal. The overall system adopts a layered distributed microservice architecture, connecting various hardware facilities through a 10 Gigabit low-latency switch to ensure efficient data flow and system stability. The architecture is divided into four layers from bottom to top, with the modules and specific parameters of each layer as follows:

[0056] (1) Data source layer: As the data input end of the system, it contains three types of core data sources, and their access methods and characteristics are as follows:

[0057] Futures Exchange Interface (CTP / Pegasus): Connects to major markets such as the Shanghai Futures Exchange, Dalian Commodity Exchange, and Zhengzhou Commodity Exchange. It obtains Level-2 market depth data through the CTP integrated trading platform API (ThostFtdcMdApi), with a data refresh rate of 500 milliseconds per tick (millisecond-level for some high-frequency instruments), processing over 80 million ticks daily. The data format is a binary stream, which needs to be converted into a structured object using a custom decoder, containing fields such as latest price, top five bid / ask prices, volume, and open interest.

[0058] Spot trading platform interface (API / web crawler): Integrates with over 10 mainstream spot information platforms, including Zhaogang.com, Mysteel.com, and SMM (Shanghai Metals Market). It obtains discrete spot price quotes through RESTful API or RPA (Robotic Process Automation) web crawler technology, with a data frequency of approximately 10 seconds to 5 minutes per update, and a daily processing volume of approximately 5 million records. The data format is mostly JSON or HTML, containing fields such as commodity, region, specifications, price including tax, and update time.

[0059] Internal Business Data Interface (ERP / MES): Connects to the enterprise's internal ERP system to obtain business constraint data such as procurement plans, sales contracts, inventory levels, and credit limits. The data is updated once a day or triggered in real time, serving as the boundary conditions for generating pricing strategies.

[0060] (2) Data access and processing layer: This layer includes a data access module (data access gateway), a futures and spot data alignment and cleaning module and a feature engineering database. It is responsible for data reception, buffering, cleaning and standardization, and is the system's "data middle platform".

[0061] Data Access Gateway: Deployed on a server with dual Intel Xeon Gold 6348R CPUs (2.6GHz, 28 cores), 64GB DDR4 ECC memory, and dual-port 10 Gigabit Ethernet cards. It runs a high-performance data forwarding program written in C++ (using ZeroMQ communication mode), supporting TCP / IP and UDP multicast protocols, with a concurrent throughput of 500,000 packets / second, ensuring no packet loss or congestion even under high-frequency market fluctuations.

[0062] Distributed message queue cluster: Utilizing Kafka version 3.0.0, configured with 12 partitions, a 3-replication factor, and a persistent storage strategy. It has a message backlog capacity of hundreds of millions, used for peak shaving and valley filling, buffering the pressure difference between sudden surges in futures market traffic and spot market query requests.

[0063] Streaming computing engine: Deploy an Apache Flink 1.15.0 cluster and configure JobManager and TaskManager. Core execution logic includes "time alignment" and "anomaly cleanup".

[0064] Time alignment algorithm: based on futures tick timestamps Based on this, a combination of "holding pricing method" and "linear interpolation method" is used to analyze low-frequency spot prices. Mapping to the futures timeline, a continuous basis sequence is constructed. The time window size is set to 60 seconds.

[0065] Anomaly cleaning algorithm: 3-Sigma rules (standard deviation multiple = 3, sliding window = 100 points) are executed to remove noise caused by network jitter; business rule validation (such as price fluctuation limits) is performed to remove erroneous data. The data accuracy after cleaning reaches 99.95%.

[0066] Feature Engineering Database: Based on the cleaned data stream, 18 types of feature factors are calculated in real time, including: basis features (basis value, basis change rate), structural features (term structure, warehouse receipt changes), sentiment features (volume-weighted average price VWAP, net capital inflow), and macroeconomic features (US dollar index correlation, crude oil price ratio). Features are updated every 1 second, and calculation results are synchronously written to both the Redis hot database and the InfluxDB cold database.

[0067] (3) Core computing layer: This layer is the "brain" of the system, responsible for training, reasoning and strategy generation of AI models, including the AI ​​decision analysis engine.

[0068] AI Decision Engine (GPU Cluster): Deployed as an NVIDIA HGX A100 80GB GPU server cluster (8 nodes in total), using NVLink interconnect technology. Loads a "dual-channel spatiotemporal attention fusion prediction algorithm" model trained based on the PyTorch 1.12 framework and exports it in ONNX format. Utilizes CUDA 11.8 and TensorRT 8.4 for inference acceleration, supporting FP16 half-precision computation. Feature matrix dimension = 512, single inference latency controlled within 2 milliseconds, and total cluster throughput reaches 200,000 operations per second.

[0069] Strategy Executor (CPU Cluster): Deploys an Intel Xeon Platinum 8360Y CPU cluster to run a reinforcement learning agent. It receives probability signals from the AI ​​engine, combines them with internal risk control parameters (stop-loss line, take-profit line, exposure limit), calculates the optimal order size and price, and generates order instructions conforming to the CTP protocol standard.

[0070] Caching and Time-Series Libraries: Redis 7.0: Configured with 256GB of memory, AOF persistence enabled (everysec strategy), storing real-time price matrix, current position status, and risk control thresholds, with read / write latency <0.5 milliseconds. InfluxDB 2.0: Configured with the TSM storage engine, data retention policy set to 1 year, storing historical basis candlestick charts and transaction reports, with query response time <50 milliseconds.

[0071] (4) Application Execution and Presentation Layer: This layer is responsible for transforming decisions into actual transaction actions and providing a human-computer interaction interface, including autonomous execution and risk control modules and a visual monitoring terminal.

[0072] Self-developed trading gateway: A low-level trading middleware developed in C++, penetrating the front-end servers of futures companies (supporting protocols such as CTP, Pegasus, and Yisheng). It achieves millisecond-level order sending and cancellation operations, supporting multiple instruction types such as FAK (Execute Now, Cancel Remaining) and FOK (Execute All or Cancel). It incorporates a "high-speed risk control module" to perform flow control checks (such as frequency limits and position limits) before order placement to prevent erroneous orders.

[0073] After the instruction is generated but before it is sent to the exchange, it must undergo real-time verification by the risk control module, including: Funds check: Margin usage < Available funds Risk threshold (80%), position check: current positions + number of lots placed. Contract position limit and frequency check: The current number of orders per second is less than the frequency limit (10 times / second) to prevent triggering the exchange's abnormal trading warning and circuit breaker mechanism: If the loss exceeds the preset value (e.g., 50,000 yuan) within 1 minute, the system will automatically trigger a "soft circuit breaker", suspend the self-pricing function and lock the interface. It can only be restored by manual unlocking.

[0074] Visual Monitoring Terminal (PC / Web): Utilizes Vue.js 3.2 + Electron framework, with WebGL technology for front-end rendering. The interface includes: Real-time Market Data Dashboard: Displays dual candlestick charts for futures and spot prices, a basis chart, and a real-time price progress bar. AI Decision Dashboard: Displays model prediction probability curves, bullish / bearish signal indicators, and historical win rate statistics. Trading Console: One-click start / stop for self-pricing, manual intervention buttons, and transaction details. Data push is based on the WebSocket protocol, with a refresh rate of 1 second and a latency of <100 milliseconds.

[0075] like Figure 2 As shown, another embodiment of the present invention relates to a method based on an intelligent futures-spot fusion pricing system. This method uses a computer program to physically execute steps such as data acquisition, fusion, reasoning, decision-making, and execution, thereby achieving an automated closed loop from signal discovery to transaction execution. Specifically, it includes the following:

[0076] Step ①: Listen to the data stream and initialize the configuration;

[0077] After system startup, the background daemon first loads the configuration file, initializing the pricing contract (e.g., RB2405), basis threshold, and risk control parameters (maximum single transaction size = 100 lots, maximum daily loss = 500,000 yuan). Communication links with the CTP front-end server (port 10201) and the spot API server are maintained via long connections. I / O multiplexing technology is used to monitor the futures market data port and the spot data port separately. When new tick data arrives, an event interrupt is triggered, and the data is stored in a memory ring buffer (size = 8192 bytes) to ensure lock-free and high-concurrency data reading.

[0078] Step 2: Data cleaning and physical verification;

[0079] The system reads the raw data from the buffer and performs physical validity verification logic:

[0080] Price reasonableness verification: Check whether the latest price field is within the daily price limit range (e.g., the daily price fluctuation range for rebar is ±6%), and remove outliers that are outside the range.

[0081] Timestamp monotonicity check: Check the current Tick timestamp Is it greater than the previous timestamp? (Allows 500ms of network jitter error), if time reversal occurs, the packet will be discarded.

[0082] Null / zero value handling: Check if key fields (such as the best bid price and best ask price) are 0 or null. If they are invalid, fill them with the previous valid market data.

[0083] If data is abnormal, the system will automatically record it in the error log table and trigger the "abnormal counter". When the counter exceeds the threshold (e.g., 100 times) within 1 minute, an alarm will be sent to the administrator through the DingTalk / SMS interface.

[0084] Step 3: Align the futures and spot timelines;

[0085] Given that the frequency of futures data (500ms) is much higher than that of spot data (30s to 1min), the system uses a "dynamic sliding window interpolation method" to solve the timeline misalignment problem.

[0086] Maintain a 60-second spot price sliding window. When the time is received When the futures market is in, Find the spot price with the closest timestamp. .,like If there are no spot price updates within the time window, the "linear extrapolation algorithm" is activated: based on the spot price change rate of the previous two time points. , calculation Theoretical spot price at any given time Construct aligned data pairs ( , , ), and calculate the instantaneous basis. .

[0087] Step 4: Real-time extraction of multidimensional features;

[0088] Based on the aligned data stream, the system calculates 18 types of feature vectors in real time in the feature engineering module: Basis feature: instantaneous basis. Historical quantiles of the basis (Back window = 250 days), Trend characteristics: Basis momentum = Change rate of open interest in the main futures contract Volatility characteristics: Basis volatility is calculated in real time using the GARCH(1,1) model. Microstructural characteristics: bid-ask spread The percentage of large orders. The calculation results are encapsulated into feature vectors. .

[0089] Step 5: Feature normalization processing;

[0090] To eliminate the dimensional differences between different features and accelerate AI model convergence, the system adopts the Min-Max normalization method:

[0091] ,

[0092] in, and The training set contains the historical minimum and maximum values ​​of each feature (e.g., a basis range of -500 to 800 yuan / ton). The normalized feature vector is then used. It is compressed to the [0, 1] interval and converted to Tensor format (dimension = 1x18x1).

[0093] Step 6: Real-time inference by the AI ​​model;

[0094] tensor The input is fed into the AI ​​decision engine. The model performs a forward propagation operation: extracting temporal dependency features through a Transformer encoder. These features are then mapped to an output vector through a fully connected layer. The output layer generates "point price signal probabilities" using a Softmax function. (Range 0-1), representing the expected profit value of executing the price at the current moment. The time taken for a single inference is strictly controlled within 2 milliseconds to ensure that instantaneous market conditions can be captured.

[0095] Furthermore, such as Figure 3 As shown, it specifically includes:

[0096] Input tensor construction: setting the sliding time window length (Corresponding to approximately 2 minutes of historical data). Constructing two parallel input tensors includes:

[0097] Futures channel input It includes six dimensions of features: futures price, trading volume, open interest, bid-ask spread, etc., spanning the past 120 time steps. .

[0098] Spot trading channel input Includes four dimensions of features: spot price, basis, inventory data, premium / discount, etc., spanning the past 120 time steps (after alignment). .

[0099] To address the issue of sequential data order, sinusoidal position coding is introduced:

[0100] ,

[0101] ,

[0102] sinusoidal position encoding vector Add to futures channel input and spot channel input This enables the model to perceive "the current moment's position in the historical cycle".

[0103] Dual-channel local feature extraction: Market price fluctuations often contain patterns at different scales (such as rapid rises on the order of seconds and oscillations on the order of minutes). The system uses multi-scale parallel convolution kernels to extract features: Scale 1 (short-term): convolution kernel size. Capture instantaneous fluctuations. Scale 2 (intermediate): Kernel size To capture local trends. Scale 3 (long-term): Kernel size. To capture stable patterns.

[0104] The calculation formula is as follows (taking the futures channel as an example):

[0105] ,

[0106] in, This represents the convolution operation. This is the weight matrix. Feature maps at different scales are concatenated to obtain the high-level features of the futures channel. Similarly, the advanced features of the spot trading channel can be obtained. .

[0107] Gated Attention Fusion Mechanism: Traditional methods typically involve simply concatenating futures and spot features, ignoring the differences in dominant factors at different market stages (e.g., "futures leading the rise" or "spot following the fall"). This invention designs a gating unit to dynamically calculate the weighting coefficient α of futures and spot features:

[0108] ,

[0109] ,

[0110] ,

[0111] Here, α is a dynamic weight vector ranging from (0,1). When the market is in a "futures-spot divergence" phase (such as futures market sentiment being high but spot market sentiment being weak), the algorithm automatically calculates a higher α value, assigning a higher weight to the futures channel and prompting the system to follow the futures trend. Conversely, when fundamentals dominate, the weight is tilted towards the spot market. This mechanism simulates the attention allocation logic of experienced traders when "watching the market".

[0112] Transformer temporal reasoning: fusing features Input the Transformer encoder layer. Compared to traditional RNNs, Transformers have stronger long-range capture capabilities.

[0113] Self-attention mechanism:

[0114] ,

[0115] Among them, Query(Q), Key(K), and Value(V) are all derived from... It is derived from a linear transformation. This mechanism allows the model to focus directly on key turning points in the historical sequence (such as the highest price in the past 30 seconds) when calculating the current state, ignoring irrelevant noise.

[0116] Output Probabilities: Finally, the feature vectors are mapped to probability outputs through a fully connected layer.

[0117] ,

[0118] in, Indicates the future The probability that the basis strengthens or the futures price is favorable for the pricing within seconds (e.g., 30 seconds).

[0119] Step 7: Confidence determination and strategy generation;

[0120] The system sets a dynamic confidence threshold. (Default value = 0.85, can be dynamically adjusted to 0.90 or 0.80 based on market volatility). The determination logic is as follows:

[0121] like > The signal is identified as a "high-confidence pricing signal." The system then enters its execution logic to calculate the optimal order price (usually the counterparty price to ensure immediate execution) and the number of lots (based on the remaining unpriced volume).

[0122] like <1- If the signal is determined to be a "reverse signal", the system will suspend operation and remain on hold.

[0123] If 0.15 < <0.85: This is considered an "oscillation zone". The system maintains its current state and does not generate new instructions.

[0124] Introduce a decision lag penalty factor: If the model outputs a high confidence signal multiple times (e.g., 3 times) in a row, the execution priority is increased to prevent false triggering caused by momentary jitter.

[0125] At the same time, the strategy module will check whether the current time is within the trading period (such as 9:00-15:00) and verify the available funds balance.

[0126] Step 8: Risk control compliance check;

[0127] After the instruction is generated but before it is sent to the exchange, it must undergo real-time verification by the risk control module: Funds check: Margin usage < Available funds Risk threshold (80%), position check: current positions + number of lots placed. Contract position limit and frequency check: The current number of orders per second is less than the frequency limit (10 times / second) to prevent triggering the exchange's abnormal trading warning and circuit breaker mechanism: If the loss exceeds the preset value (e.g., 50,000 yuan) within 1 minute, the system will automatically trigger a "soft circuit breaker", suspend the self-pricing function and lock the interface. It can only be restored by manual unlocking.

[0128] Step 9: Send commands autonomously;

[0129] After the risk control verification is passed, the autonomous trading gateway constructs a standard CTP order structure and sends it to the futures company's front-end server via the TCP protocol. After sending, the system starts the "order monitoring thread". If no response is received from the exchange within 500 milliseconds, it automatically initiates a cancellation request and attempts to resubmit the order (retry count = 2).

[0130] Step 10: Feedback optimization and front-end push;

[0131] Transaction report processing: Monitor OnRtnTrade reports, parse the transaction price, volume, and time. Calculate the cost of this pricing transaction. The actual basis is calculated and updated to the database, along with the spot price at that time.

[0132] Model feedback: The pricing result (profit / loss) is used as a label and stored in the training dataset for incremental model training after the market closes each day, thus realizing the "online learning" closed loop.

[0133] Front-end push: The “price-based transaction” signal is pushed to the client via WebSocket. A green prompt box pops up on the interface: “Price successful: transaction price 3850, basis 50”, accompanied by an audio and visual reminder.

[0134] Loop and Exception Handling: If steps ①, ②, and ⑦ are determined to be "No", the system enters non-blocking wait (Sleep 10ms) and continues to listen. If any step results in an unrecoverable exception (such as network disconnection), the system automatically switches to "Backup Line" or "Safe Mode" (closing all open circuits) and records a detailed exception log.

[0135] like Figure 4As shown in the figure, the left side displays the original basis data distribution without the processing of this invention, exhibiting obvious discretization and sawtooth fluctuations, with low data consistency. The right side displays the basis data distribution after the "time alignment" processing in step ③, with a smooth and continuous curve, intuitively demonstrating a significant improvement in data consistency and quality. According to historical backtesting data, the prediction accuracy of traditional linear models in volatile markets or trend reversal phases is usually below 55% (only slightly higher than random guessing), leading to huge basis risk exposure for enterprises. However, the AI ​​model of this invention, trained and validated with tick-level data (approximately 5 million samples) over the past 3 years, has a prediction accuracy consistently above 85%, with an F1-score of 0.82. For example, in the 2023 rebar futures-spot pricing scenario, the system successfully captured the divergence signal of "sharp drop in spot inventory + surge in futures open interest," predicting a basis widening probability of 92%, assisting enterprises to complete pricing at the optimal time. Compared with traditional manual experience-based pricing, the arbitrage profit per transaction increased by more than 30%.

[0136] like Figure 5 As shown in the figure, this bar chart compares the performance of the traditional linear model (OLS / MA) and the AI ​​model of this invention on the validation set. The data shows that the AI ​​model achieves a prediction accuracy of 85%, significantly higher than the 55% of the traditional method, intuitively demonstrating the technological breakthrough of this invention in predictive capabilities.

[0137] like Figure 6 As shown in the figure, this comparative bar chart illustrates the average processing time for a single pricing transaction. The traditional manual process takes approximately 120 minutes per day, while the automated process of this invention takes less than 10 minutes per day, representing an efficiency improvement of over 12 times. This clearly demonstrates the efficiency advantages brought by automation.

[0138] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and improvements, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. An intelligent futures-spot fusion autonomous pricing system, characterized in that: The system includes: a data access module, a futures and spot data alignment and cleaning module, a feature engineering database, an AI decision analysis engine, and an autonomous execution and risk control module; The data access module is configured to establish physical connections with the trading interface of the futures exchange and the information source APIs of major spot e-commerce platforms to capture futures tick data and spot discrete quotes in real time. The futures and spot data alignment and cleaning module is configured to perform timestamp alignment, noise reduction and completion on heterogeneous data based on a stream computing framework to construct a unified term data stream. The feature engineering library is configured to store cleaned, standardized time-series data and calculate basis, momentum, and position structure in real time. The AI ​​decision analysis engine is configured to be deployed on a GPU server cluster, load a pre-trained dual-channel spatiotemporal attention fusion prediction model, perform real-time inference on feature data, and output the probability and confidence of the pricing opportunity. The autonomous execution and risk control module is configured to automatically generate pricing instructions based on AI decision results and preset risk control rules, and send them to the exchange to achieve autonomous pricing.

2. The intelligent futures-spot fusion autonomous pricing system according to claim 1, characterized in that: The dual-channel spatiotemporal attention fusion prediction model specifically performs the following: A1. Construct two parallel input tensors, including the futures channel input. and spot channel input Introduce sinusoidal position code PE and add it to the futures channel input. and spot channel input This enables the model to perceive its current position within a historical cycle; A2. By using three convolutional kernels of different sizes to capture the instantaneous fluctuations, local trends, and stationary patterns of the futures channel input and the spot channel input, respectively, the feature maps obtained from the convolutional kernels of different sizes are stitched together to obtain the high-level features of the futures channel. Advanced features of spot trading channels ; A3. Advanced features of the futures trading channel are integrated through a gating attention fusion mechanism. Advanced features of spot trading channels By performing fusion, fusion characteristics are obtained. ; A4. Integrating features The input is fed into the Transformer encoder layer, which uses a self-attention mechanism to directly focus on the turning points in the historical sequence when calculating the current state. Finally, the point price signal probability is output through a fully connected layer. .

3. The intelligent futures-spot fusion autonomous pricing system according to claim 2, characterized in that: The autonomous execution and risk control module specifically performs the following: Set dynamic confidence threshold ,like > If the signal is determined to be a high-confidence price signal, the execution logic is entered to calculate the optimal order price and lot size. like <1- If the signal is determined to be a reverse signal, the operation is suspended. If 1- < < If the area is determined to be in a volatile zone, the current state will be maintained and no new instructions will be generated. The checks will be performed sequentially, including fund checks, position checks, frequency checks, and checks to see if the circuit breaker mechanism has been triggered. The autonomous trading gateway constructs a standard CTP order structure and sends it to the futures company's front-end machine via TCP protocol. At the same time, the system starts an order monitoring thread. If no response is received from the exchange within a set time, the system automatically initiates a cancellation request and resubmits the order. The system listens for transaction reports, analyzes the transaction price, volume, and time, calculates the cost of this pricing, calculates the actual basis with the current futures price, updates the database, uses the pricing result as a label, stores it in the training dataset for incremental model training after the daily market close, and finally pushes the pricing and transaction signals to the client.

4. The intelligent futures-spot fusion autonomous pricing system according to claim 2, characterized in that: The timestamp alignment includes maintaining a 60-second spot price sliding window. When the time is received When the futures market is in, Find the spot price with the closest timestamp. ,like If there are no spot price updates within the time window, then the price change rate is based on the spot price change rate of the previous two time points. , calculation Theoretical spot price at any given time Construct aligned data pairs ( , , ), and calculate the instantaneous basis. .

5. A method based on an intelligent futures-spot fusion autonomous pricing system, characterized in that: The method includes: S1. After initial configuration, monitor the data stream in real time and perform cleaning, verification, futures-spot time axis alignment, multi-dimensional feature extraction and feature normalization on the data stream; S2. Input the feature vector after feature normalization into the AI ​​decision engine to obtain the price signal probability. And it is used to generate instructions by comparing the results with the set confidence threshold; S3. Perform real-time verification on the generated instructions. After passing the verification, construct a standard CTP message structure and send it. Also, perform feedback optimization and front-end push.

6. The method for an intelligent futures-spot fusion autonomous pricing system according to claim 5, characterized in that: The feature vector, after feature normalization processing, is input into the AI ​​decision engine to obtain the probability of the pricing signal. include: A1. Construct two parallel input tensors, including the futures channel input. and spot channel input Introduce sinusoidal position code PE and add it to the futures channel input. and spot channel input This enables the model to perceive its current position within a historical cycle; A2. By using three convolutional kernels of different sizes to capture the instantaneous fluctuations, local trends, and stationary patterns of the futures channel input and the spot channel input, respectively, the feature maps obtained from the convolutional kernels of different sizes are stitched together to obtain the high-level features of the futures channel. Advanced features of spot trading channels ; A3. Advanced features of the futures trading channel are integrated through a gating attention fusion mechanism. Advanced features of spot trading channels By performing fusion, fusion characteristics are obtained. ; A4. Integrating features The input is fed into the Transformer encoder layer, which uses a self-attention mechanism to directly focus on the turning points in the historical sequence when calculating the current state. Finally, the point price signal probability is output through a fully connected layer. .

7. The method for an intelligent futures-spot fusion autonomous pricing system according to claim 5, characterized in that: The method of generating instructions by determining and setting a confidence threshold includes: B1. Setting dynamic confidence thresholds ,like > If the signal is determined to be a high-confidence price signal, the execution logic is entered to calculate the optimal order price and lot size. B2, if <1- If the signal is determined to be a reverse signal, the operation is suspended. B3. If 1- < < If the area is determined to be in a oscillation zone, the current state will be maintained and no new instructions will be generated.

8. The method for an intelligent futures-spot fusion autonomous pricing system according to claim 5, characterized in that: S3 includes: S301. Perform fund checks, position checks, frequency checks, and checks on whether the circuit breaker mechanism has been triggered in sequence. S302. The autonomous trading gateway constructs a standard CTP order structure and sends it to the futures company's front-end machine via TCP protocol. At the same time, the system starts an order monitoring thread. If no response is received from the exchange within a set time, the system automatically initiates a cancellation request and resubmits the order. S303: Listen to the transaction report, analyze the transaction price, volume and time, calculate the cost of this pricing, calculate the actual basis with the futures price at that time, update the database, use the pricing result as a label, store it in the training dataset for incremental model training after the daily market close, and finally push the pricing transaction signal to the client.

9. The method for an intelligent futures-spot fusion autonomous pricing system according to claim 5, characterized in that: The aforementioned futures-spot timeline alignment includes: maintaining a 60-second sliding window for spot prices. When the time is received When the futures market is in, Find the spot price with the closest timestamp. ,like If there are no spot price updates within the time window, then the price change rate is based on the spot price change rate of the previous two time points. , calculation Theoretical spot price at any given time Construct aligned data pairs ( , , ), and calculate the instantaneous basis. .