Method, device and equipment for calculating intermediate price based on transaction quotation data and medium

By using message queues and binary encoding, combined with floating-point amplification and distributed lock mechanisms, the problem of low efficiency in intermediate price calculation in existing technologies has been solved, and efficient intermediate price calculation has been achieved.

CN120952892APending Publication Date: 2025-11-14AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511050913.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

In existing technologies, text-based unstructured serialization methods suffer from low encoding and decoding efficiency, and accessing databases via network interfaces leads to low efficiency in intermediate cost calculations.

Method used

Data access is achieved using message queues, and data processing efficiency is improved through binary encoding. Starting from the essence of information encoding, binary encoding is combined with floating-point amplification mechanism and distributed lock mechanism for efficient calculation.

Benefits of technology

It significantly improves the calculation efficiency of median price, simplifies the data processing flow, has a wider range of applications, and achieves efficient median price calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120952892A_ABST
    Figure CN120952892A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device and equipment for calculating a middle price based on transaction quotation data, and a medium. The method comprises the following steps: carrying out binary coding on transaction market information data to obtain market information coded data, and storing the market information coded data into a message queue; in response to the intermediate price calculation request, determining a target calculation node for responding to the intermediate price calculation request from the candidate calculation nodes; and reading the market information coded data from the message queue through the target computing node, and computing a corresponding transaction intermediate price according to the market information coded data through the target computing node. According to the embodiment of the invention, the calculation efficiency of the intermediate price can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial data processing technology, and in particular to a method, apparatus, device and medium for calculating the median price based on transaction market data. Background Technology

[0002] Market data refers to the trading activity of a particular commodity or financial asset (such as stocks, foreign exchange, futures, and bonds) within a specific timeframe in the financial market. This includes price, trading volume, bid and ask prices (such as highest price, lowest price, opening price, and closing price), and other relevant market data. Efficient processing of market data enables rapid calculation of mid-price, assessment of market risk, and optimization of investment portfolios, thereby enhancing business competitiveness and market responsiveness. The mid-price is the median price quoted by both buyers and sellers in the trading of a financial asset or instrument, or the average price at which market participants trade a particular financial asset or instrument. The mid-price reflects the market's supply and demand for financial assets or instruments and their valuation, making it an indispensable and crucial indicator in the financial market.

[0003] In the process of developing this application, the applicant discovered at least the following problems in the prior art:

[0004] In existing technologies, text-based unstructured serialization techniques are commonly used for encoding and decoding. Relational databases or big data storage systems are employed as the primary storage management mechanism. Computing nodes access the database via network interfaces to obtain the required market data for processing, based on actual needs. However, text-based unstructured text serialization methods suffer from low encoding and decoding efficiency, typically resulting in lengthy encoding results and slow decoding speeds. The efficiency of accessing the database via network interfaces is limited by factors such as network connection quality, network bandwidth, and database load, leading to significant data acquisition delays and consequently, low efficiency in calculating intermediate prices. Summary of the Invention

[0005] This application provides a method, apparatus, device, and medium for calculating the median price based on transaction market data. It can achieve efficient data access through message queues and improve data processing efficiency by using binary encoding based on the essence of information encoding, thereby improving the efficiency of median price calculation.

[0006] In a first aspect, embodiments of this application provide a method for calculating the median price based on market data, the method comprising:

[0007] The market data is binary encoded to obtain market data encoding, and the market data encoding is stored in a message queue;

[0008] In response to the intermediate price calculation request, a target computing node for responding to the intermediate price calculation request is determined from the candidate computing nodes;

[0009] The target computing node reads the market data encoding data from the message queue and calculates the corresponding transaction midpoint price based on the market data encoding data.

[0010] Secondly, embodiments of this application provide an apparatus for calculating the median price based on transaction market data, the apparatus comprising:

[0011] The encoding module is used to perform binary encoding on the market data to obtain market data encoding data, and to store the market data encoding data in the message queue;

[0012] The determination module is used to determine, in response to the intermediate price calculation request, a target computing node from the candidate computing nodes for responding to the intermediate price calculation request;

[0013] The calculation module is used to read the market data encoding data from the message queue through the target computing node, and to calculate the corresponding transaction midpoint price based on the market data encoding data through the target computing node.

[0014] Thirdly, embodiments of this application provide an electronic device, including:

