Order processing method, device, computer equipment and storage medium of trading system
By using target identification and consistency caching mechanisms in the trading system, the order processing recovery problem in the event of hardware failure is solved, fast recovery and efficient system operation are achieved, and user experience is improved.
Patent Information
- Application Number
- CN202411225660.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-09-03
AI Technical Summary
The existing trading system cannot recover order processing without restart in the event of hardware failure, resulting in poor customer experience and long system recovery time.
The target identification mechanism is introduced in the trading system, the target source data is tracked through consistency cache, and the relevant data is automatically discarded when the hardware handles node failures, and the order data is reacquired to ensure data consistency and rapid system recovery.
It realizes rapid order processing recovery in the event of hardware failure, shortens the system recovery time and improves user experience.
Smart Images

Figure CN118733349B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an order processing method, device, computer equipment and storage medium of a trading system. Background Art
[0002] The use of hardware acceleration by trading desks (trading systems) is an important means to improve transaction processing speed and efficiency. Hardware acceleration can reduce the burden on the CPU and improve the overall performance of the system by using dedicated hardware to share or replace some computing tasks.
[0003] For trading counters involving hardware, the software and hardware may fail independently. In the prior art, when the hardware fails, it is impossible to restore the order processing without restarting. Therefore, even if the software works normally at this time, if the hardware fails, the order transaction will be suspended for a long time waiting for the software to recover, and the customer experience is poor. Summary of the invention
[0004] The embodiments of the present application provide an order processing method, apparatus, computer equipment, and storage medium for a trading system, which can restore order processing without restarting, thereby improving user experience.
[0005] In a first aspect, an embodiment of the present application provides an order processing method of a trading system, the method being applied to the trading system, the method comprising:
[0006] Get the target source data of the target order;
[0007] When the transaction system is in hardware mode, generating a target identifier for the target source data, adding the target identifier to the target source data, and storing the target source data carrying the target identifier in a consistent cache;
[0008] Transmitting the target source data carrying the target identifier into a first processing node, where the first processing node is a hardware processing node;
[0009] Determine whether the aggregation node receives the processing result carrying the target identifier output by the first processing node within a first preset time period, the aggregation node being used to aggregate the processing results of each processing node in the transaction system;
[0010] If the processing result is received within the first preset time period, taking out the target source data having the same identifier as the processing result from the consistency cache, and transmitting the target source data carrying the target identifier to the second processing node;
[0011] If the processing result is not received within the first preset time period, the target source data carrying the target identifier in the consistency cache is discarded, and the target source data of the target order is reacquired.
[0012] In a second aspect, an embodiment of the present application further provides an order processing device of a trading system, wherein the order processing device of the trading system is deployed in the trading system, and the order processing device of the trading system includes a transceiver unit and a processing unit, wherein:
[0013] A transceiver unit, used to obtain target source data of a target order;
[0014] A processing unit, used for generating a target identifier of the target source data when the trading system is in hardware mode, adding the target identifier to the target source data, and storing the target source data carrying the target identifier in a consistent cache; transmitting the target source data carrying the target identifier to a first processing node, which is a hardware processing node; judging whether a processing result carrying the target identifier output by the first processing node is received by an aggregation node within a first preset time period, the aggregation node being used to aggregate the processing results of each processing node in the trading system; if the processing result is received within the first preset time period, taking out the target source data having the same identifier as the processing result from the consistent cache, and transmitting the target source data carrying the target identifier to a second processing node; if the processing result is not received within the first preset time period, discarding the target source data carrying the target identifier in the consistent cache, and reacquiring the target source data of the target order through the transceiver unit.
[0015] In a third aspect, an embodiment of the present application further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.
[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and wherein the program instructions can implement the above method when executed by a processor.
[0017] The embodiments of the present application provide an order processing method, device, computer equipment and storage medium for a trading system. Among them, on the one hand, when the trading system is in hardware mode, after obtaining the target source data of the target order, a target identifier of the target source data will be generated, and the target identifier will be added to the target source data, thereby realizing the tracking of the target source data; on the other hand, this embodiment will store the target source data carrying the target identifier that needs to be consistent in a consistency cache, and when the target source data is transmitted to the first processing node, and after the processing result carrying the target identifier is received in the aggregation node within a first preset time, the target source data with the same identifier as the processing result is taken out from the consistency cache, and the target source data carrying the target identifier is transmitted to the second processing node, thereby ensuring the target The source data is consistent before and after the first processing node (inconsistent node); on the other hand, when the aggregation node does not receive the processing result carrying the target identifier within the first preset time period (which means that the first processing node fails), the target source data carrying the target identifier in the consistent cache is discarded, and the target source data of the target order is re-acquired. It can be seen that this embodiment automatically discards related data when the first processing node fails, avoiding state asynchrony caused by partial data processing, and can automatically re-acquire the target source data of the target order without restarting the system, so that when only the hardware fails, the system can resume processing the target order in a shorter time, shortening the system recovery time, thereby improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A flowchart of an order processing method of a trading system provided in an embodiment of the present application;
[0020] Figure 2 A schematic block diagram of an order processing device of a trading system provided in an embodiment of the present application;
[0021] Figure 3 A schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0024] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0025] It should be further understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] Embodiments of the present application provide an order processing method, apparatus, computer equipment, and storage medium for a trading system.
[0027] The executor of the order processing method of the trading system may be the order processing device of the trading system provided in the embodiment of the present application, or a computer device integrated with the order processing device of the trading system, wherein the order processing device of the trading system may be implemented in hardware or software, and the computer device is a computer device of a trading counter (trading system).
[0028] Figure 1 is a flow chart of an order processing method of a trading system provided in an embodiment of the present application. Among them, the order processing method of a trading system provided in the present application is applied in a trading system, which is a software and hardware trading system, such as Figure 1 As shown, the method includes the following steps S110-S160.
[0029] S110. Obtain target source data of the target order.
[0030] Specifically, after receiving the target order, the trading system acquires the target source data of the target order through a preset channel.
[0031] The target source data may be exchange returns and securities data. Specifically, after obtaining the target order, the exchange returns and securities data are pulled from the exchange.
[0032] S120: When the transaction system is in hardware mode, generate a target identifier for the target source data, add the target identifier to the target source data, and store the target source data carrying the target identifier in a consistent cache.
[0033] In this embodiment, when the trading system is in hardware mode, it means that the trading system uses a combination of software and hardware to process orders. Since the hardware has an acceleration function, using a system with hardware participation to process orders can speed up the order processing efficiency.
[0034] Among them, the first processing node and the second processing node in the embodiment of the present application are inconsistent nodes. The first processing node is a hardware processing node, specifically a field programmable gate array (Field-Programmable Gate Array, FPGA), and the second processing node is a software processing node. The hardware processing node and the software processing node work independently. Although there is a design to synchronize as quickly as possible, there is still a lag that cannot be eliminated, so the states of the two are inconsistent.
[0035] Specifically, the transaction system in the present application obtains a target identifier for the target source data that needs to be consistent in a centralized link, wherein the target identifier is obtained in a specific central node. Before the data enters the inconsistent link (the processing link of the first processing node and the second processing node), the target identifier is first obtained at the central node to ensure that the data that needs to be consistent in each order has a unified number.
[0036] In some embodiments, the target identifier is a unique identifier (UUID).
[0037] Specifically, in some embodiments, the target source data includes first source data and second source data; adding the target identifier to the target source data, and storing the target source data carrying the target identifier in the coherent cache includes:
[0038] The target identifier is added to the first source data and the second source data respectively, and the first source data carrying the target identifier and the second source data carrying the target identifier are stored in the consistency cache.
[0039] For example, the target order is order 001, and the target source data of order 001 includes exchange returns and securities data. At this time, the generated target identifier is AB12000001. After adding the target identifier to each data, the consistent data (target source data carrying the target identifier) obtained are "exchange returns + AB12000001" and "securities data + AB12000001" respectively.
[0040] It should be noted that the present application has multiple target source data that need to remain consistent for the target order, and the multiple includes two or more. For each target source data that needs to remain consistent, a unified target identifier needs to be added to achieve data tracking. The present application only uses two examples for illustration, and the specific number is not limited in this application.
[0041] Among them, because when the transaction system in this application processes different orders, the generation of source data corresponding to different orders is random and uncontrollable, but because of the target identification, the source data for different orders are identifiable, so the subsequent second processing node does not need to process the corresponding source data immediately, but waits for sufficient information (the first processing node outputs the result with the corresponding identification) before performing correct processing.
[0042] S130: Transmit the target source data carrying the target identifier into a first processing node, where the first processing node is a hardware processing node.
[0043] In this embodiment, after adding a target identifier to the target source data, the target source data that needs to be processed by the first processing node is input into the first processing node. When the first processing node processes the first source data, the first source data carrying the target identifier is transmitted to the first processing node.
[0044] S140, determining whether the aggregation node receives the processing result carrying the target identifier output by the first processing node within a first preset time period, if so, executing step S150, if not, executing step S160.
[0045] The aggregation node is used to aggregate the processing results of each processing node in the transaction system.
[0046] In this embodiment, the target identifier is transmitted during the processing of the inconsistency node, and when the processing of the inconsistency node is completed, the data is aggregated in the aggregation node.
[0047] Among them, in this embodiment, if the aggregation node has not received the processing result carrying the target identifier output by the first processing node within a first preset time period (for example, 30s, the specific time period is not limited in this embodiment), then, it means that the first processing node has a fault, that is, the hardware processing node of the system has a fault.
[0048] S150, taking out the target source data having the same identifier as the processing result from the consistency cache, and transferring the target source data carrying the target identifier to the second processing node.
[0049] In this embodiment, if the processing result is received within the first preset time period, the corresponding target identifier is derived, and the target source data having the same identifier as the processing result is retrieved from the consistency cache.
[0050] Specifically, when the second processing node processes the second source data, the second source data carrying the target identifier is transmitted to the second processing node, so that the second processing node processes the second source data.
[0051] Among them, in an embodiment of the present application, the target source data processed by the second processing node is stored in the consistency cache and waits after the target identifier is added. The corresponding target source data is exported to the second processing node for processing only after the same target identifier is received. In this way, in the first processing node, if an abnormality occurs in the data processing, the corresponding target identifier will not be transmitted back, and the source data required to be processed by the second processing node will not be retrieved and processed, thereby ensuring that the corresponding data is consistent before and after the inconsistent nodes.
[0052] It can be seen that in this embodiment, the data in the inconsistent node is cached and re-indexed according to the corresponding identifier after the inconsistent node is processed, ensuring that the system status (order details, capital stock data, etc.) is consistent before and after passing through the inconsistent node.
[0053] S160: discard the target source data carrying the target identifier in the consistency cache, and reacquire the target source data of the target order.
[0054] In this embodiment, if the processing result is not received within the first preset time period, it means that the first processing node fails when processing the corresponding data. At this time, the information is missing. The target identifier is used to identify which data in the consistency cache is processed and which data is not processed. In this embodiment, the target source data carrying the target identifier in the consistency cache is determined as unfinished data. At this time, all unfinished data is discarded. Since the data of the exchange is dynamic, the corresponding target source data needs to be pulled from the exchange again.
[0055] When the hardware (first processing node) fails, the data inside the hardware cannot be synchronized to the software (second processing node) in time. In this case, if part of the data of an order reaches the software (for example, the order data arrives, but the corresponding securities data does not arrive), the data in the software will lose consistency (there is an order, but the securities data is wrong). In this case, according to the current technical design, the data cannot be restored. The system can only be restarted and all transactions of the day can be restored one by one until all states are rebuilt before subsequent transactions can continue. However, this requires a series of processes including problem discovery, manual decision-making, system restart, state replay, etc., which takes a long time.
[0056] After using the order processing method of the trading system provided by the present application, since corresponding target identifiers are added to the target source data that need to remain consistent for each order, it is possible to accurately identify which data has been processed by the hardware and which data has not been processed by the hardware through the target identifier output by the hardware. In this way, only the incompletely processed data needs to be discarded and the corresponding target source data can be pulled from the exchange. This can usually be completed in a very short time, thereby improving the order processing efficiency when hardware failures occur.
[0057] In some embodiments, if the processing result is not received within the first preset time period, the method further includes:
[0058] A failure warning of the first processing node is generated.
[0059] In some embodiments, if the processing result is not received within the first preset time period, before reacquiring the target source data of the target order, the method further includes:
[0060] The number of failures of the first processing node within a second preset time period is obtained; if the number of failures is greater than a preset failure number threshold, the trading system is switched to a software mode.
[0061] After the trading system is switched to software mode, the target order is processed according to the re-acquired target source data in the software mode, and finally the software transaction can be restored in a short time when only the hardware fails. If the number of failures of the first processing node within the second preset time is not greater than the preset failure number threshold, the target order is processed according to the re-acquired target source data in the hardware mode.
[0062] For example, the first preset time is 1 minute. At this time, the number of failures of the first processing node within 1 minute is obtained (such as failure to output the corresponding processing results in time). If the number of failures is greater than the preset failure threshold (such as 20 times), it means that the first processing node has a large number of failures when processing orders. The system needs to automatically switch the current order processing mode to software mode. In software mode, hardware does not need to participate in order processing, so that when only the hardware fails, only the hardware acceleration function is lost, and the transaction (order processing) can also run seamlessly and continuously.
[0063] To sum up, on the one hand, when the trading system is in hardware mode, after obtaining the target source data of the target order, a target identifier of the target source data will be generated, and the target identifier will be added to the target source data, thereby realizing the tracking of the target source data; on the other hand, this embodiment will store the target source data carrying the target identifier that needs to be consistent in the consistency cache, and when the target source data is transmitted to the first processing node, and after the processing result carrying the target identifier is received in the aggregation node within a first preset time period, the target source data with the same identifier as the processing result is taken out from the consistency cache, and the target source data carrying the target identifier is transmitted to the second processing node. processing node, thereby ensuring that the target source data is consistent before and after the first processing node (inconsistent node); on the other hand, when the aggregation node does not receive the processing result carrying the target identifier within the first preset time period (which means that the first processing node fails), the target source data carrying the target identifier in the consistency cache is discarded, and the target source data of the target order is re-acquired. It can be seen that when the first processing node fails, this embodiment automatically discards the relevant data to avoid state asynchrony caused by partial data processing, and can automatically re-acquire the target source data of the target order, so that when only the hardware fails, the processing of the target order can be restored in a shorter time, thereby improving the user experience.
[0064] Figure 2 Schematic block diagram of an order processing device of a trading system provided in an embodiment of the present application. Figure 2 As shown, corresponding to the order processing method of the trading system above, the present application also provides an order processing device 200 of the trading system. The order processing device 200 of the trading system includes a unit for executing the order processing method of the trading system above, and the order processing device 200 of the trading system can be configured in the trading system. Figure 2 The order processing device of the trading system includes a transceiver unit 201 and a processing unit 202, wherein:
[0065] The transceiver unit 201 is used to obtain the target source data of the target order;
[0066] The processing unit 202 is used to generate a target identifier of the target source data when the trading system is in hardware mode, add the target identifier to the target source data, and store the target source data carrying the target identifier in a consistent cache; transmit the target source data carrying the target identifier to a first processing node, which is a hardware processing node; determine whether the aggregation node receives the processing result carrying the target identifier output by the first processing node within a first preset time period, and the aggregation node is used to aggregate the processing results of each processing node in the trading system; if the processing result is received within the first preset time period, then take out the target source data with the same identifier as the processing result from the consistent cache, and transmit the target source data carrying the target identifier to a second processing node; if the processing result is not received within the first preset time period, then discard the target source data carrying the target identifier in the consistent cache, and re-acquire the target source data of the target order through the transceiver unit 201.
[0067] In some embodiments, the target source data includes first source data and second source data; when the processing unit 202 performs the step of adding the target identifier to the target source data and storing the target source data carrying the target identifier in the coherent cache, it is specifically used to:
[0068] The target identifier is added to the first source data and the second source data respectively, and the first source data carrying the target identifier and the second source data carrying the target identifier are stored in the consistency cache.
[0069] In some embodiments, when executing the step of transferring the target source data carrying the target identifier to the first processing node, the processing unit 202 is specifically configured to:
[0070] Transmitting the first source data carrying the target identifier into the first processing node;
[0071] At this time, when the processing unit 202 executes the step of transferring the target source data carrying the target identifier to the second processing node, it is specifically configured to:
[0072] The second source data carrying the target identifier is transmitted to the second processing node.
[0073] In some embodiments, if the processing result is not received within the first preset time period, the processing unit 202 is further configured to:
[0074] The number of failures of the first processing node within a second preset time period is obtained through the transceiver unit 201; if the number of failures is greater than a preset failure number threshold, the trading system is switched to software mode.
[0075] In some embodiments, when executing the step of transferring the target source data carrying the target identifier to the second processing node, the processing unit 202 is specifically configured to:
[0076] The target source data carrying the target identifier and the processing result carrying the target identifier are transmitted to the second processing node.
[0077] In some embodiments, when executing the step of adding the target identifier to the target source data, the processing unit 202 is specifically configured to:
[0078] The target identifier is added to the target source data that needs to maintain consistency.
[0079] In some embodiments, if the processing result is not received within the first preset time period, the processing unit 202 is further configured to:
[0080] A failure warning of the first processing node is generated.
[0081] To sum up, on the one hand, when the trading system is in hardware mode, after obtaining the target source data of the target order, the target identifier of the target source data will be generated, and the target identifier will be added to the target source data, thereby realizing the tracking of the target source data; on the other hand, this embodiment will store the target source data carrying the target identifier that needs to be consistent in the consistency cache. When the target source data is transmitted to the first processing node and the processing result carrying the target identifier is received in the aggregation node within a first preset time, the target source data with the same identifier as the processing result is taken out from the consistency cache, and the target source data carrying the target identifier is transmitted to the second processing node, thereby ensuring the target source data. The target source data is consistent before and after the first processing node (inconsistent node); on the other hand, when the aggregation node does not receive the processing result carrying the target identifier within the first preset time period (which means that the first processing node fails), the target source data carrying the target identifier in the consistent cache is discarded, and the target source data of the target order is re-acquired. It can be seen that when the first processing node fails, this embodiment automatically discards the relevant data to avoid state asynchrony caused by partial data processing, and can automatically re-acquire the target source data of the target order without restarting the system, so that when only the hardware fails, the system can recover the processing of the target order in a shorter time, shortening the recovery time of the system, thereby improving the user experience.
[0082] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the order processing device and each unit of the above-mentioned trading system can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.
[0083] The order processing device of the trading system can be implemented in the form of a computer program. Figure 3 Runs on the computer device shown.
[0084] See also Figure 3 , Figure 3 300 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 300 is a computer device of a trading system.
[0085] See also Figure 3 The computer device 300 includes a processor 302 , a memory and a network interface 305 connected via a system bus 301 , wherein the memory may include a non-volatile storage medium 303 and an internal memory 304 .
[0086] The non-volatile storage medium 303 can store an operating system 3031 and a computer program 3032. The computer program 3032 includes program instructions, and when the program instructions are executed, the processor 302 can execute an order processing method of a trading system.
[0087] The processor 302 is used to provide computing and control capabilities to support the operation of the entire computer device 300 .
[0088] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute an order processing method of a trading system.
[0089] The network interface 305 is used to communicate with other devices over the network. Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 300 to which the solution of the present application is applied. The specific computer device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0090] The processor 302 is used to run a computer program 3032 stored in the memory to implement the following steps:
[0091] Get the target source data of the target order;
[0092] When the transaction system is in hardware mode, generating a target identifier for the target source data, adding the target identifier to the target source data, and storing the target source data carrying the target identifier in a consistent cache;
[0093] Transmitting the target source data carrying the target identifier into a first processing node, where the first processing node is a hardware processing node;
[0094] Determine whether the aggregation node receives the processing result carrying the target identifier output by the first processing node within a first preset time period, the aggregation node being used to aggregate the processing results of each processing node in the transaction system;
[0095] If the processing result is received within the first preset time period, taking out the target source data having the same identifier as the processing result from the consistency cache, and transferring the target source data carrying the target identifier to the second processing node;
[0096] If the processing result is not received within the first preset time period, the target source data carrying the target identifier in the consistency cache is discarded, and the target source data of the target order is reacquired.
[0097] It should be understood that in the embodiment of the present application, the processor 302 may be a central processing unit (CPU), and the processor 302 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, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0098] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0099] Therefore, the present application also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the following steps:
[0100] Get the target source data of the target order;
[0101] When the transaction system is in hardware mode, generating a target identifier for the target source data, adding the target identifier to the target source data, and storing the target source data carrying the target identifier in a consistent cache;
[0102] Transmitting the target source data carrying the target identifier into a first processing node, where the first processing node is a hardware processing node;
[0103] Determine whether the aggregation node receives the processing result carrying the target identifier output by the first processing node within a first preset time period, the aggregation node being used to aggregate the processing results of each processing node in the transaction system;
[0104] If the processing result is received within the first preset time period, taking out the target source data having the same identifier as the processing result from the consistency cache, and transferring the target source data carrying the target identifier to the second processing node;
[0105] If the processing result is not received within the first preset time period, the target source data carrying the target identifier in the consistency cache is discarded, and the target source data of the target order is reacquired.
[0106] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0107] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are 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 this application.
[0108] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0109] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0111] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An order processing method of a trading system, characterized in that: The method is applied to a trading system, and the method comprises: Get the target source data of the target order; When the transaction system is in hardware mode, generating a target identifier for the target source data, adding the target identifier to the target source data, and storing the target source data carrying the target identifier in a consistent cache; Transmitting the target source data carrying the target identifier into a first processing node, where the first processing node is a hardware processing node; Determine whether the aggregation node receives the processing result carrying the target identifier output by the first processing node within a first preset time period, the aggregation node being used to aggregate the processing results of each processing node in the transaction system; If the processing result is received within the first preset time, the target source data having the same identifier as the processing result is retrieved from the consistency cache, and the target source data carrying the target identifier is transmitted to the second processing node, the first processing node and the second processing node are non-consistent nodes, and the second processing node is a software processing node; If the processing result is not received within the first preset time period, discarding the target source data carrying the target identifier in the consistency cache, and reacquiring the target source data of the target order; The target source data includes first source data and second source data; adding the target identifier to the target source data, and storing the target source data carrying the target identifier in the consistency cache includes: Adding the target identifier to the first source data and the second source data respectively, and storing the first source data carrying the target identifier and the second source data carrying the target identifier in the consistency cache; The step of transferring the target source data carrying the target identifier to the first processing node includes: Transmitting the first source data carrying the target identifier into the first processing node; If the processing result is not received within the first preset time period, before re-acquiring the target source data of the target order, the method further includes: Obtaining the number of failures of the first processing node within a second preset time period; If the number of failures is greater than a preset failure number threshold, switching the trading system to software mode; The step of transferring the target source data carrying the target identifier to the second processing node includes: transferring the target source data carrying the target identifier and the processing result carrying the target identifier to the second processing node; The adding the target identifier to the target source data includes: The target identifier is added to the target source data that needs to maintain consistency.
2. The method according to claim 1, characterized in that If the processing result is not received within the first preset time period, the method further includes: A failure warning of the first processing node is generated.
3. An order processing device for a trading system, characterized in that: The order processing device is deployed in a trading system, and the order processing device of the trading system includes a transceiver unit and a processing unit, wherein: A transceiver unit, used to obtain target source data of a target order; a processing unit, configured to generate a target identifier of the target source data when the trading system is in hardware mode, add the target identifier to the target source data, and store the target source data carrying the target identifier in a consistent cache; transmit the target source data carrying the target identifier to a first processing node, which is a hardware processing node; determine whether a processing result carrying the target identifier output by the first processing node is received by a convergence node within a first preset time period, wherein the convergence node is used to converge the processing results of each processing node in the trading system; if the processing result is received within the first preset time period, then retrieve the target source data having the same identifier as the processing result from the consistent cache, and transmit the target source data carrying the target identifier to a second processing node, wherein the first processing node and the second processing node are non-consistent nodes, and the second processing node is a software processing node; if the processing result is not received within the first preset time period, then discard the target source data carrying the target identifier in the consistent cache, and re-acquire the target source data of the target order through the transceiver unit; The target source data includes first source data and second source data; when the processing unit executes the step of adding the target identifier to the target source data and storing the target source data carrying the target identifier in the consistent cache, it is specifically used to: Adding the target identifier to the first source data and the second source data respectively, and storing the first source data carrying the target identifier and the second source data carrying the target identifier in the consistency cache; When the processing unit executes the step of transferring the target source data carrying the target identifier to the first processing node, the processing unit is specifically configured to: Transmitting the first source data carrying the target identifier into the first processing node; If the processing result is not received within the first preset time period, the processing unit is further configured to: acquiring, by the transceiver unit, the number of failures of the first processing node within a second preset time period; if the number of failures is greater than a preset failure number threshold, switching the trading system to a software mode; When the processing unit executes the step of transferring the target source data carrying the target identifier to the second processing node, the processing unit is specifically configured to: transferring the target source data carrying the target identifier and the processing result carrying the target identifier to the second processing node; When executing the step of adding the target identifier to the target source data, the processing unit is specifically configured to: The target identifier is added to the target source data that needs to maintain consistency.
4. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the order processing method of the trading system according to any one of claims 1 to 2 is implemented.
5. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the order processing method of the trading system according to any one of claims 1 to 2.
Citation Information
Patent Citations
Block chain network transmission method and device, and electronic equipment
CN109474682A