DPU-based consistent transaction factor calculation method and system
By adopting DPU-based computing methods in financial services and using DPU acceleration cores to perform consistent transaction factor calculations, the problems of low computing efficiency and high resource utilization of existing CPU solutions are solved, and more efficient computing and lower latency are achieved.
Patent Information
- Application Number
- CN202411619775.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-11-13
AI Technical Summary
Existing CPU solutions cannot provide sufficient computing power and lower processing delays to support financial services, and the CPU occupies a high occupancy rate when calculating large amounts of data, so it is impossible to perform other tasks.
Using DPU-based computing method, the CPU is connected to the PCIe bus, and the DPU acceleration core is used to perform consistent transaction factor calculations, reducing the computing burden of the CPU and improving computing efficiency.
The calculation rate is improved, processing delay is reduced, CPU resources are released for other processing work, and data processing efficiency is improved.
Smart Images

Figure CN119831737A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of consistent transaction factor calculation, and in particular to a method and system for calculating a consistent transaction factor based on DPU. Background Art
[0002] With the development of technology in modern society, disk read and write and network bandwidth performance are constantly improving. The performance difficulties in the fields of finance and quantitative trading have shifted to computing power and processing delay. The existing CPU (central processing unit) solutions cannot provide sufficient computing power and lower processing delay to support existing financial services. In addition, the process of the central processing unit calculating a large amount of data will generate a high CPU occupancy rate and cannot perform other tasks. Therefore, how to obtain a calculation solution and technical architecture for consistent trading factors with stronger computing power and lower delay is an urgent problem to be solved. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a method and system for calculating a consistent transaction factor based on DPU to eliminate or improve one or more defects existing in the prior art and solve the problem of low efficiency in calculating the consistent transaction factor in the prior art.
[0004] One aspect of the present invention provides a consistent transaction factor calculation method based on a DPU, the method is executed based on a DPU, the DPU is connected to a CPU via a PCIe bus, the CPU deploys a CPU memory, and the DPU deploys a DPU memory and an acceleration core, the method comprising:
[0005] Acquire the stock transaction information, stock length and stock quantity scheduled by the CPU from the CPU memory; the stock transaction information includes a closing price sequence, an opening price sequence, a highest price sequence, a lowest price sequence and a transaction price sequence;
[0006] receiving the stock transaction information, the stock length and the stock quantity transmitted through the PCIe bus and storing them in the DPU memory, reading the stock length and the stock quantity through the acceleration core to obtain the length information of a single stock, and reading the stock transaction information according to the length information of the single stock to obtain the corresponding stock transaction information to be processed;
[0007] Constructing a consistent transaction factor calculation formula that complies with DPU calculation, converting the to-be-processed stock transaction information into column data that can be processed by the acceleration core in the DPU, and calculating first cumulative data and second cumulative data through the column data; the column data includes closing price data, opening price data, highest price data, lowest price data and transaction price data; the first cumulative data represents the sum of the transaction volumes with closing prices higher than opening prices in the column data after the programming and operation of the consistent transaction factor calculation formula, and the second cumulative data represents the sum of the transaction volumes contained in the column data that have not been programmed and operated by the consistent transaction factor calculation formula;
[0008] The first accumulated data and the second accumulated data are respectively transferred into a first PCIe register and a second PCIe register, and a consistent transaction factor calculation result is obtained by dividing the second accumulated data by the first accumulated data.
[0009] In some embodiments, constructing a consistent transaction factor calculation formula that complies with DPU calculation, converting the to-be-processed stock transaction information into column data that can be processed by the acceleration core in the DPU, and calculating the first accumulated data and the second accumulated data through the column data includes:
[0010] Convert the to-be-processed stock transaction information into closing price data, opening price data, highest price data, lowest price data and transaction price data that can be processed by the acceleration core in the DPU;
[0011] The closing price data is divided into two paths for filtering and comparison respectively, and the opening price data is divided into two paths for filtering and comparison respectively; according to the comparison result of the closing price data and the opening price data for comparison, the column data is filtered to obtain closing price filtering data whose closing price is higher than the opening price, opening price filtering data, highest price filtering data, lowest price filtering data and transaction price filtering data;
[0012] Half of the subtraction result of the highest price filter data and the lowest price filter data and the subtraction result of the closing price filter data and the opening price filter data are filtered to obtain change data, the change data and the transaction price filter data are filtered to obtain the transaction volume with a closing price higher than the opening price and add them to obtain the first cumulative data, and the second cumulative data is obtained by adding the transaction volumes contained in the transaction price data.
[0013] In some embodiments, the method further includes: the consistent transaction factor calculation formula uses parallel computing to calculate the first accumulated data and the second accumulated data.
[0014] In some embodiments, the method further includes: feeding back the consistency transaction factor to the transaction processing end for market transaction trend analysis, market transaction risk analysis and market transaction abnormality analysis, and formulating corresponding market transaction strategies based on the analysis results.
[0015] On the other hand, the present invention further provides a consistent transaction factor calculation system based on DPU, wherein the system is used to execute the consistent transaction factor calculation method based on DPU, and the system comprises:
[0016] CPU memory module, used to store stock transaction information, stock length and stock quantity;
[0017] A PCIe bus transmission module, used for transmitting the stock transaction information, the stock length and the stock quantity from the CPU memory module to the DPU;
[0018] A DPU memory module, used for receiving and storing the stock transaction information, the stock length and the stock quantity through the DPU memory;
[0019] A computing module is configured to obtain the length information of a single stock by reading the stock length and the stock quantity through an acceleration core, read the stock trading information according to the length information of the single stock to obtain the corresponding stock trading information to be processed, convert the stock trading information to be processed into column data that can be processed by the acceleration core in the DPU and calculate the first accumulated data and the second accumulated data, and obtain the calculation result of the consistent trading factor by dividing the second accumulated data by the first accumulated data.
[0020] In some embodiments, the system further comprises:
[0021] A cloud storage system is used to store the stock transaction information, the stock length, the stock quantity, the first accumulated data, the second accumulated data and the consistent transaction factor calculation result.
[0022] In some embodiments, the system further comprises:
[0023] The analysis module is used to analyze the market transaction change trend, market transaction risk and market transaction abnormality according to the consistent transaction factors and formulate corresponding market transaction strategies.
[0024] In some embodiments, the computing module includes:
[0025] A data acquisition component is used to acquire the stock transaction information, the stock length and the stock quantity in the DPU memory module; acquire the length information of a single stock according to the stock length and the stock quantity, and read the stock transaction information according to the length information of the single stock to acquire the corresponding stock transaction information to be processed;
[0026] A data extraction component is used to convert the to-be-processed stock transaction information into closing price data, opening price data, highest price data, lowest price data and transaction price data that can be processed by the acceleration core in the DPU; divide the closing price data into two paths for filtering and comparison respectively, and divide the opening price data into two paths for filtering and comparison respectively;
[0027] A data comparison component is used to compare the closing price data and the opening price data one by one according to the order correspondence; when the closing price of the data point is greater than the opening price, 1 is output, otherwise 0 is output; and the output data composed of all outputs is divided into five paths;
[0028] A data filtering component, used for receiving the five output data and the corresponding closing price data, opening price data, highest price data, lowest price data and transaction price data using five filtering subcomponents, and outputting the corresponding closing price filtering data, opening price filtering data, highest price filtering data, lowest price filtering data and transaction price filtering data when the output data in the five filtering subcomponents is 1, and not outputting otherwise;
[0029] A subtraction component, used for subtracting the opening price filtering data from the closing price filtering data to obtain first result data, and subtracting the lowest price filtering data from the highest price filtering data to obtain second result data;
[0030] An accumulation component is used to compare the first result data with the second result data and filter them with the transaction price filtering data, add the transaction volumes whose closing prices are higher than the opening prices to obtain the first accumulated data, and add the transaction volumes contained in the transaction price data to obtain the second accumulated data.
[0031] A division calculation component is used to obtain a consistent transaction factor calculation result after dividing the second accumulated data by the first accumulated data.
[0032] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, wherein the computer program / instruction implements the steps of any of the above methods when executed by a processor.
[0033] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, characterized in that the program implements the steps of any of the above methods when executed by a processor.
[0034] The beneficial effects of the present invention are at least:
[0035] In a consistent transaction factor calculation method and system based on a DPU described in the present invention, the method is executed based on a DPU, the DPU is connected to a CPU via a PCIe bus, the CPU deploys a CPU memory, and the DPU deploys a DPU memory and an acceleration core, and the calculation process of the consistent transaction factor is unloaded to the DPU for execution, thereby increasing the calculation rate and reducing the processing delay, and the CPU does not need to perform heavy computing tasks while providing space for other processing work; the acceleration core reads the stock length and the stock quantity received by the DPU memory to obtain the length information of a single stock, and reads the stock transaction information according to the length information of the single stock to obtain the corresponding stock transaction information to be processed, the acceleration core can directly access the DPU memory, reducing the data transmission delay, and the acceleration core can quickly read and write data, thereby increasing data processing efficiency; the consistent transaction factor calculation formula that complies with the DPU calculation adopts a parallel computing method, and the computing core can improve the processing capability of parallel computing.
[0036] Furthermore, the PCIe bus between the CPU and the DPU of the present invention provides a high-bandwidth data transmission channel. Transmitting the first accumulated data and the second accumulated data into the first PCIe register and the second PCIe register respectively can utilize the high-bandwidth data transmission channel to reduce data transmission delay and improve data processing efficiency.
[0037] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0038] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0040] Figure 1The figure is a flowchart of a method for calculating a consistent transaction factor based on DPU according to an embodiment of the present invention.
[0041] Figure 2 A schematic diagram of the structure of a DPU-based consistent transaction factor calculation system according to an embodiment of the present invention.
[0042] Figure 3 This is a schematic diagram of the structure of a computing module in a computing system for a consistent transaction factor based on a DPU according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0044] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0045] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0046] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0047] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0048] In the prior art, the calculation of the consistent transaction factor is only performed on the CPU. The existing CPU solution cannot provide sufficient computing power and lower processing latency to support existing financial services. The CPU instruction set architecture cannot efficiently and quickly calculate the consistent transaction factor for a large amount of data, and the CPU calculation process for a large amount of data will generate a very high CPU occupancy rate, making it impossible to perform other tasks. The present invention proposes a method and system for calculating a consistent transaction factor based on a DPU. The method is executed based on a DPU. The DPU is connected to a CPU through a PCIe bus, and stock transaction information, stock length and stock quantity in the CPU memory transmitted through the PCIe bus are obtained. The stock length and stock quantity are read by an acceleration core to obtain the length information of a single stock, and the stock transaction information is read according to the length information of the single stock to obtain the corresponding stock transaction information to be processed; a consistent transaction factor calculation formula that conforms to the DPU calculation is constructed, and the stock transaction information to be processed is converted into column data that can be processed by the acceleration core in the DPU and a first accumulated data and a second accumulated data are calculated; the first accumulated data represents the sum of the transaction volumes in the column data with a closing price higher than an opening price after the programming operation of the consistent transaction factor calculation formula, and the second accumulated data represents the sum of the transaction volumes contained in the column data that has not been programmed and operated by the consistent transaction factor calculation formula; the first accumulated data and the second accumulated data are respectively transmitted to a first PCIe register and a second PCIe register, and the consistent transaction factor calculation result is obtained by dividing the second accumulated data by the first accumulated data.
[0049] Figure 1 The present invention is a flowchart of a method for calculating a consistent transaction factor based on a DPU according to an embodiment of the present invention. Specifically, the present invention provides a method for calculating a consistent transaction factor based on a DPU, the method is executed based on a DPU, the DPU is connected to a CPU via a PCIe bus, the CPU deploys a CPU memory, and the DPU deploys a DPU memory and an acceleration core, and the method includes the following steps S101 to S104:
[0050] Step S101: Acquire the stock transaction information, stock length and stock quantity scheduled by the CPU from the CPU memory; the stock transaction information includes the closing price sequence, the opening price sequence, the highest price sequence, the lowest price sequence and the transaction price sequence.
[0051] Step S102: Receive the stock transaction information, stock length and stock quantity transmitted through the PCIe bus and store them in the DPU memory, read the stock length and stock quantity through the acceleration core to obtain the length information of a single stock, and read the stock transaction information according to the length information of the single stock to obtain the corresponding stock transaction information to be processed.
[0052] Step S103: construct a consistent transaction factor calculation formula that complies with DPU calculation, convert the stock transaction information to be processed into column data that can be processed by the acceleration core in the DPU, and calculate the first cumulative data and the second cumulative data through the column data; the column data includes closing price data, opening price data, highest price data, lowest price data and transaction price data; the first cumulative data represents the sum of the transaction volumes with closing prices higher than opening prices in the column data after the programming and operation of the consistent transaction factor calculation formula, and the second cumulative data represents the sum of the transaction volumes contained in the column data that has not been programmed and operated by the consistent transaction factor calculation formula.
[0053] Step S104: the first accumulated data and the second accumulated data are respectively transferred into the first PCIe register and the second PCIe register, and a consistent transaction factor calculation result is obtained by dividing the second accumulated data by the first accumulated data.
[0054] In step S101 and step S102, the acceleration core reads the number of stocks from the DPU memory to obtain the total number of stocks that need to be processed at present, processes one stock at a time, and loops multiple times to complete the calculation of all stocks. The acceleration core reads the stock length from the DPU memory to obtain the length information of a single stock. The acceleration core reads the stock trading information from the DPU memory to obtain the stock information to be processed according to the number of stocks and the length of the stock. The stock information to be processed is the stock trading information corresponding to the length information of a single stock, and the stock trading information reflects the market performance of the stock; the acceleration core reads the data to be processed to improve the data processing efficiency, loops multiple times until all stocks are processed, which is conducive to the efficient processing of the analysis scenarios of real-time market analysis and high-frequency analysis; the DPU memory of the present invention adopts DDR (double data rate synchronous dynamic random access memory) to achieve a higher data transmission rate, help the DPU read and write data faster, and improve the overall processing performance. Further, after obtaining the length information of a single stock, query the multiple historical transaction data contained in the length information, and obtain the stock transaction information to be processed corresponding to the multiple historical transaction data from the read stock transaction information.
[0055] In step S103 and step S104, the acceleration core in the DPU uses a column data structure when processing data, so the data format is changed on the basis of the original consistent transaction factor calculation formula to obtain a consistent transaction factor calculation formula that conforms to the DPU calculation; the transaction volume in the transaction price data stream is the original transaction volume in the stock transaction information to be processed, and the column data after the programming and operation of the consistent transaction factor calculation formula is to compare, filter and screen the column data to obtain the consistent increase transaction volume with a closing price higher than the opening price, and calculate the sum of the consistent increase transaction volume to obtain the first cumulative data. The consistent transaction factor is used to quantify market transaction indicators and to analyze continuous trading activities in the market.
[0056] In some embodiments, the method further includes: the consistent transaction factor calculation formula uses parallel computing to calculate the first accumulated data and the second accumulated data. In some embodiments, constructing a consistent transaction factor calculation formula that conforms to DPU calculation, converting the to-be-processed stock transaction information into column data that can be processed by the acceleration core in the DPU, and calculating the first accumulated data and the second accumulated data through the column data includes steps S301 to S303:
[0057] Step S301: converting the stock transaction information to be processed into closing price data, opening price data, highest price data, lowest price data and transaction price data that can be processed by the acceleration core in the DPU.
[0058] Step S302: divide the closing price data into two paths for filtering and comparison respectively, and divide the opening price data into two paths for filtering and comparison respectively; filter the column data according to the comparison results of the closing price data and the opening price data for comparison to obtain closing price filtering data whose closing price is higher than the opening price, opening price filtering data, highest price filtering data, lowest price filtering data and transaction price filtering data.
[0059] Step S303: filter half of the subtraction result of the highest price filter data and the lowest price filter data and the subtraction result of the closing price filter data and the opening price filter data to obtain change data, filter the change data and the transaction price filter data to obtain the transaction volume with a closing price higher than the opening price and add them together to obtain the first cumulative data, and the second cumulative data is obtained by adding the transaction volumes contained in the transaction price data.
[0060] Specifically, comparison is to filter out stock trading information whose closing price is higher than the opening price, and filtering is to remove stock trading information that does not meet the set conditions and output stock trading information that meets the set conditions; the acceleration core has parallel processing capabilities and can execute multiple operations at the same time. In parallel computing mode, a filtering component filters multiple input data, and a comparison component compares multiple input data. The use of parallel computing can improve computing efficiency and resource utilization, support complex algorithms and provide real-time processing capabilities.
[0061] Further, when the closing price data is compared with the opening price data, if the single closing price is higher than the corresponding single opening price, the comparison result 1 is output, otherwise the comparison result 0 is output; when the comparison result of the closing price data and the opening price data is used to filter the column data, when the input comparison result is 1, the corresponding column data is output to obtain the closing price filter data, opening price filter data, highest price filter data, lowest price filter data and transaction price filter data whose closing price is higher than the opening price; when filtering to obtain the change data, the filtering condition is met when half of the subtraction result of the highest price filter data and the lowest price filter data is greater than or equal to the subtraction result of the filter data and the opening price filter data, otherwise the filtering condition is not met.
[0062] In some embodiments, the method further includes: feeding back the consistent transaction factor to the transaction processing end for market transaction trend analysis, market transaction risk analysis and market transaction abnormality analysis, and formulating corresponding market transaction strategies based on the analysis results.
[0063] Specifically, according to the market trend, it can timely identify the upward or downward trend, providing a basis for formulating trading strategies; analyze the market situation and identify potential risks according to the market transaction risks, formulate and take corresponding risk management measures; analyze the abnormal market seats of market transactions according to the abnormal market transactions, and take protective measures to ensure the security and interests of transactions; the feedback mechanism established by feeding back the consistent transaction factors to the transaction processing segment can not only improve the transparency and efficiency of market transactions, but also formulate scientific trading strategies and enhance risk management capabilities.
[0064] Figure 2 The figure is a schematic diagram of the structure of the consistent transaction factor calculation system based on DPU according to one embodiment of the present invention. On the other hand, the present invention also provides a consistent transaction factor calculation system based on DPU, which is used to execute the consistent transaction factor calculation method based on DPU as described above, and the consistent transaction factor calculation system based on DPU includes:
[0065] CPU memory module, used to store stock transaction information, stock length and stock quantity.
[0066] The PCIe bus transmission module is used to transmit the stock transaction information, stock length and stock quantity from the CPU memory module to the DPU.
[0067] The DPU memory module is used to receive and store stock transaction information, stock length, and stock quantity through the DPU memory.
[0068] The computing module is used to obtain the length information of a single stock by reading the stock length and the number of stocks through the acceleration core, read the stock trading information according to the length information of the single stock to obtain the corresponding stock trading information to be processed, convert the stock trading information to be processed into column data that can be processed by the acceleration core in the DPU and calculate the first accumulated data and the second accumulated data, and obtain the consistent transaction factor calculation result by dividing the second accumulated data by the first accumulated data.
[0069] Specifically, the PCIe bus transmission module connects the CPU and the DPU, and transmits the stock trading information, stock length and stock quantity in the CPU memory to the DPU memory module; further, the CPU configures the parameters of the transmission process through the direct memory access controller, including the CPU memory address, the DPU memory address and the transmission size. After the parameter configuration is completed, the CPU sends a command to the direct memory access controller to start the transmission, and the PCIe bus starts to execute the transmission task to the DPU memory module. During the transmission process, the direct memory access controller monitors the transmission progress and feeds back a completion signal after the transmission is completed. The CPU executes other tasks when no transmission is required, releasing the CPU occupancy rate; the data in the DPU memory module can be accessed and processed at any time, and parallel computing can be performed immediately to improve data processing performance.
[0070] Further, the first accumulated data and the second accumulated data are calculated and stored in the first PCIe register and the second PCIe register respectively, and the consistent transaction factor is obtained by dividing the second accumulated data by the first accumulated data, and the consistent transaction factor is transmitted back to the CPU memory module through the PCIe bus. When the CPU accesses the PCIe register, the virtual address of the CPU is converted into a physical address and then mapped to the PCIe address. The CPU sends an access request to the PCIe register through the PCIe bus and reads the PCIe register by sending a specific transaction layer packet.
[0071] In some embodiments, the system further comprises:
[0072] A cloud storage system is used to store stock transaction information, stock length, stock quantity, first accumulated data, second accumulated data and consistent transaction factor calculation results. In some embodiments, the system also includes:
[0073] The analysis module is used to analyze market transaction trends, market transaction risks and market transaction anomalies based on consistent transaction factors and formulate corresponding market transaction strategies.
[0074] Specifically, the cloud storage system can safely store data and calculation results during the calculation process to prevent information loss; when the analysis module analyzes market transactions, the data in the cloud storage system is conducive to the efficient use of computing resources and the formulation of corresponding market transaction strategies.
[0075] Figure 3 This is a schematic diagram of the structure of a computing module in a computing system based on a consistent transaction factor of a DPU according to an embodiment of the present invention. In some embodiments, the computing module includes:
[0076] The data acquisition component is used to obtain the stock transaction information, stock length and stock quantity in the DPU memory (data processor memory) module; obtain the length information of a single stock based on the stock length and stock quantity, and read the stock transaction information based on the length information of a single stock to obtain the corresponding stock transaction information to be processed.
[0077] The data extraction component is used to convert the stock transaction information to be processed into closing price data, opening price data, highest price data, lowest price data and transaction price data that can be processed by the acceleration core in the DPU; the closing price data is divided into two paths for filtering and comparison, and the opening price data is divided into two paths for filtering and comparison.
[0078] The data comparison component is used to compare the closing price data and the opening price data one by one according to the order correspondence; when the closing price of the data point is greater than the opening price, 1 is output, otherwise 0 is output; the output data composed of all outputs is divided into five paths. Specifically, the data comparison component includes data comparison subcomponent 1 and data comparison subcomponent 2, and the output data is divided into five paths, namely output data 1, output data 2, output data 3, output data 4 and output data 5.
[0079] The data filtering component is used to use five filtering subcomponents to receive five output data and corresponding closing price data, opening price data, highest price data, lowest price data and transaction price data. When the output data in the five filtering subcomponents is 1, the corresponding closing price filtering data, opening price filtering data, highest price filtering data, lowest price filtering data and transaction price filtering data are output, otherwise no output is output. Specifically, the closing price data and output data 1 are input to the filtering subcomponent 1, the opening price data and output data 2 are input to the filtering subcomponent 2, the transaction price data and output data 3 are input to the filtering subcomponent 3, the highest price data and output data 4 are input to the filtering subcomponent 4, and the lowest price data and output data 5 are input to the filtering subcomponent 5.
[0080] The subtraction component is used to obtain the first result data by subtracting the opening price filter data from the closing price filter data, and obtain the second result data by subtracting the lowest price filter data from the highest price filter data. Specifically, the closing price filter data is subtracted from the opening price filter data in subtraction subcomponent 1, and the highest price filter data is subtracted from the lowest price filter data in subtraction subcomponent 2.
[0081] The accumulation component is used to compare the first result data and the second result data and filter them with the transaction price filtering data, add the transaction volumes with closing prices higher than opening prices to obtain the first accumulation data, and add the transaction volumes contained in the transaction price data to obtain the second accumulation data. After the first result data and the second result data are compared on the data comparison subcomponent 2, and filtered with the transaction price filtering data input to the filtering subcomponent 6, the accumulation component 1 calculates the sum of the transaction volumes with closing prices higher than opening prices in the column data after the programming operation of the consistent transaction factor calculation formula to obtain the first accumulation data, and the accumulation component 2 calculates the sum of the transaction volumes contained in the column data that have not been programmed to run the consistent transaction factor calculation formula to obtain the second accumulation data.
[0082] The division calculation component is used to obtain a consistent transaction factor calculation result after dividing the second accumulated data by the first accumulated data.
[0083] Specifically, the data acquisition component obtains the stock transaction information to be processed and converts it into closing price data, opening price data, highest price data, lowest price data and transaction price data that can be processed by the acceleration core in the DPU, and then transmits it through the data stream. The transmission through the concept of stream can reflect and analyze the data in real time and in stages, providing a flexible and efficient solution for processing continuous data.
[0084] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, wherein the computer program / instruction implements the steps of any of the above methods when executed by a processor.
[0085] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, characterized in that the program implements the steps of any of the above methods when executed by a processor.
[0086] The present invention is described below in conjunction with a specific embodiment:
[0087] The present invention is based on a method and system for calculating a consistent transaction factor of a DPU. The calculation function is intended to receive stock transaction information, stock length and stock quantity and calculate a consistent transaction factor. The function of calculating the consistent transaction factor is executed on the DPU. The module executing the function on the DPU is an acceleration core. The DPU (data processor) and the CPU (central processing unit) transmit data via the PCIe bus. The DPU includes a DPU memory and an acceleration core. The data transmits the stock transaction information, stock length and stock quantity from the CPU memory to the DPU memory via the PCIe bus. The acceleration core reads the stock transaction information, stock length and stock quantity from the DPU memory. After the acceleration core calculates, the first accumulated data and the second accumulated data are obtained and written to the PCIe register. The calculation result of the consistent transaction factor is obtained by dividing the second accumulated data by the first accumulated data. The CPU reads the calculation result via the PCIe bus. The stock transaction information includes a closing price sequence, an opening price sequence, a highest price sequence, a lowest price sequence and a transaction price sequence. The stock length refers to the number of stock transaction information of the currently processed stock; the stock quantity refers to the number of stocks.
[0088] The acceleration core reads the number of stocks from DDR (double data rate synchronous dynamic random access memory) to obtain the number of stocks that need to be processed at present, processes one stock at a time, and completes the calculation of all stocks in multiple cycles; the acceleration core reads the stock length from the double data rate synchronous dynamic random access memory to obtain the length information of the currently calculated stock; the acceleration core reads the stock transaction information based on the stock length information to obtain the corresponding stock transaction information to be processed.
[0089] 1. The calculation method of the first accumulated data and the second accumulated data includes steps S100 to S300:
[0090] Step S100: The acceleration core reads the stock length and the stock quantity to obtain the length information of a single stock, reads the stock transaction information according to the length information of the single stock to obtain the corresponding stock transaction information to be processed, and converts the stock transaction information to be processed into closing price data, opening price data, highest price data, lowest price data and transaction price data that can be processed by the acceleration core.
[0091] Step S200: divide the closing price data into two paths for filtering and comparison respectively, and divide the opening price data into two paths for filtering and comparison respectively; filter the column data according to the comparison results of the closing price data and the opening price data for comparison to obtain closing price filtering data whose closing price is higher than the opening price, opening price filtering data, highest price filtering data, lowest price filtering data and transaction price filtering data.
[0092] Step S300: filter half of the result of subtracting the highest price filter data from the lowest price filter data and the result of subtracting the closing price filter data from the opening price filter data to obtain change data, filter the change data and the transaction price filter data to obtain the transaction volume with a closing price higher than the opening price and add them together to obtain the first cumulative data, and the second cumulative data is obtained by adding the transaction volumes contained in the transaction price data.
[0093] 2. The calculation module includes:
[0094] (1) Data acquisition component (axi2Stream component): obtains the stock transaction information, the stock length and the number of stocks in the DPU memory module; obtains the length information of a single stock according to the stock length and the number of stocks, and reads the stock transaction information according to the length information of the single stock to obtain the corresponding stock transaction information to be processed.
[0095] (2) Data extraction component (dataSplit component): converts the stock transaction information to be processed into closing price data, opening price data, highest price data, lowest price data and transaction price data that can be processed by the acceleration core in the DPU; the data streams of the closing price data and the opening price data are divided into two interface outputs, one data stream interface is sent to the data comparison module, and the other data stream is sent to the data filtering module.
[0096] (3) Data comparison component (strmCompare component): Input two data streams, and compare each data input on the two data streams. When the closing price is greater than the opening price, a 1 is output on the output data stream, otherwise a 0 is output; the output data stream is split into 5 outputs and sent to 5 filter sub-components respectively.
[0097] (4) Data filter component: The input is two data streams, one is the original data stream and the other is the conditional data stream. The conditional data stream comes from the data comparison module. Each original data corresponds to a conditional data. When the conditional data is 1, the current original data is output, otherwise it is not output.
[0098] (5) Subtraction component (Strm_sub component): The input is two data streams, and the data in the two data streams are subtracted and output.
[0099] (6) Accumulation component (ACC component): accumulates the input data. After all inputs are accumulated, the first accumulated data and the second accumulated data are output.
[0100] (7) A division calculation component, used to obtain a consistent transaction factor calculation result by dividing the second accumulated data by the first accumulated data.
[0101] The obtained first accumulated data and second accumulated data are placed on the PCIe register, the second accumulated data is divided by the first accumulated data to obtain a consistent transaction factor calculation result, and the CPU reads the consistent transaction factor calculation result.
[0102] In summary, the present invention provides a method and system for calculating a consistent transaction factor based on a DPU. The method is executed based on a DPU. The DPU is connected to a CPU through a PCIe bus, obtains stock transaction information, stock length and stock quantity scheduled by the CPU from the CPU memory and transmits them to the DPU through the PCIe bus, reads the stock length and the stock quantity through an acceleration core to obtain the length information of a single stock, and reads the stock transaction information according to the length information of the single stock to obtain the corresponding stock transaction information to be processed; constructs a consistent transaction factor calculation formula that conforms to the DPU calculation, converts the stock transaction information to be processed into column data that can be processed by the acceleration core in the DPU and calculates first accumulated data and second accumulated data; the first accumulated data represents the sum of the transaction volumes with a closing price higher than an opening price in the column data after the programming and operation processing of the consistent transaction factor calculation formula, and the second accumulated data represents the sum of the transaction volumes contained in the transaction price data; the first accumulated data and the second accumulated data are respectively transmitted to a first PCIe register and a second PCIe register, and the consistent transaction factor calculation result is obtained by dividing the second accumulated data by the first accumulated data.
[0103] Furthermore, the PCIe bus between the CPU and the DPU of the present invention provides a high-bandwidth data transmission channel. Transmitting the first accumulated data and the second accumulated data into the first PCIe register and the second PCIe register respectively can utilize the high-bandwidth data transmission channel to reduce data transmission delay and improve data processing efficiency.
[0104] An embodiment of the present invention further provides a computer device, which may include a processor and a memory, wherein the processor and the memory may be connected via a bus or in other ways.
[0105] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0106] The memory, as a non-transitory computer-readable storage medium, 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 key shielding method of the vehicle-mounted display device in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory.
[0107] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0108] The one or more modules are stored in the memory, and when executed by the processor, the method described in this embodiment is performed.
[0109] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0110] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0111] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0112] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0113] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for calculating a consistent transaction factor based on DPU, characterized in that: The method is executed based on a DPU, the DPU is connected to a CPU via a PCIe bus, the CPU deploys a CPU memory, and the DPU deploys a DPU memory and an acceleration core, and the method includes: Acquire the stock transaction information, stock length and stock quantity scheduled by the CPU from the CPU memory; the stock transaction information includes a closing price sequence, an opening price sequence, a highest price sequence, a lowest price sequence and a transaction price sequence; receiving the stock transaction information, the stock length and the stock quantity transmitted through the PCIe bus and storing them in the DPU memory, reading the stock length and the stock quantity through the acceleration core to obtain the length information of a single stock, and reading the stock transaction information according to the length information of the single stock to obtain the corresponding stock transaction information to be processed; Constructing a consistent transaction factor calculation formula that complies with DPU calculation, converting the to-be-processed stock transaction information into column data that can be processed by the acceleration core in the DPU, and calculating first cumulative data and second cumulative data through the column data; the column data includes closing price data, opening price data, highest price data, lowest price data and transaction price data; the first cumulative data represents the sum of the transaction volumes with closing prices higher than opening prices in the column data after the programming and operation of the consistent transaction factor calculation formula, and the second cumulative data represents the sum of the transaction volumes contained in the column data that have not been programmed and operated by the consistent transaction factor calculation formula; The first accumulated data and the second accumulated data are respectively transferred into a first PCIe register and a second PCIe register, and a consistent transaction factor calculation result is obtained by dividing the second accumulated data by the first accumulated data.
2. The consistent transaction factor calculation method based on DPU according to claim 1 is characterized in that: Constructing a consistent transaction factor calculation formula that complies with DPU calculation, converting the to-be-processed stock transaction information into column data that can be processed by the acceleration core in the DPU, and calculating the first accumulated data and the second accumulated data through the column data includes: Convert the to-be-processed stock transaction information into closing price data, opening price data, highest price data, lowest price data and transaction price data that can be processed by the acceleration core in the DPU; The closing price data is divided into two paths for filtering and comparison respectively, and the opening price data is divided into two paths for filtering and comparison respectively; according to the comparison result of the closing price data and the opening price data for comparison, the column data is filtered to obtain closing price filtering data whose closing price is higher than the opening price, opening price filtering data, highest price filtering data, lowest price filtering data and transaction price filtering data; Half of the subtraction result of the highest price filter data and the lowest price filter data and the subtraction result of the closing price filter data and the opening price filter data are filtered to obtain change data, the change data and the transaction price filter data are filtered to obtain the transaction volume with a closing price higher than the opening price and add them to obtain the first cumulative data, and the second cumulative data is obtained by adding the transaction volumes contained in the transaction price data.
3. The consistent transaction factor calculation method based on DPU according to claim 1 is characterized in that: The method also includes: the consistent transaction factor calculation formula uses parallel calculation to calculate the first accumulated data and the second accumulated data.
4. The consistent transaction factor calculation method based on DPU according to claim 1 is characterized in that: The method also includes: feeding back the consistent transaction factor to the transaction processing end to perform market transaction change trend analysis, market transaction risk analysis and market transaction abnormality analysis, and formulating corresponding market transaction strategies based on the analysis results.
5. A consistent transaction factor calculation system based on DPU, characterized in that: The system is used to execute the consistent transaction factor calculation method based on DPU as described in claims 1 to 4, and the system includes: CPU memory module, used to store stock transaction information, stock length and stock quantity; A PCIe bus transmission module, used for transmitting the stock transaction information, the stock length and the stock quantity from the CPU memory module to the DPU; A DPU memory module, used for receiving and storing the stock transaction information, the stock length and the stock quantity through the DPU memory; A computing module is configured to obtain the length information of a single stock by reading the stock length and the stock quantity through an acceleration core, read the stock trading information according to the length information of the single stock to obtain the corresponding stock trading information to be processed, convert the stock trading information to be processed into column data that can be processed by the acceleration core in the DPU and calculate the first accumulated data and the second accumulated data, and obtain the calculation result of the consistent trading factor by dividing the second accumulated data by the first accumulated data.
6. The consistent transaction factor calculation system based on DPU according to claim 5, characterized in that: The system further comprises: A cloud storage system is used to store the stock transaction information, the stock length, the stock quantity, the first accumulated data, the second accumulated data and the consistent transaction factor calculation result.
7. The consistent transaction factor calculation system based on DPU according to claim 5, characterized in that: The system further comprises: The analysis module is used to analyze the market transaction change trend, market transaction risk and market transaction abnormality according to the consistent transaction factors and formulate corresponding market transaction strategies.
8. The consistent transaction factor calculation system based on DPU according to claim 5, characterized in that: The calculation module comprises: A data acquisition component is used to acquire the stock transaction information, the stock length and the stock quantity in the DPU memory module; acquire the length information of a single stock according to the stock length and the stock quantity, and read the stock transaction information according to the length information of the single stock to acquire the corresponding stock transaction information to be processed; A data extraction component is used to convert the to-be-processed stock transaction information into closing price data, opening price data, highest price data, lowest price data and transaction price data that can be processed by the acceleration core in the DPU; divide the closing price data into two paths for filtering and comparison respectively, and divide the opening price data into two paths for filtering and comparison respectively; A data comparison component is used to compare the closing price data and the opening price data one by one according to the order correspondence; when the closing price of the data point is greater than the opening price, 1 is output, otherwise 0 is output; and the output data composed of all outputs is divided into five paths; A data filtering component, used for receiving the five output data and the corresponding closing price data, opening price data, highest price data, lowest price data and transaction price data using five filtering subcomponents, and outputting the corresponding closing price filtering data, opening price filtering data, highest price filtering data, lowest price filtering data and transaction price filtering data when the output data in the five filtering subcomponents is 1, and not outputting otherwise; A subtraction component, used for subtracting the opening price filtering data from the closing price filtering data to obtain first result data, and subtracting the lowest price filtering data from the highest price filtering data to obtain second result data; an accumulation component, configured to compare the first result data with the second result data and filter the comparison data with the transaction price filtering data, add the transaction volumes of the closing prices higher than the opening prices to obtain the first accumulated data, and add the transaction volumes contained in the transaction price data to obtain the second accumulated data; A division calculation component is used to obtain a consistent transaction factor calculation result after dividing the second accumulated data by the first accumulated data.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Stock transaction risk monitoring method and device
CN117874066A
Apparatus for trading stock using w-chart technique and method thereof
KR1020150040014A
Systems and methods for predictive signaling analytics in high-speed data links
US20240028448A1
Data stream processing method, storage control node, and nonvolatile readable storage medium
WO2023155526A1
Data processing method and apparatus
WO2024012153A1