[0015] One or more processors;

[0016] Memory, used to store one or more programs.

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for calculating the median price based on transaction market data as described in any embodiment of this application.

[0018] Fourthly, embodiments of this application provide a storage medium storing a computer program thereon, which, when executed by a processor, implements the method for calculating the median price based on transaction market data as described in any embodiment of this application.

[0019] This application proposes a method, apparatus, device, and medium for calculating the median price based on market data. The method involves binary encoding the market data to obtain market data encoding, and storing this market data encoding in a message queue. In response to a median price calculation request, a target computing node is determined from candidate computing nodes. The target computing node reads the market data encoding from the message queue and calculates the corresponding market median price based on the market data encoding. In other words, the technical solution of this application utilizes a message queue for asynchronous communication and employs binary encoding for efficient data encoding. In contrast, existing technologies use text-based unstructured text serialization methods, which are inefficient, and accessing databases via network interfaces also impacts data access efficiency. Therefore, compared to existing technologies, the method, apparatus, device, and medium proposed in this application for calculating the median price based on market data enables efficient data access through a message queue and improves data processing efficiency by using binary encoding, which addresses the essence of information encoding. This, in turn, enhances the efficiency of median price calculation. Furthermore, the technical solution of this application is simple and convenient to implement, easy to popularize, and has a wider range of applications. Attached Figure Description

[0020] Figure 1 A flowchart illustrating a method for calculating the median price based on market data, provided as an embodiment of this application;

[0021] Figure 2 A flowchart illustrating a method for calculating the median price based on market data, provided as another embodiment of this application;

[0022] Figure 3 A flowchart illustrating a method for calculating the median price based on market data, provided in yet another embodiment of this application;

[0023] Figure 4 A schematic diagram of the structure of the apparatus for calculating the median price based on transaction market data provided in the embodiments of this application;

[0024] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present application, not the entire structure.

[0026] Figure 1This is a flowchart illustrating a method for calculating the median price based on market data, provided in an embodiment of this application. This method can be executed by a device or electronic device for calculating the median price based on market data. The device or electronic device can be implemented by software and / or hardware, and can be integrated into any smart device with network communication capabilities.

[0027] The accuracy and efficiency of the median price calculation are core indicators for evaluating the performance of a pricing system. Accuracy relies heavily on scientific quantitative models and rigorous mathematical algorithms for verification, ensuring price reasonableness. Efficiency, on the other hand, is improved through system architecture optimization and algorithm engineering, enabling the median price to respond promptly to market changes and quickly adjust pricing benchmarks. This enhances the ability to capture market opportunities while effectively mitigating market risks and potential losses caused by price lags. The median price calculation process is driven by market data, and the calculation task is then randomly assigned to an available computing node. Specifically, the computing node first extracts all relevant data from historical market data, then inputs this data into a predefined quantitative model or business rules for calculation, ultimately yielding the median price result. To avoid missing potential profit opportunities or suffering possible financial losses, the entire calculation process must be completed and published within a very short time. Therefore, extremely high timeliness is required.

[0028] like Figure 1 As shown, the method for calculating the midpoint price based on market data may include the following steps:

[0029] S101. Perform binary encoding on the market data to obtain market code data, and store the market code data in the message queue.

[0030] In this step, market data can include the price, volume, and bid / ask prices of the traded product (such as the highest price, lowest price, opening price, and closing price), as well as other relevant market data. Specifically, the market data processing module encodes the market data into binary data, which is then cleaned and preprocessed to ensure accuracy and usability. The market data encoding data is then stored in a message queue for use by relevant modules for storage and computation, triggering subsequent calculation processes. A message queue is a middleware used in distributed systems for asynchronous communication and decoupling of system components. It allows different software components to communicate via messages without directly connecting to or knowing about each other's existence.

[0031] This step uses a binary structured serialization method to encode market data, which has the advantages of clear data format and faster encoding and decoding speed, significantly improving the system's preprocessing efficiency for market data, while effectively reducing the overall end-to-end processing latency.

[0032] S102. In response to the intermediate price calculation request, determine the target computing node from the candidate computing nodes to respond to the intermediate price calculation request.

