Order declaration method and device, equipment, storage medium and program product
By dynamically allocating orders to multiple trading channels, and using transaction attributes and gateway sequences to determine available gateways, the problems of order declaration delay and gateway status abnormalities in securities transactions are solved, and efficient order diversion and system stability are achieved.
Patent Information
- Application Number
- CN202510071984.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-13
AI Technical Summary
During securities trading, when orders with the same order information are declared through a unique trading channel, if the order volume increases sharply, it will cause declaration delays, and abnormal gateway status affects order declaration.
By dynamically allocating orders with the same order information to multiple transaction channels, using the transaction attributes of the newly added orders to determine the target gateway sequence from multiple gateway sequences, and determining the first unoccupied gateway as an available gateway, modifying its occupancy status to avoid uneven allocation of subsequent orders. When the available gateway is running normally, cache the order to the cache queue of the transaction channel and declare it in queue order.
It realizes dynamic diversion of orders, avoids congestion during order declaration, improves order declaration efficiency, and reduces the impact of abnormal gateway status on order declaration, and improves the robustness and efficiency of the system.
Smart Images

Figure CN119996522A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of business processing technology, and in particular to an order declaration method, device, equipment, storage medium and program product. Background Art
[0002] In the securities trading process, traders place orders to the securities company's order management system, and the securities company submits the orders to the exchange through the exchange gateway platform. In the process, the order information is often used as an index to determine the trading channel connecting the order management system and the exchange gateway platform, and the order is transmitted to the corresponding exchange gateway platform through the trading channel, and then submitted to the exchange through the platform.
[0003] When orders with the same order information are submitted through the only transaction channel indexed by the order information, if the order volume increases sharply, it will cause congestion in the order submission process, resulting in delayed submission. To address this issue, the current order management system can divert orders by connecting to different seats of the exchange, but orders with the same information in a single seat can only be processed through a single transaction channel, which may lead to untimely order processing. At the same time, if the gateway status corresponding to the transaction channel is abnormal, it will affect order submission. Summary of the invention
[0004] The embodiments of the present application provide an order declaration method, apparatus, device, storage medium and program product, which realize order diversion with the same order information by dynamically allocating orders with the same order information to multiple transaction channels, avoid congestion when a large number of orders are declared, and improve the efficiency of order declaration.
[0005] In a first aspect, an embodiment of the present application provides an order declaration method, comprising: obtaining transaction attributes of a newly added order; determining a target gateway sequence from multiple gateway sequences based on the transaction attributes of the newly added order; determining the first gateway in the target gateway sequence whose occupancy status is unoccupied as an available gateway for the newly added order, and modifying the occupancy status of the available gateway to occupied; when the operating status of the available gateway is normal, caching the newly added order to the cache queue of the transaction channel corresponding to the available gateway, so as to declare the order therein in the order in the cache queue.
[0006] In a possible implementation, based on the transaction attributes of the newly added order, a target gateway sequence is determined from multiple gateway sequences, including: obtaining the transaction attributes corresponding to each gateway sequence; and determining a gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order as the target gateway sequence.
[0007] In a possible implementation, the method further includes: if there is no gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order, determining multiple candidate gateways from multiple gateways based on the transaction attributes of the newly added order; sorting the multiple candidate gateways according to the time consumption of the transaction channels corresponding to the multiple candidate gateways to obtain a target gateway sequence, and determining the transaction attributes corresponding to the target gateway sequence as the transaction attributes corresponding to the target gateway sequence.
[0008] In a possible implementation, the method further includes: if the number of candidate gateways is 0, caching the newly added order into an abnormal order queue and providing an abnormal prompt.
[0009] In a possible implementation, the method further includes: if the occupancy status of each gateway in the target gateway sequence is occupied, modifying the occupancy status of each gateway in the target gateway sequence to unoccupied, so as to re-traverse the gateways in the target gateway sequence to obtain available gateways for the newly added order.
[0010] In a possible implementation, the newly added order is an order at the head of a queue of pending orders, and the method further includes: if the target gateway does not have a corresponding transaction channel or the operating status of the available gateway is abnormal, the newly added order is placed at the end of the queue of pending orders.
[0011] In a second aspect, an embodiment of the present application provides an order declaration device, comprising: a transaction attribute acquisition module, used to obtain the transaction attributes of a newly added order; a target gateway sequence determination module, used to determine a target gateway sequence from multiple gateway sequences based on the transaction attributes of the newly added order; an available gateway determination module, used to determine the first gateway in the target gateway sequence with an occupancy status of unoccupied as an available gateway for the newly added order, and to modify the occupancy status of the available gateway to occupied; a transaction channel determination module, used to cache the newly added order to the cache queue of the transaction channel corresponding to the available gateway when the operating status of the available gateway is normal, so as to declare the order therein in the order in the cache queue.
[0012] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the method provided in the first aspect of the present application.
[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method provided in the first aspect of the present application.
[0014] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the method provided in the first aspect of the present application when executed by a processor.
[0015] The order declaration method, device, equipment, storage medium and program product provided in the embodiment of the present application realize the diversion of orders by dynamically allocating orders to multiple transaction channels. First, the transaction attribute of the newly added order is used as an index to find the target gateway sequence that supports the declaration of the newly added order from multiple gateway sequences; next, the available gateway for the newly added order needs to be determined from the target gateway sequence, specifically by determining the first unoccupied gateway in the target gateway sequence as the available gateway for the newly added order, and modifying the occupancy status of the gateway to occupied, so as to avoid subsequent orders from continuing to be declared through the gateway, resulting in uneven order distribution; when the available gateways allocated to the order are operating normally, the newly added orders are cached in the cache queue of the transaction channel, and the order is declared in the order in the cache queue. It realizes the dynamic and uniform distribution of multiple orders to multiple transaction channels, solves the problem that a large number of orders with the same order information can only be declared through one transaction channel, resulting in untimely order processing, and improves work efficiency. At the same time, the transaction channel is dynamically selected according to the operation status of the gateway, which reduces the impact of abnormal operation status of the gateway on order declaration and improves the robustness and efficiency of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0017] Figure 1 A schematic diagram of a scenario provided for an embodiment of the present application;
[0018] Figure 2 A flowchart of an order submission method provided in an embodiment of the present application;
[0019] Figure 3 A schematic diagram of placing an order to an order management system provided in an embodiment of the present application;
[0020] Figure 4 A flowchart of another order submission method provided in an embodiment of the present application;
[0021] Figure 5 A flowchart of another order submission method provided in an embodiment of the present application;
[0022] Figure 6 A schematic diagram of the architecture of an order reporting system provided in an embodiment of the present application;
[0023] Figure 7A schematic diagram of the structure of an order reporting device provided in an embodiment of the present application;
[0024] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0025] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0026] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.
[0027] First, the terms involved in this application are explained:
[0028] An Order Management System (OMS) is a system used to manage and optimize the order processing process. It can receive, process, and distribute orders submitted by users.
[0029] The exchange gateway platform refers to the key application that connects market participants and exchanges, and is used to provide business access and flow rate control functions, including bidding platforms, comprehensive platforms, and non-trading platforms. Among them, the gateway is the core part of the exchange gateway platform, responsible for transaction access and flow rate control.
[0030] In the order declaration process, the customer places an order in the securities market, and the securities company's order management system receives the order and sends the order to the exchange through the gateway in the exchange gateway platform. The order management system establishes a transaction channel with each gateway, that is, the business processing thread for the order management system to communicate with the exchange gateway platform, and declares the order to the exchange through the transaction channel. The gateway and the transaction channel are one-to-one corresponding. In the order management system, the order information is often used as an index to determine the transaction channel corresponding to the order.
[0031] When there are multiple orders with the same information, only a unique trading channel can be determined based on the index. Due to the limited processing speed of the trading channel, congestion may occur during the order declaration process, resulting in untimely order processing. If the gateway corresponding to the trading channel is abnormal, multiple orders will be affected. At present, since the seat in the order information represents the terminal that finally communicates with the exchange, changing the seat information will not affect the order declaration. Therefore, an order management system can achieve diversion by binding orders to different seats. However, if the securities company only has a single seat, this method cannot divert orders with the same information, and cannot solve the problem of trading channel congestion caused by a large number of orders with the same information.
[0032] In response to the above problems, the embodiment of the present application proposes an order declaration method, which dynamically diverts the orders in the order management system, thereby realizing the declaration of the orders. Through the transaction attributes of the newly added order, the target gateway sequence that supports the declaration of the newly added order is determined from multiple gateway sequences; next, the first unoccupied gateway is determined from the target gateway sequence as an available gateway, and the state of the gateway is modified to occupied; next, the available gateway is used as an index, and when the operating status of the available gateway is normal, the newly added order is cached in the cache queue of the transaction channel indexed by the available gateway, so that the order is evenly distributed to each transaction channel. It realizes the dynamic allocation of orders to multiple transaction channels, and caches the orders to the cache queue according to the gateway operating status corresponding to the transaction channel, avoiding the problem of untimely order processing caused by only one transaction channel and affecting order declaration when the gateway status is abnormal, and improving the efficiency of order declaration and the robustness of the system.
[0033] Figure 1 A schematic diagram of a scenario provided in an embodiment of the present application. Figure 1 As shown, the order declaration method provided by the present application can be applied to the field of securities trading, especially to the communication process between market participants and exchanges, such as securities companies declaring orders to exchanges. Taking the example of securities companies declaring orders to exchanges, customers place orders in the securities market, and the order management system receives and manages multiple orders (orders 1 to N). At the same time, through the order declaration method provided by the present application, the N orders in the order management system are sequentially configured in the transaction channels corresponding to the M gateways one by one, and the communication with the exchange is realized through the gateway corresponding to the transaction channel, so as to declare the order to the exchange.
[0034] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0035] Figure 2 The flowchart of an order declaration method provided in the embodiment of the present application is shown in FIG. The method provided in the embodiment can be executed by an order management system, such as Figure 2 As shown, the order declaration method includes the following steps:
[0036] Step S201: Obtain transaction attributes of a newly added order.
[0037] An order is a trading order placed by a customer in the securities market during securities trading. Securities companies submit these trading orders to the exchange to complete the corresponding transactions. For example, a customer selects the securities and order type to be traded in the customer terminal of the securities system and submits the order in the customer terminal. After submission, the securities system sends the order to the order management system of the securities system for processing. Through the configuration information of the order management system, the order is sent to the exchange for declaration. The order contains order information such as the type, quantity, and price of the transaction. The order management system continuously receives orders and caches the received orders in the queue of pending orders. The newly added order is the first order in the queue, that is, the next new order to be declared. The newly added order is bound to the transaction attribute.
[0038] Transaction attributes are additional information for newly added orders, which can be determined based on order information or manually configured. For example, customers can select and confirm the transaction attributes of an order at the customer terminal of the securities system, or read the commodity information, buy or sell information, etc. in the order information through the order management system or securities system to determine the transaction attributes.
[0039] The transaction attributes of the newly added order include but are not limited to market, seat and platform type.
[0040] The order management system can generate a configuration file to store orders and their transaction attributes. The transaction attributes of an order can be obtained by reading the contents of the configuration file. An order can also be bound to its transaction attributes, for example, an order can be numbered, and part of the number represents the transaction attributes of the order.
[0041] The market in the transaction attribute specifically refers to the place where securities are issued and traded. Depending on the securities product, the market can include the stock market, bond market, gold market, etc. The market information in the transaction attribute helps the exchange to classify and process orders more accurately and quickly, and classifying orders by market can also avoid difficulties in order management and maintenance when the number of orders is large.
[0042] The seats in the trading attributes specifically refer to the trading terminals set up in the trading system provided by the exchange to market participants (i.e. securities companies).
[0043] The platform type in the transaction attributes specifically refers to the type of the exchange gateway platform corresponding to the newly added order, for example, it is divided into bidding platform, comprehensive platform and non-trading platform.
[0044] Specifically, the customer accesses the securities system through the customer terminal and generates an order through the order interface provided by the securities system. The securities system configures the attributes of the newly added order, including transaction attributes and other order information, and sends the order and its transaction attributes to the order management system. The order management system caches the order to the queue of pending orders. The transaction attributes of the newly added order are read from the configuration file or the information bound to the order.
[0045] For example, Figure 3 This is a schematic diagram of placing an order to an order management system provided in an embodiment of the present application. Figure 3 As shown, the customer submits order N through the customer terminal, the order management system receives order N, and caches it to the end of the queue of pending orders. The order management system processes the orders in sequence according to the order queue, among which order 1 at the head of the queue (i.e., the next order to be processed) is a newly added order, and the transaction attributes corresponding to the order are the transaction attributes of the newly added order.
[0046] Compared with the type, quantity and price of the order, the transaction attributes of the newly added orders, such as market, seat and platform type, are obtained in a relatively small number, which can avoid the orders being too scattered. By making the transaction attributes of the orders have a certain repetition rate, it is possible to avoid the problem of too many types increasing the difficulty of management and maintenance when processing based on other information, such as setting a large amount of configuration information. It is possible to increase the system processing efficiency on the basis of processing orders with different transaction attributes separately.
[0047] Step S202: Determine a target gateway sequence from multiple gateway sequences based on the transaction attributes of the newly added order.
[0048] The gateway is specifically used in the exchange gateway platform to connect the order management system of trading participants and the exchange, so that orders can be transmitted from the order management system to the exchange. In the order management system, a gateway can be determined according to the transaction attributes of the newly added order, and then the newly added order can be transmitted to the exchange system through the business processing thread between the order management system and the gateway.
[0049] In this embodiment, an order of one transaction attribute may correspond to multiple gateways, and multiple gateways with the same corresponding transaction attributes are arranged in a certain order to generate a gateway sequence.
[0050] The transaction attributes corresponding to the gateway can be determined based on the configuration information of the gateway. For example, the transaction attributes of the orders that the gateway can pass are determined based on the configuration information, and the transaction attributes are determined as the transaction attributes corresponding to the gateway. Alternatively, through manual configuration, for example, if some gateways can allow orders with multiple transaction attributes to pass, a transaction attribute corresponding to the gateway can be determined from the multiple transaction attributes.
[0051] The order of multiple gateways can be manually configured, or they can be sorted according to the speed at which the gateway processes orders, that is, the time taken by the corresponding transaction channels. Multiple gateways can also be arranged according to other priority orders, such as the number of times a gateway is reused by multiple gateway sequences.
[0052] The gateway index table can be configured in the order management system. The index value in the gateway index table is the transaction attribute, and the index result is the corresponding gateway. In order to divert orders, the same transaction attribute corresponds to multiple gateways, and the multiple gateways constitute a gateway sequence.
[0053] For example, assuming that there are M gateways, all of which can be used for bidding operations in the stock market, and there is only one seat 1 of the securities company passed, then the transaction attributes of the orders corresponding to the M gateways are consistent, which is stock market|seat 1|bidding platform, and the stock market|seat 1|bidding platform can be used as the index value, and the M gateways are used as the index result. When the transaction attribute of the newly added order is stock market|seat 1|bidding platform, the corresponding M gateways can be determined, and the M gateways can be numbered from gateway 1 to gateway M to form a gateway sequence.
[0054] Based on the transaction attributes of the newly added order, a target gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order can be determined from multiple gateway sequences through the gateway index table.
[0055] In some embodiments, some gateways can be used for declaration of orders with multiple transaction attributes. In this case, the gateways can be classified and their corresponding transaction attributes can be specified according to the number of orders that need to be diverted.
[0056] For example, assuming that the above-mentioned M gateways can be used for declaring orders with trading attributes of stock market | seat 1 | bidding platform, and can also be used for declaring orders with trading attributes of bond market | seat 1 | bidding platform, the trading attributes corresponding to the m gateways can be set to stock market | seat 1 | bidding platform, and the trading attributes corresponding to the n gateways can be set to bond market | seat 1 | bidding platform, where m and n are positive integers less than or equal to M.
[0057] Step S203: The first gateway in the target gateway sequence whose occupation state is unoccupied is determined as an available gateway for the newly added order, and the occupation state of the available gateway is changed to occupied.
[0058] The default occupation status of a gateway is unoccupied, which means that the gateway is not occupied by any order. When a gateway is determined as an available gateway for a pending order, such as a new order, the gateway is considered to be occupied by the new order.
[0059] After determining the target gateway sequence, you need to determine a gateway from the target gateway sequence. The first gateway in the target gateway sequence with an occupancy status of unoccupied can be determined as the available gateway for the new order. Since the order will be declared through this available gateway next, the occupancy status of the available gateway is changed to occupied.
[0060] The gateways in the target gateway sequence can be traversed to determine the occupancy status of each gateway in the target gateway sequence, and according to the occupancy status of each gateway, the first gateway in the target gateway sequence with an occupancy status of unoccupied can be determined as an available gateway for the new order, and the occupancy status of the available gateway can be modified to occupied.
[0061] Exemplarily, a pointer may be used to point to the first unoccupied gateway. A corresponding available gateway pointer is set in a plurality of gateway sequences to point to the first unoccupied gateway in each gateway sequence. After determining the target gateway sequence, the available gateway pointer of the target gateway sequence is read, and the gateway pointed to by the available gateway pointer is the available gateway. After the pointer is read, that is, after the gateway is determined to be an available gateway, the pointer moves to the next gateway in the target gateway sequence, and the next gateway becomes the new first unoccupied gateway.
[0062] Exemplarily, a variable may be determined, and the variable content may be a gateway serial number, a gateway name, or a gateway address, etc. The variable is used to indicate the first gateway whose occupation status is unoccupied. After determining the target gateway sequence, the variable corresponding to the target gateway sequence is read, and the variable points to the first gateway whose occupation status is unoccupied, and the variable is modified to the next gateway according to the order of the gateways.
[0063] In some embodiments, if multiple gateways in the target gateway sequence are all in use, that is, the occupancy status of the multiple gateways is occupied, the occupancy status of the multiple gateways in the target gateway sequence may be reset to unoccupied.
[0064] Step S204: When the operation status of the available gateway is normal, the newly added order is cached to the cache queue of the transaction channel corresponding to the available gateway, so as to declare the orders therein according to the order in the cache queue.
[0065] The gateway operation status is divided into normal and abnormal according to whether the gateway can work normally.
[0066] The transaction channel specifically refers to the business processing thread for the order management system to communicate with the gateway. The transaction channel corresponding to the gateway can be pre-configured in the order management system according to the gateway.
[0067] Data can be sent to the gateway through each transaction channel to determine the operation status of the corresponding gateway, or the operation status of the corresponding gateway can be determined based on whether the order through the transaction channel is successfully submitted. If there is no response, it means that the gateway cannot work normally, and the operation status of the gateway is determined to be abnormal. The operation status of the detected gateway can be configured in the configuration file.
[0068] When the order management system is started, if the order management system cannot communicate with each gateway normally, the operation status of each gateway in the transaction channel index table is set to abnormal state. After the order management system and the gateway are initialized, the operation status of each gateway is set to normal state.
[0069] There is only one transaction channel between the order management system and a gateway. The transaction channel index table can be configured in the order management system to determine the only transaction channel based on the transaction attributes and the gateway. Specifically, the index value in the transaction channel index table is the transaction attribute and the gateway, and the index result is the corresponding transaction channel. The format of the transaction channel index table can be <index value, transaction channel>. The transaction channel index table includes the operating status of the corresponding gateway, which is used to show whether the transaction channel can work normally.
[0070] In some embodiments, the time consumption of each transaction channel can be determined according to the response speed of the gateway when each transaction channel sends data to the gateway.
[0071] The cache queue of the transaction channel is used by the order management system to pull orders from the cache queue for processing in a certain order, ensuring that each order can be processed in a timely and effective manner.
[0072] Specifically, after determining the available gateway, the unique corresponding transaction channel can be determined, and the operating status of the available gateway in the configuration file or the transaction channel index table is determined according to the transaction channel. If the operating status is the preset status, it means that the order can be declared through the gateway. The newly added order is cached in the cache queue of the transaction channel corresponding to the available gateway, and the order management system declares the order according to the order in the cache queue.
[0073] By determining the available gateways to determine the transaction channel for new orders, and on the basis of dynamically allocating transaction channels, the available gateways are added as indexes for each new order to determine the unique transaction channel. This can speed up the determination of transaction channels on the one hand, and help improve the integrity and security of order data on the other hand, facilitating subsequent tracing.
[0074] If the operating status of an available gateway is abnormal, it means that orders cannot be submitted through the gateway. New orders can be reallocated to determine the available gateways and their corresponding transaction channels. At the same time, prompts are given based on the status of the available gateway to prompt staff to make timely adjustments so that the available gateway can return to normal status as soon as possible.
[0075] Re-allocating the newly added order specifically refers to placing the order in a queue of pending orders of the order management system so that the order re-executes the method. The position of the queue of pending orders where the order is specifically inserted may be the head, the tail or the middle of the queue.
[0076] In some embodiments, if the order is inserted into the head of the queue to be processed, the order management system directly executes the order declaration method for the newly added order. In order to simplify the process, step S203 can be directly executed.
[0077] If the status of each gateway in the target gateway sequence of the newly added order is abnormal, in order to prevent an infinite loop, when traversing each gateway and there is no gateway in normal status, the loop can be interrupted and the newly added order can be cached in the cache queue of the transaction channel corresponding to the available gateway. When waiting for the gateway status to return to normal, the orders in the cache queue are declared in the order in which they are in the cache queue.
[0078] An order declaration method provided by an embodiment of the present application realizes order diversion by dynamically allocating orders to multiple transaction channels. First, the transaction attributes of the newly added order are used as an index to find the target gateway sequence that supports the declaration of the newly added order from multiple gateway sequences; next, the available gateway for the newly added order needs to be determined from the target gateway sequence, specifically by determining the first unoccupied gateway in the target gateway sequence as the available gateway for the newly added order, and modifying the occupancy status of the gateway to occupied, so as to avoid subsequent orders from continuing to be declared through the gateway, resulting in uneven order distribution; when the available gateways for order allocation are operating normally, the newly added orders are cached in the cache queue of the transaction channel, and the order is declared in the order in the cache queue. It realizes the dynamic and uniform distribution of multiple orders to multiple transaction channels, solves the problem that a large number of orders with the same transaction attributes can only be declared through one transaction channel, resulting in untimely order processing, and improves work efficiency. At the same time, the transaction channel is dynamically selected according to the gateway status, which reduces the impact of abnormal gateway status on order declaration and improves the robustness and efficiency of the system.
[0079] Figure 4 A flowchart of another order declaration method provided in an embodiment of the present application. Figure 4 As shown, in this embodiment Figure 2 Based on the embodiment, step S202 and step S203 are further refined, and the method may specifically include the following steps:
[0080] Step S401: Obtain transaction attributes of a newly added order.
[0081] Step S402: Obtain transaction attributes corresponding to each gateway sequence.
[0082] The gateway sequence and the transaction attributes corresponding to the multiple gateways in the gateway sequence are configured as a gateway index table. The format of the gateway index table can be <transaction attribute, gateway sequence>. The gateway sequence can be determined by the transaction attribute, and the gateway sequence includes multiple gateways. Among them, the gateways in the gateway sequence can be represented by the gateway sequence number, that is, the multiple gateways are numbered according to the order for subsequent processing. The format of the transaction attribute can be market|seat|platform type.
[0083] It should be noted that the transaction attributes of the orders that can be passed through each gateway may include multiple transaction attributes, and the unique transaction attributes corresponding to the gateway sequence are configured through the gateway index table. Among them, different gateway sequences may include the same gateway.
[0084] According to the configured gateway index table, the transaction attributes corresponding to the gateway sequence are determined.
[0085] Step S403: Determine whether there is a gateway sequence with corresponding transaction attributes consistent with the transaction attributes of the newly added order. If so, execute step S406; if not, execute step S404.
[0086] Step S404: If there is no gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order, multiple candidate gateways are determined from multiple gateways based on the transaction attributes of the newly added order.
[0087] If there is no gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order in the configured gateway index table, it means that the gateway sequence corresponding to the transaction attributes has not been configured, and multiple candidate gateways can be determined first.
[0088] Candidate gateways refer to multiple gateways through which the newly added order can be submitted. The determination method is to determine the gateways that can be submitted for orders with the transaction attribute based on the configuration parameters of the gateway, and determine that all or part of the gateways that can be submitted for orders with the transaction attribute are multiple candidate gateways.
[0089] The number of candidate gateways can be determined based on the order information of the corresponding transaction attribute. For example, based on the number of orders of the transaction attribute within a certain period of time and the processing time of the orders of the transaction attribute, the number of channels that the orders of the transaction attribute need to be diverted, that is, the number of candidate gateways, is determined.
[0090] In some embodiments, since the same gateway can be used for declaring orders of multiple transaction attributes, if a gateway is in multiple available gateway sequences, declaring orders of different transaction attributes may still cause order congestion, resulting in delays in order declaration. Therefore, some gateways can be determined as candidate gateways based on the number of gateway sequences corresponding to gateways that can be used for declaring orders of the transaction attribute, so as to avoid excessive overlap of gateways and improve the overall work efficiency of the order management system.
[0091] Optionally, if the number of candidate gateways is 0, the newly added order is cached in the abnormal order queue and an abnormal prompt is given.
[0092] If the number of candidate gateways is 0, that is, there is no gateway for declaring orders of this transaction attribute, it means that the order management system cannot process new orders of this transaction attribute.
[0093] Create a new abnormal order queue in the order management system to store, prompt abnormalities, check and reprocess orders that fail to be submitted.
[0094] Specifically, the newly added order is cached in an abnormal order queue. The order management system extracts the order in the abnormal order queue and sends an abnormal prompt message to the customer or the securities company so that the customer or the securities company can check the order.
[0095] If the transaction attributes are incorrect, the order will be placed at the end of the queue of pending orders after the transaction attributes are modified, so as to re-execute the method and make the order normally reported. If there are no errors, the order management system to which the order is submitted may be incorrect. The order management system can communicate with other order management systems to determine the correct order management system, and send the newly added order to the queue of pending orders of the correct order management system so as to be reported through the correct order management system.
[0096] By processing orders that cannot be declared, we can identify the problems of failed order declaration, improve the process, increase the success rate of order declaration, and thus improve customer satisfaction.
[0097] Step S405: sort the multiple candidate gateways according to the time consumption of the transaction channels corresponding to the multiple candidate gateways to obtain a target gateway sequence, and determine the transaction attributes corresponding to the target gateway sequence as the transaction attributes of the newly added order.
[0098] The time consumption of a trading channel refers to the average time required for an order to be submitted through the trading channel. The time consumption of each trading channel varies depending on its corresponding gateway and configuration. Therefore, the number of orders that can be processed by each trading channel in a certain period of time is different.
[0099] According to the time consumption of the transaction channels corresponding to the multiple candidate gateways, the multiple candidate gateways are sorted to obtain a target gateway sequence, and the target gateway sequence is added to the gateway index table, and the transaction attributes of the newly added order are determined as the transaction attributes corresponding to the target gateway sequence.
[0100] Specifically, according to the time consumption of the transaction channels corresponding to multiple candidate gateways, the candidate gateways corresponding to the transaction channels with shorter time consumption can be ranked in the front position, and the transaction channels with shorter time consumption can be used for declaration first, thereby improving the efficiency of order declaration.
[0101] In some embodiments, in the target gateway sequence, the number of candidate gateways may be greater than or equal to 1. For example, if there are two candidate gateways, namely candidate gateway 1 and candidate gateway 2. The time consumption of the transaction channel corresponding to candidate gateway 1 is twice the time consumption of the transaction channel corresponding to candidate gateway 2, then the target gateway sequence may be obtained according to the order of candidate gateway 2-candidate gateway 2-candidate gateway 1.
[0102] Step S406: If there is a gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order, determine the gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order as the target gateway sequence.
[0103] According to the transaction attributes of the newly added order, the gateway sequence is indexed from the gateway index table, and the indexed gateway is determined as the target gateway sequence.
[0104] Step S407: Determine whether there is a gateway in the target gateway sequence whose occupation state is unoccupied. If yes, execute step S408; if no, execute step S409.
[0105] Step S408: The first gateway in the target gateway sequence whose occupation state is unoccupied is determined as an available gateway for the newly added order, and the occupation state of the available gateway is changed to occupied.
[0106] Step S409: If the occupancy status of each gateway in the target gateway sequence is occupied, the occupancy status of each gateway in the target gateway sequence is modified to unoccupied, so as to re-traverse the gateways in the target gateway sequence to obtain available gateways for the newly added order.
[0107] If the occupancy status of each gateway in the target gateway sequence is occupied, it means that each gateway in the target gateway sequence has been determined as an available gateway, that is, the trading channels corresponding to each gateway have been assigned orders. At this time, the occupancy status of each gateway in the target gateway sequence is changed to unoccupied, so as to realize the re-assignment of orders to the trading channels corresponding to each gateway, so as to evenly distribute orders to each trading channel.
[0108] Step S410: When the status of the available gateway is normal, the newly added order is cached in the cache queue of the transaction channel corresponding to the available gateway, so as to declare the orders therein according to the order in the cache queue.
[0109] Optionally, the newly added order is the order at the head of the queue of pending orders. If the available gateway does not have a corresponding transaction channel or the operation status of the available gateway is abnormal, the newly added order is placed at the end of the queue of pending orders.
[0110] If there is no corresponding transaction channel for the available gateway, it means that there is no transaction channel between the order management system and the available gateway. In order to ensure the timeliness of order declaration, the newly added order will be cached to the end of the queue to be processed, the method will be re-executed to determine the transaction channel, and the target gateway will be removed from the gateway sequence.
[0111] In some embodiments, when it is detected that the transaction attribute|available gateway index has no corresponding transaction channel, a new transaction channel can be created between the order management system and the available gateway, so that subsequent orders can be declared through the newly created transaction channel. The business attribute|target gateway and its business attribute index relationship with the transaction channel are added to the transaction channel index table.
[0112] If the status of the available gateway is abnormal, the transaction channel corresponding to the available gateway cannot work normally, and the newly added order can be cached to the end of the queue to be processed, and the method is re-executed to determine the transaction channel.
[0113] By caching new orders for which no corresponding transaction channels exist into the queue of pending orders, problems in the order submission process can be identified and optimized, thereby increasing the success rate of business processing.
[0114] In this embodiment, the target gateway sequence of the newly added order can be quickly determined by the transaction attributes corresponding to the gateway sequence, and the uniqueness of the corresponding relationship can be ensured by establishing an index, thereby avoiding data conflicts and duplications and ensuring the robustness of the program. In addition, by establishing the target gateway sequence when it is detected that the target gateway sequence does not exist during the order processing process, the problem of abnormal order declaration of the business attribute caused by missing an order of a certain business attribute is avoided, thereby improving the robustness and stability of the method, and by sorting the candidate gateways in the target gateway sequence according to the business time consumption, the transaction channel with shorter time consumption is preferentially used for processing, or different transaction channels with different time consumption process different numbers of businesses, which can improve the efficiency of order declaration and optimize resource utilization. At the same time, by determining the available gateways corresponding to the newly added order by polling, it is possible to achieve an average distribution of orders to each transaction channel in turn, which can ensure the fairness and flexibility of order distribution.
[0115] Figure 5A flowchart of another order declaration method provided in an embodiment of the present application is shown as follows: Figure 5 As shown, in order to more clearly understand the order declaration method provided by this embodiment, this embodiment specifically describes the method.
[0116] Step S501: Obtain transaction attributes of a newly added order.
[0117] Step S502: Acquire transaction attributes corresponding to each gateway sequence.
[0118] Step S503: Based on the transaction attributes of the newly added order, determine whether there is a candidate gateway from multiple gateways. If so, execute step S505; if not, execute step S504.
[0119] Step S504: cache the newly added order to the abnormal order queue and provide an abnormal prompt.
[0120] Step S505: Determine a gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order as the target gateway sequence.
[0121] If there are candidate gateways, it is necessary to determine whether there is a gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order.
[0122] If there is no gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order, multiple candidate gateways are sorted according to the time consumption of the transaction channels corresponding to the multiple candidate gateways to obtain the target gateway sequence, and the transaction attributes of the newly added order are determined as the transaction attributes corresponding to the target gateway sequence.
[0123] If there is a gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order, the gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order is directly determined as the target gateway sequence.
[0124] For example, Figure 6 This is a schematic diagram of the architecture of an order reporting system provided in an embodiment of the present application. Figure 6 As shown, an order of a certain transaction attribute in the system can be declared through gateway 1, gateway 2 and gateway 3, and gateway 1-gateway 3 can constitute a target gateway sequence.
[0125] Step S506: Determine whether there is a gateway in the target gateway sequence whose occupation state is unoccupied. If yes, execute step S507; if no, execute step S508.
[0126] Step S507: The first gateway in the target gateway sequence whose occupation state is unoccupied is determined as an available gateway for the newly added order, and the occupation state of the available gateway is changed to occupied.
[0127] For example, it is assumed that there is a variable called the available gateway number, which is used to indicate the first gateway number whose occupation status is unoccupied. The occupation status of the gateways smaller than the available gateway number is occupied, and the occupation status of the gateways larger than the available gateway number is unoccupied. When the gateway is occupied, the available gateway number is increased by 1. When the available gateway number is 1 and there is a new order of the transaction attribute, the available gateway number is read, and gateway 1 is determined as the available gateway for the new order, and the available gateway number is set to 2, indicating that gateway 1 has been occupied.
[0128] Step S508: modify the occupied state of each gateway in the target gateway sequence to unoccupied, and return to execute step S507.
[0129] Exemplarily, when the available gateway number is 3 and there is a new order of the transaction attribute, gateway 3 is determined as the available gateway for the new order, and the available gateway number is set to 4. Since the available gateway number is greater than the number of gateways in the target gateway sequence, it means that the occupancy status of each gateway in the target gateway sequence is occupied, and the available gateway number is set to 1, indicating that the occupancy status of each gateway in the target gateway sequence is changed to unoccupied.
[0130] Step S509: Determine whether the status of the available gateway is normal. If yes, execute step S510; if no, execute step S511.
[0131] Step S510: Cache the newly added order to the cache queue of the transaction channel corresponding to the available gateway, so as to declare the orders therein according to the order in the cache queue.
[0132] For example, continue to refer to Figure 6 , according to the determined available gateway, each order in the pending order queue is sequentially cached in the cache queue of the transaction channel corresponding to the available gateway, and the orders in each cache queue communicate with the transaction channel formed by the gateway through business processing according to the data of the cache queue.
[0133] Step S511, determine whether there is a gateway in a preset state in the target gateway sequence. If yes, return to step S504; if no, go to step S510.
[0134] The order declaration method provided in this embodiment has similar implementation principles and technical effects, which will not be described in detail in this embodiment.
[0135] Figure 7 A schematic diagram of the structure of the order reporting device provided in the embodiment of the present application, such as Figure 7 As shown, the order declaration device 70 provided in this embodiment includes: a transaction attribute acquisition module 701, a target gateway sequence determination module 702, an available gateway determination module 703 and a transaction channel determination module 704.
[0136] The transaction attribute acquisition module 701 is used to obtain the transaction attributes of the newly added order; the target gateway sequence determination module 702 is used to determine the target gateway sequence from multiple gateway sequences based on the transaction attributes of the newly added order; the available gateway determination module 703 is used to determine the first gateway in the target gateway sequence with an occupancy status of unoccupied as the available gateway for the newly added order, and change the occupancy status of the available gateway to occupied; the transaction channel determination module 704 is used to cache the newly added order to the cache queue of the transaction channel corresponding to the available gateway when the operating status of the available gateway is normal, so as to declare the orders therein in the order in the cache queue.
[0137] Optionally, the target gateway sequence determination module 702 is specifically used to: obtain transaction attributes corresponding to each gateway sequence; and determine a gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order as the target gateway sequence.
[0138] Optionally, the order declaration device 70 also includes a target gateway sequence generation module, an abnormal order queue processing module, an occupancy status modification module and a pending order queue processing module.
[0139] The target gateway sequence generation module is used to determine multiple candidate gateways from multiple gateways based on the transaction attributes of the new order if there is no gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the new order, sort the multiple candidate gateways according to the time consumption of the transaction channels corresponding to the multiple candidate gateways, obtain the target gateway sequence, and determine the transaction attributes corresponding to the target gateway sequence as the transaction attributes of the new order.
[0140] The abnormal order queue processing module is used to cache the newly added order into the abnormal order queue and provide an abnormal prompt if the number of candidate gateways is 0.
[0141] The occupancy status modification module is used to modify the occupancy status of each gateway in the target gateway sequence to unoccupied if the occupancy status of each gateway in the target gateway sequence is occupied, so as to re-traverse the gateways in the target gateway sequence and obtain available gateways for the newly added order.
[0142] The pending order queue processing module is used to place the newly added order at the end of the pending order queue if the target gateway does not have a corresponding transaction channel or the operation status of the available gateway is abnormal. The newly added order is the order at the head of the pending order queue.
[0143] The order reporting device 70 provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail in this embodiment.
[0144] Figure 8This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 80 provided in this embodiment includes: at least one processor 801 and a memory 802. Optionally, the device 80 also includes a communication component 803. The processor 801, the memory 802 and the communication component 803 are connected via a bus.
[0145] In a specific implementation process, at least one processor 801 executes the computer-executable instructions stored in the memory 802, so that at least one processor 801 executes the above method.
[0146] The specific implementation process of the processor 801 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0147] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the invention may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0148] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0149] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0150] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0151] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0152] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0153] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in a dedicated integrated circuit. Of course, the processor and the readable storage medium can also exist in a device as discrete components.
[0154] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0155] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0156] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0157] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0158] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0159] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. An order declaration method, characterized in that: include: Get the transaction attributes of the newly added order; Based on the transaction attributes of the newly added order, determining a target gateway sequence from multiple gateway sequences; Determine the first gateway in the target gateway sequence whose occupation state is unoccupied as the available gateway for the newly added order, and change the occupation state of the available gateway to occupied; When the operating state of the available gateway is normal, the newly added order is cached in the cache queue of the transaction channel corresponding to the available gateway, so that the orders therein are declared according to the order in the cache queue.
2. The method according to claim 1, characterized in that Based on the transaction attribute of the newly added order, a target gateway sequence is determined from a plurality of gateway sequences, including: Obtaining transaction attributes corresponding to each of the gateway sequences; A gateway sequence whose corresponding transaction attributes are consistent with the transaction attributes of the newly added order is determined as the target gateway sequence.
3. The method according to claim 2, characterized in that The method further comprises: If there is no gateway sequence whose corresponding transaction attribute is consistent with the transaction attribute of the newly added order, determining multiple candidate gateways from multiple gateways based on the transaction attribute of the newly added order; The multiple candidate gateways are sorted according to the time consumption of the transaction channels corresponding to the multiple candidate gateways to obtain the target gateway sequence, and the transaction attributes corresponding to the target gateway sequence are determined as the transaction attributes of the newly added order.
4. The method according to claim 3, characterized in that The method further comprises: If the number of candidate gateways is 0, the newly added order is cached in the abnormal order queue and an abnormal prompt is given.
5. The method according to claim 1, characterized in that The method further comprises: If the occupancy status of each gateway in the target gateway sequence is occupied, the occupancy status of each gateway in the target gateway sequence is modified to unoccupied, so as to re-traverse the gateways in the target gateway sequence to obtain the available gateways for the newly added order.
6. The method according to claim 1, characterized in that The newly added order is an order at the head of a queue of pending orders, and the method further includes: If the target gateway does not have a corresponding transaction channel or the operating status of the available gateway is abnormal, the newly added order is placed at the end of the queue of pending orders.
7. An order reporting device, characterized in that: include: The transaction attribute acquisition module is used to obtain the transaction attributes of the newly added order; A target gateway sequence determination module, configured to determine a target gateway sequence from a plurality of gateway sequences based on the transaction attributes of the newly added order; An available gateway determination module, configured to determine the first gateway in the target gateway sequence whose occupation state is unoccupied as the available gateway for the newly added order, and to modify the occupation state of the available gateway to occupied; The transaction channel determination module is used to cache the newly added order in the cache queue of the transaction channel corresponding to the available gateway when the operating status of the available gateway is normal, so as to declare the order therein according to the order in the cache queue.
8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.