[0033] In this step, the intermediate price calculation module responds to intermediate price calculation requests by selecting a target calculation node from candidate nodes. Specifically, the intermediate price calculation module can adopt a market event-driven architecture. When a new market data (i.e., an intermediate price calculation request) is detected, a polling mechanism selects the corresponding calculation node to perform the intermediate price calculation. The intermediate price calculation module has multiple candidate calculation nodes. Each candidate calculation node focuses on the efficient calculation of a specific intermediate price by calling a predefined quantification model or business rules, ensuring the balance and reliability of task processing. Furthermore, it maintains good performance even when adding nodes, making it suitable for high-concurrency scenarios and ensuring efficient and reliable task processing.

[0034] The system incorporates optimized market data loading strategies, employing local caching instead of remote database reads to significantly improve system response efficiency. By storing complete market data on the corresponding computing nodes, latency issues caused by remote access delays, network jitter, and excessive database load are avoided. Furthermore, based on existing market data traffic assessment, computational model algorithms, and cloud platform resource limitations, dependency on remote databases is avoided, substantially reducing computation latency. Additionally, to ensure system stability, a time-based cache management mechanism is employed to periodically clean up historical market data stored in the cache, effectively mitigating cache overflow risks and ensuring the stable operation of computing nodes.

[0035] Preferably, it also includes: detecting whether there is preset type data in the market data; if there is preset type data in the market data, then converting the preset type data to optimize the market data.

[0036] In this step, the preset data type is high-precision floating-point data. Considering that the floating-point numbers involved in the system (such as the midpoint rate) all represent interest rates and usually have 4 to 5 decimal places, a numerical amplification mechanism can be used for data conversion, such as multiplying the floating-point value by 10^5 (i.e., expanding it by 100,000 times) and then storing it in integer form.

[0037] The method for calculating the median rate based on transaction market data proposed in this application, combined with the actual meaning of floating-point numbers in business scenarios, avoids the precision errors of floating-point calculations and the problem of insufficient hardware support for high-precision floating-point calculation libraries by multiplying the floating-point number by 10^5 and converting it into an integer for storage. It fully utilizes the performance advantages of computer hardware in integer arithmetic, and also significantly improves computational efficiency and code maintainability; it effectively avoids the precision loss problem that may be caused by ordinary floating-point arithmetic, while also avoiding the performance overhead of using high-precision floating-point numbers. When displaying on the front end, simply dividing the integer result in reverse by 10^5 restores the actual interest rate value, ensuring the correct presentation of the user interface.

[0038] S103. Read market data from the message queue through the target computing node, and calculate the corresponding transaction midpoint price based on the market data through the target computing node.

[0039] In this step, multiple candidate computing nodes can collaborate through a scalable architecture. When it is determined which computing node will be used to calculate the transaction median price, the median price calculation module employs a "distributed lock mechanism" to coordinate task execution. This mechanism uses competition to determine a single node to execute the task, while other nodes wait, avoiding redundant calculations. This not only efficiently utilizes resources but also ensures the accuracy of the calculation results and the stability of the system.

[0040] The method for calculating the median price based on market data proposed in this application involves binary encoding the market data to obtain market data encoding, and storing the market data encoding in a message queue. In response to a median price calculation request, a target computing node is determined from candidate computing nodes to respond to the request. The target computing node reads the market data encoding from the message queue and calculates the corresponding market median price based on the market data encoding. In other words, the technical solution of this application achieves asynchronous communication through a message queue and uses binary encoding for efficient data encoding. In contrast, existing technologies use text-based unstructured text serialization methods, which are inefficient, and accessing the database via a network interface affects data access efficiency. Therefore, compared to existing technologies, the method, apparatus, device, and medium for calculating the median price based on market data proposed in this application can achieve efficient data access through a message queue, improve data processing efficiency by using binary encoding from the essence of information encoding, and thus improve the efficiency of median price calculation. Furthermore, the technical solution of this application is simple and convenient to implement, easy to popularize, and has a wider range of applications.

[0041] Preferably, the target computing node calculates the corresponding transaction median price based on the market data encoding data, including: calculating a candidate median price based on the market data encoding data using the target computing node; comparing the candidate median price with a preset median price range using the target computing node; if the candidate median price is within the preset median price range, then the candidate median price is determined as the transaction median price corresponding to the market data. If the candidate median price is not within the preset median price range, then the target computing node corrects the candidate median price to obtain a corrected median price, and then determines the corrected median price as the transaction median price corresponding to the market data.

[0042] In this step, additional data related to the transaction can be collected, such as the recent fluctuations in the median price of similar transactions and the overall market price trend. This supplementary data can then be used to adjust the candidate median price using specific mathematical models or correction algorithms. For example, if the overall market price is trending upwards and the average increase in the median price of similar recent transactions is a certain percentage, the candidate median price can be appropriately increased according to that percentage.

[0043] The method for calculating the median price based on transaction market data proposed in this application, when determining the target calculation node for calculating the median price, compares the calculation result of the calculation node with the preset median price range, and corrects candidate median prices that do not match the comparison results, so as to ensure the accuracy of the median price calculation.

[0044] Figure 2 This is a flowchart illustrating a method for calculating the median price based on market data, provided as another embodiment of this application. Further optimizations and extensions to the above technical solution are possible, and it can be combined with the various optional implementation methods described above. For example... Figure 2 As shown, the method for calculating the midpoint price based on market data may include the following steps:

[0045] S201, Real-time monitoring of system load values.

[0046] S202. When the system load value exceeds the preset load threshold, evaluate the performance index of each candidate computing node, and determine the type and number of expanded nodes based on the performance index of the candidate computing nodes.

[0047] In this step, a comprehensive evaluation of the performance metrics of each candidate computing node, including computing power, storage capacity, and network bandwidth, is conducted. Computing power is measured by testing the number of computational tasks it can process per second; storage capacity is assessed by examining the available disk space; and network bandwidth is accurately measured using network speed testing tools. Based on these performance metrics, candidate computing nodes are categorized into different types, such as compute-intensive, storage-intensive, and network-intensive. Computation-intensive nodes excel in complex computational tasks; storage-intensive nodes are suitable for storing and retrieving large amounts of data; and network-intensive nodes offer advantages in data transmission. Considering the current system requirements, the type of node to be expanded is determined. If the current system has heavy computational loads, compute-intensive nodes are selected; if data storage pressure is high, storage-intensive nodes are selected; and if data transmission is frequent and large-volume, network-intensive nodes are selected.

[0048] After determining the type of nodes to be expanded, the number of nodes that need to be expanded is precisely calculated based on the degree to which the system load exceeds a preset threshold. For example, a mathematical model can be established, combining historical data and the current growth trend of the system load, to estimate the number of nodes that need to be expanded, ensuring stable system operation while avoiding excessive waste of resources.

[0049] S203. Determine the new computing nodes from the available resource pool based on the type and number of expanded nodes, and initialize the configuration of the new computing nodes.

[0050] This step involves initializing the newly added computing nodes, including: setting basic node parameters, configuring the node's operating system, installing and configuring applications and services matching the node type, setting node permissions and access control, and performing node performance tuning. Setting basic node parameters, such as the node name, IP address, and port number, ensures the node can be correctly identified and accessed within the system network. Configuring the node's operating system involves updating system software to the latest version and installing necessary drivers and security patches to improve system stability and security. Installing and configuring applications and services matching the node type is crucial; for example, for compute-intensive nodes, installing efficient computing frameworks and algorithm libraries; for storage-intensive nodes, configuring storage management software and data backup strategies; and for network-intensive nodes, optimizing network communication protocols and data transmission tools. Setting node permissions and access control assigns appropriate operating permissions to different users and roles according to the system's security policies to prevent unauthorized access and data leakage. Performing node performance tuning adjusts the allocation of node hardware resources, such as CPU, memory, and disk I / O, based on the system's actual needs and load conditions to improve node operating efficiency.

[0051] S204. Conduct network connectivity and communication tests on the newly added computing nodes to enable them to work collaboratively with the candidate computing nodes.

[0052] In this step, network diagnostic tools such as the ping and traceroute commands can be used to test network connectivity, check whether the network link between the new compute node and the candidate compute node is unobstructed, confirm whether data packets can be transmitted normally, and identify potential network faults. Furthermore, communication protocol compatibility testing is conducted to verify whether the communication protocols used by the new compute node and the candidate compute node are consistent and compatible, ensuring accurate data exchange at different protocol layers, such as the transport layer and application layer. Next, data transmission stability testing is performed, simulating data transmission tasks of different scales and frequencies, observing data loss rates and latency during transmission to ensure stable and reliable communication even with large-scale data transmission. Finally, collaborative function testing is conducted, designing specific collaborative work scenarios, such as distributed computing tasks and data sharing tasks, to verify whether the new compute node and the candidate compute node can collaboratively complete tasks as expected, and to evaluate the efficiency and accuracy of collaborative work.

[0053] The method for calculating the median price based on market data proposed in this application can continuously collect and analyze system load indicators through a dynamic scaling module that monitors components in real time. When the current load value exceeds a preset dynamic scaling threshold (i.e., a preset load threshold), an automatic scaling mechanism is triggered to proportionally add new computing nodes to maintain system computing efficiency and performance. The dynamic scaling module can automatically and dynamically allocate cloud resources by monitoring the load status and traffic changes of services on the container cloud in real time, combined with intelligent algorithms. It automatically adjusts the number of computing nodes according to the actual load, ensuring rapid response to business needs in high-concurrency scenarios and timely release of idle resources during off-peak periods. This not only significantly improves the resource utilization of the cloud platform but also greatly reduces hardware investment and maintenance costs, providing the system with greater flexibility and scalability.

[0054] Figure 3 This is a flowchart illustrating a method for calculating the median price based on market data, provided as another embodiment of this application. Further optimizations and extensions to the above technical solution are possible, and it can be combined with the various optional implementation methods described above. For example... Figure 3 As shown, the method for calculating the midpoint price based on market data may include the following steps:

[0055] S301. When the system load value is lower than the preset load threshold, perform a status assessment on each candidate computing node; and determine the computing node to be released from multiple candidate computing nodes based on the status assessment results of the candidate computing nodes.

[0056] In this step, the resource utilization of candidate computing nodes can be evaluated, including metrics such as CPU utilization, memory usage, and disk I / O. Candidate computing nodes with lower resource utilization indicate that they have fewer tasks currently being processed and more idle resources, making them more likely to be identified as computing nodes to be released. Furthermore, the task processing efficiency of candidate computing nodes is considered, evaluating their response time and processing speed during task execution. Nodes with low processing efficiency and / or instability can be prioritized for release, ensuring that high-quality nodes are always running to support stable system operation. Finally, by combining the above evaluation results, the node that best meets the release criteria is selected from multiple candidate computing nodes as the released computing node.

[0057] S302. Send a node release instruction to the release computing node to instruct the release computing node to perform a node shutdown operation after completing the current computing task.

[0058] In this step, after receiving the node release instruction, the release compute node can stop accepting new compute tasks and automatically shut down the release compute node after processing the current compute tasks within the node.

[0059] The method for calculating the median price based on transaction market data proposed in this application triggers an automatic reduction mechanism when the system load value falls below a preset dynamic reduction threshold, releasing a portion of the computing nodes proportionally, thereby optimizing resource utilization and reducing resource waste.

[0060] To avoid frequent scaling operations caused by short-term traffic fluctuations, this embodiment introduces a dynamic tolerance parameter (i.e., fault tolerance threshold) for control. By setting differentiated tolerance parameters, different sensitivities are achieved for scaling up and scaling down: scaling up operations use a lower tolerance to quickly respond to load growth, while scaling down operations use a higher tolerance to ensure system stability and prevent unnecessary resource release due to misjudgment. This effectively balances the response speed of system load changes and resource adjustments, ensuring business continuity and stability while achieving elastic allocation and efficient utilization of computing resources.

[0061] Preferably, it also includes: generating visualization data based on the midpoint price calculation result of the trading market data, the visualization data being used to display the changing trend of the midpoint price; adding additional display elements to the visualization data, and generating a corresponding visualization interface based on the trading type of the trading market data.

[0062] In this step, unique layouts and color schemes are designed for the visualization interface based on the characteristics and needs of different trading types to enhance users' recognition and understanding of trading information. For example, high-risk trading types are highlighted with striking colors, while regular trading types use softer colors. Simultaneously, interactive functions are provided for additional display elements, allowing users to access more detailed information, such as historical trading data and related analysis reports, through clicks and swipes. Furthermore, the visualization interface is dynamically updated based on real-time changes in market data to ensure users can stay up-to-date with the latest trading information.

[0063] Figure 4 This is a schematic diagram of the apparatus for calculating the median price based on market data, provided in an embodiment of this application. Figure 4 As shown, the device for calculating the median price based on market data includes: an encoding module 401, a determination module 402, and a calculation module 403. Among them,

[0064] The encoding module 401 is used to perform binary encoding on the market data to obtain market data encoding data, and to store the market data encoding data in the message queue;

[0065] The determination module 402 is used to determine the target computing node from the candidate computing nodes in response to the intermediate price calculation request;

[0066] The calculation module 403 is used to read market data from the message queue through the target calculation node, and to calculate the corresponding transaction midpoint price based on the market data through the target calculation node.

[0067] The apparatus described above for calculating the median price based on market data can execute the method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method for calculating the median price based on market data provided in any embodiment of this application.

[0068] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present application is shown. Figure 5 The electronic device 12 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0069] like Figure 5 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).

[0070] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0071] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0072] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.

[0073] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this application.

[0074] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although... Figure 5 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0075] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the method for calculating the median price based on transaction market data provided in the embodiments of this application.

[0076] This application also provides a computer storage medium.

[0077] The computer-readable storage medium of this application embodiment can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be—but is not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0078] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0079] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0080] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages—such as Java, Smalltalk, and C++—as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0081] This application also provides a computer program product.

[0082] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer program products, which may include one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be an application-specific or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0083] Note that the above description is merely a preferred embodiment and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments. Many other equivalent embodiments may be included without departing from the concept of this application, and the scope of this application is determined by the scope of the appended claims.

Claims

1. A method for calculating the median price based on market data, characterized in that, The method includes: The market data is binary encoded to obtain market data encoding, and the market data encoding is stored in a message queue; In response to the intermediate price calculation request, a target computing node for responding to the intermediate price calculation request is determined from the candidate computing nodes; The target computing node reads the market data encoding data from the message queue and calculates the corresponding transaction midpoint price based on the market data encoding data.

2. The method according to claim 1, characterized in that, The step of calculating the corresponding transaction midpoint price based on the market data using the target computing node includes: The target computing node calculates the corresponding candidate median price based on the market data encoding; and compares the candidate median price with a preset median price range using the target computing node. If the candidate median price is within the preset median price range, then the candidate median price is determined to be the transaction median price corresponding to the transaction market data.

3. The method according to claim 2, characterized in that, The method further includes: If the candidate median price is not within the preset median price range, the candidate median price is corrected by the target computing node to obtain a corrected median price, and the corrected median price is determined to be the transaction median price corresponding to the transaction market data.

4. The method according to claim 1, characterized in that, The method further includes: Detect whether there is preset type data in the market data encoding; If the market data encoding contains preset type data, then the preset type data is converted to optimize the market data encoding.

5. The method according to claim 1, characterized in that, The method further includes: The system load value is monitored in real time. When the system load value exceeds the preset load threshold, the performance index of each candidate computing node is evaluated, and the type and number of expansion nodes are determined based on the performance index of the candidate computing nodes. Based on the type and number of augmented nodes, new computing nodes are determined from the available resource pool, and the new computing nodes are initialized and configured. The newly added computing node is subjected to network connectivity and communication tests to enable it to work collaboratively with the candidate computing node.

6. The method according to claim 5, characterized in that, The method further includes: When the system load value is lower than the preset load threshold, a status evaluation is performed on each candidate computing node; and based on the status evaluation results of the candidate computing nodes, a computing node is determined from multiple candidate computing nodes to be released. Send a node release instruction to the released computing node to instruct the released computing node to perform a node shutdown operation after processing the current computing task.

7. The method according to claim 1, characterized in that, The method further includes: Visual data is generated based on the midpoint price calculation result of the aforementioned market data, and the visual data is used to display the changing trend of the midpoint price. Additional display elements are added to the visualized data, and a corresponding visualization interface is generated based on the transaction type of the market data.

8. An apparatus for calculating the median price based on market data, characterized in that, The device includes: The encoding module is used to perform binary encoding on the market data to obtain market data encoding data, and to store the market data encoding data in the message queue; The determination module is used to determine, in response to the intermediate price calculation request, a target computing node from the candidate computing nodes for responding to the intermediate price calculation request; The calculation module is used to read the market data encoding data from the message queue through the target computing node, and to calculate the corresponding transaction midpoint price based on the market data encoding data through the target computing node.

9. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method for calculating the midpoint price based on transaction market data as described in any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the method for calculating the midpoint price based on transaction market data as described in any one of claims 1 to 7.