CN117909033A - Resource processing method, device, equipment and medium - Google Patents

Resource processing method, device, equipment and medium Download PDF

Info

Publication number
CN117909033A
CN117909033A CN202211263523.6A CN202211263523A CN117909033A CN 117909033 A CN117909033 A CN 117909033A CN 202211263523 A CN202211263523 A CN 202211263523A CN 117909033 A CN117909033 A CN 117909033A
Authority
CN
China
Prior art keywords
transaction
resource
conversion ratio
reserved
reservation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211263523.6A
Other languages
Chinese (zh)
Inventor
邹文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202211263523.6A priority Critical patent/CN117909033A/en
Publication of CN117909033A publication Critical patent/CN117909033A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the application discloses a resource processing method, a device, equipment and a medium, wherein the method comprises the following steps: acquiring a plurality of reservation transaction orders, wherein the reservation transaction orders comprise transaction resource pairs and reservation resource conversion ratios corresponding to the transaction resource pairs; writing the conversion ratio of the reserved resources in each reserved transaction list into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction list, wherein different transaction resource pairs correspond to different transaction commission accounts books; acquiring a conversion ratio update message carrying an updated resource conversion ratio and a target transaction resource pair corresponding to the updated resource conversion ratio; searching a target transaction commission account corresponding to the target transaction resource pair, and processing a reservation transaction order corresponding to the target transaction commission account according to the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission account. The technical scheme of the embodiment of the application can reduce the consumption of memory resources and computing resources.

Description

Resource processing method, device, equipment and medium
Technical Field
The present application relates to the field of computer technology, and in particular, to a resource processing method, a resource processing device, an electronic apparatus, and a computer readable storage medium.
Background
At present, aiming at the requirements of object reservation transaction, related institutions collect all reservation transaction orders and store the reservation transaction orders in a database in sequence according to time sequence, and then query the quotation of a current conversion ratio provider, and further determine the processing mode of each reservation transaction order according to the quotation of each reservation transaction order and the conversion ratio provider, but as the number of objects of reservation transaction increases, the corresponding reservation transaction orders also increase, and a large amount of memory resources and calculation resources are required to be consumed.
Disclosure of Invention
To solve the above technical problems, embodiments of the present application provide a resource processing method, a resource processing device, an electronic device, a computer readable storage medium, and a computer program product, which can reduce consumption of memory resources and computing resources.
Other features and advantages of the application will be apparent from the following detailed description, or may be learned by the practice of the application.
According to an aspect of an embodiment of the present application, there is provided a resource processing method, including: acquiring a plurality of reservation transaction orders, wherein the reservation transaction orders comprise transaction resource pairs and reservation resource conversion ratios corresponding to the transaction resource pairs, and the transaction resource pairs comprise resources to be converted and converted resources; writing the conversion ratio of the reserved resources in each reserved transaction list into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction list, wherein different transaction resource pairs correspond to different transaction commission account books; obtaining a conversion ratio update message, wherein the conversion ratio update message carries an updated resource conversion ratio and a target transaction resource pair corresponding to the updated resource conversion ratio; searching a target transaction commission account corresponding to the target transaction resource pair, and processing a reservation transaction order corresponding to the target transaction commission account according to the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission account.
According to an aspect of an embodiment of the present application, there is provided a resource processing apparatus including: the acquisition module is used for acquiring a plurality of reservation transaction orders, wherein the reservation transaction orders comprise transaction resource pairs and reservation resource conversion ratios corresponding to the transaction resource pairs, and the transaction resource pairs comprise resources to be converted and converted resources; the writing module is used for writing the conversion ratio of the reserved resources in each reserved transaction list into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction list, wherein different transaction resource pairs correspond to different transaction commission account books; the acquisition module is further configured to acquire a conversion ratio update message, where the conversion ratio update message carries an updated resource conversion ratio and a target transaction resource pair corresponding to the updated resource conversion ratio; the processing module is used for searching a target transaction commission account book corresponding to the target transaction resource pair, and processing a reserved transaction order corresponding to the target transaction commission account book according to the updated resource conversion ratio and the reserved resource conversion ratio in the target transaction commission account book.
In an embodiment of the present application, the reservation transaction list further includes a transaction list number, and the writing module is further configured to write, if a transaction resource pair in the reservation transaction list includes a target transaction queue in a transaction commission book corresponding to the transaction resource pair, the reservation list number of the reservation transaction list into the target transaction queue, where the target transaction queue is a transaction queue having an association relationship with a reservation resource conversion ratio in the reservation transaction list.
In an embodiment of the present application, the writing module is further configured to sort reserved resource conversion ratios in the reserved transaction order and reserved resource conversion ratios associated with other transaction queues in the transaction order book if the corresponding transaction order book does not include the target transaction queue in the transaction order book by using the transaction resources in the reserved transaction order book, and newly build the target transaction queue in the transaction order book according to the sorting result of the reserved resource conversion ratios; and writing the reservation list number of the reservation list into the target transaction queue.
In an embodiment of the present application, the reservation transaction list further includes a transaction list number; the device also comprises a construction module for constructing a transaction commission account book corresponding to each supported transaction resource; the writing module is further configured to, if the supported transaction resource pair includes a transaction resource pair in the reserved transaction order, newly build a transaction queue in a transaction commission account book corresponding to the transaction resource pair in the reserved transaction order; writing the reservation list number of the reservation list into a newly built transaction queue, and associating the newly built transaction queue with the reservation resource conversion ratio in the reservation list.
In an embodiment of the present application, the obtaining module is further configured to subscribe to a resource conversion ratio update event of a conversion ratio provider, so as to receive the conversion ratio update message pushed by the conversion ratio provider at the time of resource conversion ratio update.
In an embodiment of the present application, the obtaining module is further configured to obtain a query frequency corresponding to each transaction resource pair; and inquiring the conversion rate updating message of each transaction resource pair from a conversion rate provider according to the inquiry frequency respectively corresponding to each transaction resource pair.
In an embodiment of the present application, the processing module is further configured to extract a maximum reserved resource conversion ratio in the target transaction delegated ledger; comparing the updated resource conversion ratio to the maximum reserved resource conversion ratio; if the maximum reserved resource conversion ratio is not lower than the updated resource conversion ratio, a reserved transaction list corresponding to the maximum reserved resource conversion ratio is submitted; deleting the maximum reserved resource conversion ratio from the target transaction commission account book, and continuing to execute the step of extracting the maximum reserved resource conversion ratio in the target transaction commission account book.
In an embodiment of the present application, the reservation transaction list further includes a reservation time; the processing module is further configured to sort the plurality of reservation transaction orders according to reservation times of the plurality of reservation transaction orders in the target transaction commission account book if the number of reservation transaction orders corresponding to the maximum reservation resource conversion ratio is a plurality of; and sequentially trading the reservation transaction orders according to the sequencing result of the reservation transaction orders.
In an embodiment of the present application, the processing module is further configured to stop comparing the updated resource conversion ratio with the reserved resource conversion ratio of the target transaction order book if the maximum reserved resource conversion ratio is lower than the updated resource conversion ratio; and re-acquiring the updated resource conversion ratio of the target transaction resource pair, and if the re-acquired updated resource conversion ratio is greater than the updated resource conversion ratio acquired last time, executing the step of comparing the re-acquired updated resource conversion ratio with the maximum reserved resource conversion ratio.
In an embodiment of the present application, the reservation transaction list further includes a transaction direction of the transaction resource pair; the writing module is further used for selecting the corresponding transaction commission account book according to the transaction resource pairs in the reserved transaction list; and determining a transaction consignment account book with the same transaction direction as the transaction resource pair from the selected transaction consignment account books, and writing the conversion ratio of the reserved resources in the reserved transaction order into the transaction consignment account book with the same transaction direction.
In an embodiment of the present application, the reservation transaction list further includes a transaction amount of the transaction resource pair; the writing module is further configured to write, if the transaction amount of the transaction resource pair in the reserved transaction list is lower than the preset transaction amount corresponding to the transaction resource pair, the reserved resource conversion ratio in the reserved transaction list into the corresponding transaction commission account book according to the transaction resource pair in the reserved transaction list.
In an embodiment of the present application, the device further includes a deletion module, where the deletion module is configured to obtain a writing time of writing the reserved resource conversion ratio in the reserved transaction order into the corresponding transaction commission account book; and if the reserved transaction list is not completed within the preset time from the writing time, deleting the reserved resource conversion ratio in the reserved transaction list from the transaction commission account book written in by the reserved transaction list.
According to an aspect of an embodiment of the present application, there is provided an electronic device including one or more processors; and storage means for storing one or more computer programs which, when executed by the one or more processors, cause the electronic device to implement the resource processing method as described above.
According to an aspect of an embodiment of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor of an electronic device, causes the electronic device to perform a resource processing method as described above.
According to an aspect of an embodiment of the present application, there is provided a computer program product including a computer program stored in a computer-readable storage medium, from which a processor of an electronic device reads and executes the computer program, causing the electronic device to execute the resource processing method as described above.
In the technical scheme provided by the embodiment of the application, different transaction commission accounts are distinguished by transaction resource pairs, and then the reservation resource conversion ratio in each reservation transaction list is written into the corresponding transaction commission account book through the transaction resource pairs in each reservation transaction list, after the updated resource conversion ratio is acquired, only the target transaction commission account book corresponding to the target transaction resource pairs of the updated resource conversion ratio is triggered, and the corresponding reservation transaction list is processed through the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission account book. On the other hand, the total related operation based on the reservation transaction list is converted into the related operation based on the resource conversion ratio, so that the calculated amount is greatly reduced; in yet another aspect, as the number of reservation transaction orders increases, only relevant operations of the target transaction commission account corresponding to the updated resource conversion ratio are triggered, reducing consumption of computing resources.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is evident that the drawings in the following description are only some embodiments of the present application and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
FIG. 1 is an implementation environment in which the present application is directed;
FIG. 2 is a flow chart of a method of resource processing, shown in an exemplary embodiment of the application;
FIG. 3 is a flow chart of another resource processing method shown in an exemplary embodiment of the application;
FIG. 4 is a flow chart of another resource processing method shown in an exemplary embodiment of the application;
FIG. 5 is a flow chart of another resource processing method shown in an exemplary embodiment of the application;
FIG. 6 is a flow chart of another resource processing method shown in an exemplary embodiment of the application;
FIG. 7 is a flowchart illustrating another resource processing method according to an exemplary embodiment of the present application;
FIG. 8 is a flow chart of another resource processing method shown in an exemplary embodiment of the application;
FIG. 9 is a flowchart illustrating another resource processing method according to an exemplary embodiment of the present application;
FIG. 10 is a flow chart of another resource processing method shown in an exemplary embodiment of the application;
FIG. 11 is a flowchart illustrating another resource processing method according to an exemplary embodiment of the present application;
FIG. 12 is a flow chart of a method of resource processing, shown in another exemplary embodiment of the application;
FIG. 13 is a flowchart illustrating another resource processing method according to an exemplary embodiment of the present application;
FIG. 14 is a schematic diagram of a transaction proxy ledger subscription event shown in an exemplary embodiment of the application;
FIG. 15 is a schematic diagram of a transaction proxy ledger shown in accordance with an exemplary embodiment of the application;
FIG. 16 is a schematic diagram of another transaction proxy ledger shown in another exemplary embodiment of the application;
FIG. 17 is a schematic diagram of another transaction proxy ledger shown in another exemplary embodiment of the application;
FIG. 18 is a schematic diagram of another transaction proxy ledger shown in another exemplary embodiment of the application;
FIG. 19 is a schematic diagram of another transaction proxy ledger shown in another exemplary embodiment of the application;
FIG. 20 is a diagram illustrating the acquisition of updated resource transformation ratios in accordance with another exemplary embodiment of the present application;
FIG. 21 is a schematic diagram of another transaction proxy ledger shown in accordance with another exemplary embodiment of the application;
FIG. 22 is a flow chart illustrating a resource conversion ratio comparison in accordance with another exemplary embodiment of the present application;
FIG. 23 is a block diagram of a resource processing device according to an exemplary embodiment of the present application;
Fig. 24 shows a schematic diagram of a computer system suitable for use in implementing an embodiment of the application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
Also to be described is: in the present application, the term "plurality" means two or more. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., a and/or B may represent: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The reservation transaction orders of the object are collected and stored for the reservation transaction requirements of the object, and the reservation transaction orders mainly comprise reservation resource conversion ratios, transaction amounts, other information and the like. The third party mechanism sequentially stores all reservation transaction orders in a database according to time sequence, sets a certain polling frequency for background timing tasks, enables the background timing tasks to inquire all reservation transaction orders according to the frequency, inquires the quotation of the resource conversion ratio of the current mechanism platform, and sequentially determines the processing mode of each reservation transaction order according to the quotation of each reservation transaction order and the quotation of the conversion ratio provider.
However, at present, the whole amount of reservation transaction list data needs to be queried according to the frequency, and when the number of objects of reservation transaction is increased and the number of reservation transaction lists is increased, the whole amount of data is huge, and a large amount of memory resources and computing resources are consumed. The quotation of the resource conversion ratio at the moment is required to be inquired while the full reservation trade order is inquired, so that the whole calculation load is continuously increased.
In an embodiment of the present application, a resource processing method is provided, which uses construction of a transaction commission book to fill each reservation transaction order, and converts total comparison work of the reservation transaction order into pure resource conversion ratio comparison work, and only triggers one transaction commission book comparison operation for each resource conversion ratio update, thereby greatly reducing consumption of computing resources.
Referring to fig. 1, fig. 1 is a schematic diagram of an implementation environment according to the present application. The implementation environment includes a terminal device 110, a server 120, and a conversion ratio provider 130. The terminal device 110 and the server 120 communicate with each other through a wired or wireless network, and the server 120 and the conversion ratio provider 130 communicate with each other through a wired or wireless network.
The terminal device 110 may include, but is not limited to, a smart phone, tablet, notebook, computer, intelligent voice interaction device, intelligent home appliance, a terminal for use on a vehicle, an aircraft, and the like.
The server 120 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, cdns (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and intelligent platforms, which are not limited herein.
The conversion ratio provider 130 is a mechanism, such as a financial institution, that provides resource conversion ratio updates.
It should be noted that the numbers of the terminal devices 110, the servers 120, and the conversion ratio providers 130 in fig. 1 are merely illustrative, and any number of the terminal devices 110, the servers 120, and the conversion ratio providers 130 may be provided according to actual needs.
In an exemplary embodiment, the terminal device 110 is configured to run a reservation transaction service on the client side, and further, the object places an order through the reservation transaction service to generate a reservation transaction order, where the reservation transaction order includes a transaction resource pair and a reservation resource conversion ratio corresponding to the transaction resource pair, and the transaction resource pair includes a resource to be converted and a converted resource.
Server 120 may obtain a plurality of reservation transaction orders through a plurality of terminal devices 110, and write a conversion ratio of reservation resources in each reservation transaction order into a corresponding transaction commission account book according to a transaction resource pair in each reservation transaction order, where different transaction resource pairs correspond to different transaction commission accounts; and acquiring a conversion ratio update message, wherein the conversion ratio update message carries an updated resource conversion ratio and a target transaction resource pair corresponding to the updated resource conversion ratio, searching a target transaction commission account corresponding to the target transaction resource pair, and processing a reservation transaction order corresponding to the target transaction commission account according to the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission account.
In an exemplary embodiment, the server 120 may also obtain a plurality of reservation transaction orders by itself, for example, a reservation transaction service of a service side is run on the server, and further may obtain a reservation transaction order of each object.
In another exemplary embodiment, the conversion ratio provider 130 may have a similar function to the server 120, thereby performing the resource processing method provided by the embodiment of the present application. Illustratively, the conversion ratio provider 130 obtains a plurality of reservation transaction orders in the plurality of terminal devices 110 through the server 120, writes the reservation resource conversion ratio in each reservation transaction order into a corresponding transaction commission account book according to the transaction resource pair in each reservation transaction order, searches a target transaction commission account book corresponding to the target transaction resource pair after obtaining the updated resource conversion ratio and the target transaction resource pair corresponding to the updated resource conversion ratio, and processes the reservation transaction order corresponding to the target transaction commission account book according to the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission account book.
It should be noted that, in the specific embodiment of the present application, if the related data in the reservation transaction list relates to the object, when the embodiment of the present application is applied to the specific product or technology, the permission or consent of the object needs to be obtained, and the collection, use and processing of the related data need to comply with the related regulations and standards of the related country and region.
Various implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
as shown in fig. 2, fig. 2 is a flowchart of a resource processing method according to an embodiment of the present application, which may be applied to the implementation environment shown in fig. 1, and which may be performed by a server or a conversion ratio provider, or may be performed by a terminal, a server, and a conversion ratio provider together, and in an embodiment of the present application, the resource processing method may include steps S210 to S240, which are described in detail below:
s210, acquiring a plurality of reservation transaction orders, wherein the reservation transaction orders comprise transaction resource pairs and reservation resource conversion ratios corresponding to the transaction resource pairs, and the transaction resource pairs comprise resources to be converted and converted resources.
In the embodiment of the application, the reservation transaction refers to preset transaction triggering conditions, and when the conditions are met, a consignment transaction mode is generated according to the set transaction content, and the reservation transaction list is a certificate of the reservation transaction.
The reserved transaction list comprises a transaction resource pair, wherein the transaction resource pair is set transaction content, the transaction resource pair comprises a resource to be converted and a converted resource, namely the transaction content is the resource which is converted from the resource to be converted, namely the transaction resource pair A-B, and the transaction resource pair A-B indicates that the resource A is required to be converted into the resource B; in some scenarios, the a resource is a product for commodity exchange in one country and the B resource is a product for commodity exchange in another country.
The reservation transaction list also comprises a conversion ratio of transaction resources to corresponding reservation resources, wherein the conversion ratio of the reservation resources is a preset transaction triggering condition; the reserved resource conversion ratio is used for determining how many parts of B resources can be converted from one part of A resources to be converted when the resources are converted.
It will be appreciated that the conversion ratio of reserved resources may vary from one transaction resource pair to another, e.g., the conversion ratio of reserved resources for transaction resource pair A-B to transaction resource pair C-D may vary. In the embodiment of the present application, the conversion ratio of reserved resources may change with time, for example, the conversion ratio of reserved transaction resources at time t1 and time t2 may be different or the same for the transaction resource pair a-B.
In the embodiment of the application, the reserved transaction list can further comprise at least one of a transaction list number, reserved time, transaction party information, transaction directions of the transaction resource pairs, transaction amounts of the transaction resource pairs and transaction places. The transaction list number is used for uniquely identifying the reservation transaction list; the reservation time is the time for generating the reservation transaction list; the transaction party information comprises transaction initiator information and transaction income party information, wherein the transaction initiator information refers to information of a party initiating the reservation transaction bill and comprises identity information, contact information and the like of the initiator; the profit party information refers to information of a party of the resource after profit conversion, including identity information, contact information, etc. of the initiator. The transaction directions of the transaction resource pair comprise buying the transaction resource pair and selling the transaction resource pair, wherein the transaction resource pair A-B and the transaction resource pair B-A are two different transaction directions; the transaction amount of a transaction resource pair refers to the number of transaction resource pairs that need to be transacted; the place of transaction represents where the reservation transaction order occurs.
In an example of an embodiment of the present application, acquiring the plurality of reservation transaction sheets may be generated based on transaction contents and transaction triggering conditions respectively input by the plurality of objects. For example, a display interface is provided, the transaction content control and the transaction triggering condition control are displayed on the display interface, and then the object inputs corresponding information through the corresponding control.
In another example of an embodiment of the present application, acquiring a plurality of reservation transaction sheets may also receive reservation transaction sheets transmitted through a plurality of terminal devices.
Of course, the acquisition of the plurality of reservation transaction orders may be real-time acquisition or may be timed acquisition, and is not limited herein.
S220, writing the conversion ratio of the reserved resources in each reserved transaction list into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction list, wherein different transaction resource pairs correspond to different transaction commission account books.
In the embodiment of the application, a transaction commission book (order book) is used for recording all reservation transaction orders in one exchange, and transaction resource pairs are taken as distinguishing dimensions, different transaction resource pairs correspond to different transaction commission books, for example, transaction commission book 1 corresponding to transaction resource pair A-B and transaction commission book 2 corresponding to transaction resource pair C-D.
It should be noted that, in an example, the transaction resource pairs corresponding to different transaction directions may distinguish different transaction commission books again according to the different transaction directions. In another example, the transaction resource pairs corresponding to different transaction directions may also be areas that divide the different transaction directions in the same transaction proxy ledger.
In the embodiment of the application, because each reserved transaction order comprises the transaction resource pair, the transaction commission account corresponding to the transaction resource pair can be searched according to the transaction resource pair in the reserved transaction order, and then the reserved resource conversion ratio in the reserved transaction order is written into the corresponding transaction commission account. For example, the transaction resource pair a-B is included in the reservation transaction order a, and the conversion ratio of the reservation resource in the reservation transaction order a is written into the transaction commission account book 1.
S230, acquiring a conversion ratio update message, wherein the conversion ratio update message carries an updated resource conversion ratio and a target transaction resource pair corresponding to the updated resource conversion ratio.
In the embodiment of the application, the conversion rate update message is used for indicating that the resource conversion rate of a certain transaction resource pair is updated; for example, the conversion ratio update message carries an updated resource conversion ratio x1, and the updated resource conversion ratio x1 corresponds to the target transaction resource pair a-B. Wherein the updated resource conversion ratio refers to the updated resource conversion ratio given by the authority, for example, at the last time (t 1), the resource conversion ratio of the target transaction resource to the a-B is x2, and at the current time (t 2), the resource conversion ratio of the target transaction resource to the a-B is x1, which indicates that the resource conversion ratio is updated.
It will be appreciated that since there are a plurality of transaction resource pairs, it is known that the resource conversion ratio is updated and then what transaction resource pair the updated resource conversion ratio corresponds to is found. At the same time, multiple transaction resource pairs may be updated at the same time, and the conversion ratio update message carries multiple updated resource conversion ratios and multiple target transaction resource pairs corresponding to the multiple updated resource conversion ratios respectively.
In an example, the get conversion ratio update message may be passive, i.e., the conversion ratio update message is actively sent by the conversion ratio provider; the acquisition of the conversion ratio update message may also be an active acquisition, with the server actively requesting the conversion ratio update message from the conversion ratio provider, without limitation.
S240, searching a target transaction commission account corresponding to the target transaction resource pair, and processing a reservation transaction order corresponding to the target transaction commission account according to the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission account.
In the embodiment of the application, after the resource conversion ratio of the target transaction pair is updated, the target transaction commission account corresponding to the target transaction resource pair is searched from all transaction commission accounts. As described above, since the reservation resource conversion ratio in the reservation transaction order is written in the corresponding transaction commission book, the reservation transaction order corresponding to the target transaction commission book can be processed, including the reservation transaction order corresponding to the target transaction commission book, with or without the transaction, based on the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission book.
It will be appreciated that the target transaction proxy account book may not have a reserved resource conversion ratio and no processing is required.
In an example, the corresponding reservation transaction order may be processed according to the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction order book, and whether to deal with the corresponding reservation transaction order may be selected according to a comparison of the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction order book.
It should be noted that, in the process of acquiring the conversion rate update message and searching the target transaction commission account book, steps S210 and S220 may still be executed, so the reserved conversion rates in the target transaction commission account book are all reserved conversion rates before the time when the target transaction commission account book is found.
In the technical scheme provided by the embodiment of the application, different transaction commission accounts are distinguished by transaction resource pairs, and then the conversion ratio of the reserved resources in each reserved transaction list is written into the corresponding transaction commission account book through the transaction resource pairs in each reserved transaction list, so that each reserved transaction list is convenient to manage and the consumption of memory resources is reduced; after the updated resource conversion ratio is obtained, only the target transaction commission book corresponding to the target transaction resource pair of the updated resource conversion ratio is triggered, and the corresponding reservation transaction list is processed through the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission book, so that compared with the scheme of the related technology, on one hand, the total related operation based on the reservation transaction list is converted into the related operation based on the resource conversion ratio, and the calculated amount is greatly reduced; on the other hand, as the number of reservation transaction orders increases, only the related operation of the target transaction commission account corresponding to the updated resource conversion ratio is triggered, so that the consumption of computing resources is reduced.
In one embodiment of the present application, another resource processing method is provided, which may be applied to the implementation environment shown in fig. 1, and the method may be performed by a server or a conversion ratio provider, or may be performed jointly by a terminal, a server and a conversion ratio provider, and in the embodiment of the present application, the method is described by the server being performed, and as shown in fig. 3, the resource processing method extends S220 shown in fig. 2 to step S310 on the basis of the embodiment shown in fig. 2, where the reservation transaction list in S210 uniquely corresponds to a transaction list number.
Step S310 is described in detail as follows:
S310, if the transaction resource pair in the reserved transaction list comprises a target transaction queue, writing the reserved list number of the reserved transaction list into the target transaction queue, wherein the target transaction queue is a transaction queue with an association relation with the reserved resource conversion ratio in the reserved transaction list.
First, a transaction queue is set in the transaction commission book, and different transaction queues are associated with different reserved resource conversion ratios, for example, transaction queue 1 is associated with reserved resource conversion ratio x1, and transaction queue 2 is associated with reserved resource conversion ratio x 2.
In an example, the queue identification of the transaction queue may be a corresponding reservation resource conversion ratio, such as the queue identification of transaction queue 1 being a reservation resource conversion ratio x1, to facilitate rapid differentiation between different transaction queues and rapid writing of reservation sheet numbers into corresponding transaction queues.
Therefore, after the reservation transaction order is acquired, whether the transaction commission account book corresponding to the transaction resources in the reservation transaction order contains the target transaction queue is first searched, if the reservation transaction order a comprises the transaction resource pair A-B and the reservation resource conversion ratio x1, whether the transaction commission account book 1 corresponding to the transaction resource pair A-B of the reservation transaction order a comprises the target transaction queue 1 associated with the reservation resource conversion ratio x1 is judged. If the transaction commission account book 1 includes the target transaction queue 1, the reservation transaction order number of the reservation transaction order a is written into the target transaction queue 1.
It will be appreciated that, since the reservation transaction order number may uniquely identify the reservation transaction order, writing the reservation transaction order number to the target transaction queue is equivalent to writing the reservation resource conversion ratio contained in the reservation transaction order to the target transaction queue.
In an example, the reservation bill number of the reservation bill is written into the target transaction queue, the reservation bill number of the reservation bill can be directly written into the tail of the queue, and the reservation bill number can also be written into the corresponding place in the queue according to the reservation time of the reservation bill.
It should be noted that, for other detailed descriptions of steps S210, S230 to S240 shown in fig. 3, please refer to steps S210, S230 to S240 shown in fig. 2, and the detailed descriptions are omitted here.
According to the embodiment of the application, aiming at the reserved transaction list comprising the same transaction resource pair, when the transaction commission book is written, the same reserved resource conversion ratio is associated with the same transaction queue, and further the reserved list number of the corresponding reserved transaction list is written into the same transaction queue, so that the different transaction queues can be distinguished conveniently, each reserved transaction list can be managed conveniently and clearly, and the memory resource is reduced.
In the embodiment of the present application, the method is executed by the server, and as shown in fig. 4, the method further extends S220 in fig. 3 to S410 to S420. Wherein steps S410 to S420 are described in detail as follows:
S410, if the transaction resources in the reservation transaction list do not contain the target transaction queues in the corresponding transaction commission account book, the reservation resource conversion rate in the reservation transaction list and the reservation resource conversion rates related to other transaction queues in the transaction commission account book are ordered, and the target transaction queues are newly built in the transaction commission account book according to the ordering result of the reservation resource conversion rates.
In the embodiment of the application, the transaction commission book corresponding to the transaction resource in the reservation transaction list may not contain the target transaction queue, but the transaction commission book comprises other transaction queues, and the other transaction queues are associated with other reservation resource conversion ratios. In the above example, the transaction commission account book 1 corresponding to the transaction resource pair a-B does not include the target transaction queue 1, but includes the transaction queue 2 associated with the reserved resource conversion ratio x2, the transaction queue 3 associated with the reserved resource conversion ratio x3, and the transaction queue 2 and the transaction queue 3 are other transaction queues.
Because the transaction commission book does not contain the target transaction queue, the target transaction queue needs to be newly built in the transaction commission book, and the spatial distribution of the newly built target transaction queue needs to be determined according to the reservation resource conversion ratio in the reservation transaction list and the sequencing results of the reservation resource conversion ratios associated with other transaction queues in the transaction commission book. In the above example, for example, if the reserved resource conversion ratio x1 in the reserved transaction order a is greater than the reserved resource conversion ratio x2 and the reserved resource conversion ratio x3, the target transaction queue 1 is newly built before the transaction queues 2 and 3; if the reserved resource conversion ratio x1 is larger than the reserved resource conversion ratio x2 and smaller than the reserved resource conversion ratio x3, creating a target transaction queue 1 between the transaction queue 2 and the transaction queue 3; if the reserved resource conversion ratio x1 is smaller than the reserved resource conversion ratio x2 and the reserved resource conversion ratio x3, the target transaction queue 1 is newly built after the transaction queues 2 and 3. That is, the transaction queues in the transaction proxy account book are ordered according to the size of each reserved resource conversion ratio.
In other embodiments of the present application, if the transaction resource in the reservation transaction order does not include the target transaction queue in the corresponding transaction commission account book, the target transaction queue may be first created in the transaction commission account book, then the reservation resource conversion ratio in the reservation transaction order and the reservation resource conversion ratio associated with other transaction queues in the transaction commission account book are ordered, and the spatial distribution of the target transaction queue and the other transaction queues is adjusted according to the ordering result.
S420, writing the reservation list number of the reservation list into the target transaction queue.
After the target transaction queue is newly established, the target transaction queue is empty at this time, and the corresponding reservation transaction list can be directly written into the target transaction queue.
It should be noted that, for the detailed description of steps S210, S310, S230 to S240 shown in fig. 4, please refer to steps S210, S310, S230 to S240 shown in fig. 3, and the detailed description is omitted here.
In the embodiment of the application, different reservation resource conversion ratios are associated with different transaction queues when writing a transaction commission account book aiming at reservation transaction orders containing the same transaction resource pairs, so that the reservation resource conversion ratios in the reservation transaction orders and reservation resource conversion ratios associated with other transaction queues in the transaction commission account book are ordered, and a target transaction queue is newly built in the transaction commission account book according to the ordering result of the reservation resource conversion ratios, so that all the transaction queues of the transaction commission account book are ordered.
In the embodiment of the present application, the execution of the method by the server is described, as shown in fig. 5, and the resource processing method is added with step S510 before step S220, where step S220 is extended to steps S520 to S530, where the reservation transaction list in S510 uniquely corresponds to the transaction list number.
The steps S510 to S530 are described in detail as follows:
s510, constructing a transaction commission account corresponding to each supported transaction resource.
In the embodiment of the application, the transaction resource pairs supported by different servers may be different, and the transaction resource pairs supported by the same server at different times may also be different, so that corresponding transaction commission accounts are respectively built in advance based on the transaction resources currently supported by the servers, and one transaction resource pair corresponds to one transaction commission account.
S520, if the supported transaction resource pairs comprise transaction resource pairs in the reserved transaction list, a transaction queue is newly built in a transaction commission account book corresponding to the transaction resource pairs in the reserved transaction list.
It can be appreciated that the constructed transaction proxy account book is empty, i.e. does not contain any data; at this time, after the reservation transaction order is acquired, the transaction resource pairs currently supported by the server include transaction resource pairs in the reservation transaction order, which means that the server has a corresponding transaction commission book to record the preset transaction order; however, since the corresponding transaction ledger is empty, it is necessary to newly create a transaction queue in the corresponding transaction ledger.
In other embodiments of the present application, if the supported transaction resource pairs do not include the transaction resource pairs in the reservation transaction order, then a transaction commission account corresponding to the transaction resource pairs in the reservation transaction order may be constructed, and then a transaction queue may be newly created.
S530, writing the reservation list number of the reservation list into the newly built transaction queue, and associating the newly built transaction queue with the reservation resource conversion ratio in the reservation list.
After a transaction queue is newly established in the corresponding transaction commission account book, the transaction commission account book has only one transaction queue at present, so that the reservation list number of the reservation transaction list can be directly written into the newly established transaction queue.
After the reservation list number is written into the newly-built transaction queue, only the reservation list is in the transaction queue, and at the moment, the newly-built transaction queue and the reservation resource conversion ratio of the reservation list can be associated so as to facilitate the subsequent distinction of other transaction queues.
It should be noted that, for other detailed descriptions of steps S210, S230 to S240 shown in fig. 5, please refer to steps S210, S230 to S240 shown in fig. 2, and the detailed descriptions are omitted here.
According to the embodiment of the application, the transaction queues associated with the reserved resource conversion ratio are newly built when the supported transaction resources are respectively built and the transaction commission account is written for the first time, and then the reserved transaction list numbers of the reserved transaction list are written into the newly built transaction queues, so that the writing of the reserved transaction list is orderly carried out.
In the embodiment of the present application, the execution of the method by the server is described, as shown in fig. 6, and the resource processing method is extended to step S610 on the basis of the embodiment shown in fig. 2, where the resource processing method may be applied to the implementation environment shown in fig. 1, and the method may be executed by the server or the conversion ratio provider, or may be executed by the terminal, the server, and the conversion ratio provider together.
Step S610 is described in detail as follows:
S610, subscribing to a resource conversion ratio update event of the conversion ratio provider to receive a conversion ratio update message pushed by the conversion ratio provider when the resource conversion ratio is updated.
In an embodiment of the present application, the conversion ratio provider object is provided by a financial information exchange protocol (FIX, FINANCIAL INFORMATION EXCHANGE #) Protocol), the conversion rate update message is actively pushed continuously, and higher frequency and time are actively pushed relative to the mode of inquiring to the conversion rate provider.
The conversion ratio provider may provide the proactive push service to a specific service object, that is, an object subscribed to the conversion ratio provider for resource conversion ratio update, and thus, needs to subscribe to the conversion ratio provider for resource conversion ratio update event.
In one example, when subscribing to resource conversion ratio update events, only supported transaction resources may be subscribed to corresponding resource conversion ratios, e.g., server supported transaction resource pairs A-B, C-D and E-F, and then only official resource conversion ratio update events for transaction resource pairs A-B, C-D and E-F.
In another example, when subscribing to resource conversion ratio update events, resource conversion ratio update events for all official resource conversion ratio updates that can be provided by the conversion ratio provider may also be subscribed to.
It should be noted that there may be one or more conversion ratio providers; in one example, if there are multiple conversion ratio providers, the server may subscribe to a resource conversion ratio update event of one target conversion ratio provider, and upon failure of the target conversion ratio provider, subscribe to resource conversion ratio update events of the conversion ratio provider from other conversion ratio providers.
In another example, if there are multiple conversion ratio providers, the server may subscribe to resource conversion ratio update events for portions of the transaction resource pairs with each conversion ratio provider; each conversion ratio provider may also be subscribed to resource conversion ratio update events for all transaction resource pairs, not limited herein.
It should be noted that, for other detailed descriptions of steps S210 to S220 and S240 shown in fig. 6, please refer to steps S210 to S220 and S240 shown in fig. 2, and the detailed descriptions are omitted here.
According to the embodiment of the application, the conversion rate update event of the conversion rate provider is subscribed to receive the conversion rate update message actively pushed by the conversion rate provider when the conversion rate is updated, compared with the mode of inquiring the conversion rate provider, the active pushing is more high-frequency and timely, and the trigger mechanism for processing the reservation transaction list is changed from the mode of setting the polling frequency to the mode of active pushing, so that the work for processing the reservation transaction list is triggered by the change of the conversion rate of the resource, the transaction of the reservation transaction list is more instant, and the invalid processing work is greatly reduced.
In the embodiment of the present application, the execution of the method by the server is described, as shown in fig. 7, and the resource processing method is extended to steps S710 to S720 on the basis of the implementation environment shown in fig. 2, where the resource processing method can be applied to the implementation environment shown in fig. 1, and the method can be executed by the server or the conversion ratio provider, or can be executed by the terminal, the server and the conversion ratio provider together.
Steps S710 to S720 are described in detail as follows:
S710, acquiring query frequencies corresponding to each transaction resource pair respectively.
In the embodiment of the application, different transaction resource pairs have different liveness, the transaction resource pair with higher liveness changes faster the corresponding resource conversion ratio, and if the liveness of the transaction resource pair is lower, the corresponding resource conversion ratio change can only happen for a few minutes; therefore, it is necessary to acquire the query frequency corresponding to each transaction resource pair, and query the corresponding conversion ratio update message according to the query frequency.
In an example, each transaction resource may be preset for a corresponding query frequency, which may be flexibly adjusted according to actual requirements.
In an example, the corresponding query frequency for each transaction resource pair may also be determined based on the liveness of each transaction resource pair before the current time, the higher the liveness before the current time, the higher the query frequency. The activity level before the current time can be determined according to the change frequency of the corresponding resource conversion ratio of the transaction resource in a preset time period before the current time.
S720, inquiring the conversion rate update message of each transaction resource pair from the conversion rate provider according to the inquiry frequency corresponding to each transaction resource pair.
After the query frequency corresponding to each transaction resource pair is obtained, the query frequency de-conversion ratio provider queries whether the corresponding resource conversion ratio of the transaction resource pair is updated or not, and if so, a conversion ratio update message is generated. For example, the query frequency of transaction resources to a-B is 1 second, the conversion ratio provider is queried for conversion ratio update messages of transaction resources to a-B every 1 second; the transaction resource to C-D query frequency is 1 minute, and then the conversion ratio provider is queried for conversion ratio update messages of the transaction resource to C-D every 1 minute.
It should be noted that, in the embodiment of the present application, when the server is initialized, the conversion ratio provider may be queried for the conversion ratio update message of each transaction resource pair at the same time for the first time, and then query is performed according to the query frequency corresponding to each transaction resource pair.
In the embodiment of the present application, before executing steps S710 to S720, it may be determined whether there is a conversion ratio provider of the active push update service, and if there is no conversion ratio provider of the active push update service, then S710 to S720 are executed.
It should be noted that, for other detailed descriptions of steps S210 to S220 and S240 shown in fig. 7, please refer to steps S210 to S220 and S240 shown in fig. 2, and the detailed descriptions are omitted here.
According to the embodiment of the application, the conversion rate update message of each transaction resource pair is queried from the conversion rate provider through the query frequency corresponding to each transaction resource pair, so that the query mode is more reasonable and the resource waste is reduced compared with the unified query frequency.
In the embodiment of the present application, the execution of the method by the server is described, as shown in fig. 8, and the resource processing method is extended to steps S810 to S850 on the basis of the implementation environment shown in fig. 2, where the resource processing method can be applied to the implementation environment shown in fig. 1, and the method can be executed by the server or the conversion ratio provider, or can be executed by the terminal, the server and the conversion ratio provider together.
S810, searching a target transaction commission account book corresponding to the target transaction resource pair.
The process of searching the target transaction commission account book is shown in fig. 2, and is not described in detail herein.
S820, extracting the maximum reserved resource conversion ratio in the target transaction commission account book.
As described above, since the reservation resource conversion ratio in the reservation transaction order is written into the corresponding transaction commission account after the reservation transaction order is acquired, when the target transaction commission account is found, it is determined that the target transaction commission account is not empty, and the maximum reservation resource conversion ratio is extracted from all the reservation resource conversion ratios of the target transaction commission account.
S830, the updated resource conversion ratio is compared with the maximum reserved resource conversion ratio.
And S840, if the maximum reservation resource conversion ratio is not lower than the updated resource conversion ratio, the reservation transaction list corresponding to the maximum reservation resource conversion ratio is submitted.
It can be understood that the transaction of the reservation transaction list is determined according to the comparison of the resource conversion ratio, the maximum reservation resource conversion ratio is directly compared with the updated resource conversion ratio, and if the reservation transaction list corresponding to the maximum reservation resource conversion ratio is not met, other reservation resource conversion ratios are not required to be compared.
And if the maximum reservation resource conversion ratio is higher than or equal to the updated resource conversion ratio, the reservation transaction list corresponding to the transaction is made if the transaction triggering condition is met, wherein the reservation transaction list corresponding to the transaction refers to the transaction content in the successful transaction reservation transaction list.
S850, deleting the maximum reserved resource conversion ratio from the target transaction commission account book, and continuously executing the step of extracting the maximum reserved resource conversion ratio in the target transaction commission account book.
In the embodiment of the application, after the reservation transaction list corresponding to the maximum reservation resource conversion ratio is processed, the maximum reservation resource conversion ratio needs to be deleted from the target transaction commission account book so as to avoid repeated transaction reservation transaction lists. After deleting the maximum reserved resource conversion ratio, a new maximum reserved resource conversion ratio may exist in the target transaction commission, and S820 may be continued to be executed, the new maximum resource conversion ratio may be extracted from the target transaction commission, and S830 to S850 may be further continued to be executed until the maximum reserved resource conversion ratio is lower than the updated resource conversion ratio.
It will be appreciated that in executing steps S810-S820, the target transaction resource may be updated continuously with respect to the corresponding resource conversion ratio, and then, at the time of comparison, the last updated resource conversion ratio needs to be compared with the maximum preset conversion ratio in the target transaction ledger.
It should be noted that, for other detailed descriptions of steps S210 to S230 shown in fig. 8, please refer to steps S210 to S230 shown in fig. 2, and the detailed descriptions are omitted herein.
According to the embodiment of the application, the maximum reservation resource conversion ratio of the target transaction commission account book is extracted, and then the maximum reservation resource conversion ratio is compared with the updated reservation resource conversion ratio, so that whether the corresponding reservation transaction list is made or not is determined, and further the reservation transaction list is made in sequence, so that the making of the reservation transaction list is not repeated, and the method is more effective and quicker.
In the embodiment of the present application, the execution of the method by the server is described, as shown in fig. 9, and the resource processing method is extended to steps S910 to S920 on the basis of the embodiment shown in fig. 8, where the resource processing method can be applied to the implementation environment shown in fig. 1, and the method can be executed by the server or the conversion ratio provider, or can be executed by the terminal, the server, and the conversion ratio provider together. Wherein the reservation transaction list in S210 further includes a reservation time to characterize a generation time of each reservation transaction list.
Steps S910 to S920 are described in detail as follows:
S910, if the maximum reservation resource conversion ratio is not lower than the updated resource conversion ratio and the number of reservation transaction orders corresponding to the maximum reservation resource conversion ratio is a plurality of, ordering the reservation transaction orders according to the reservation time of the reservation transaction orders in the target transaction commission account book.
In the embodiment of the application, when a plurality of reservation transaction orders exist and all comprise the same maximum reservation resource conversion ratio, namely the number of the reservation transaction orders corresponding to the maximum reservation resource conversion ratio is a plurality of reservation transaction orders, in order to ensure the fairness of the transaction, the transaction is carried out successively according to time.
In the target transaction commission account book, the reservation transaction orders are ordered according to the reservation time of the reservation transaction orders, and the earlier the reservation time is, the earlier the ordering of the corresponding reservation transaction orders is.
S920, sequentially trading the reservation transaction orders according to the sorting result of the reservation transaction orders.
In the embodiment of the application, according to the sorting results of the reservation transaction orders, the reservation transaction orders corresponding to the sequential transactions from the first sorting are sequentially ordered, namely, the earlier the reservation transaction order is ordered, the earlier the transaction is made.
In an example, if the reservation time of at least two reservation transaction orders in the plurality of reservation transaction orders is the same, the at least two reservation transaction orders are ordered in parallel when the reservation transaction orders are ordered, at this time, when the reservation transaction orders are to be made, the order of making the at least two reservation transaction orders can be determined according to the sequence of the writing time of the reservation transaction orders in the writing target transaction ledger, and the earlier the writing time is, the earlier the corresponding reservation transaction orders are made.
It should be noted that, for the detailed description of steps S210 to S230, S810 to S830, and S850 shown in fig. 9, please refer to steps S210 to S230, S810 to S830, and S850 shown in fig. 8, and the detailed description thereof is omitted here.
In the embodiment of the application, when the number of the reserved transaction orders corresponding to the maximum reserved resource conversion ratio is a plurality of, the reserved transaction orders are sequentially submitted according to the reserved time of each reserved transaction order, so that fair submitted of the reserved transaction orders is ensured.
It should be noted that, in the embodiment of the present application, another resource processing method is provided, which may be applied to the implementation environment shown in fig. 1, and the method may be performed by a server or a conversion ratio provider, or may be performed jointly by a terminal, a server, and a conversion ratio provider, and in the embodiment of the present application, the method is described by performing the method by the server, as shown in fig. 10, and steps S1010 to S1020 are added after S830 to the resource processing method is shown in fig. 8. The steps S1010 to S1020 are described in detail as follows:
s1010, if the maximum reserved resource conversion ratio is lower than the updated resource conversion ratio, stopping comparing the updated resource conversion ratio with the reserved resource conversion ratio of the target transaction commission account book.
As described above, after comparing the updated resource conversion ratio with the maximum reserved resource conversion ratio, if the maximum reserved resource conversion ratio is lower than the updated resource conversion ratio, it means that no reservation transaction order in the target transaction order book satisfies the updated resource conversion ratio, and the comparison is terminated, that is, the comparison of the updated resource conversion ratio with other reservation resource conversion ratios in the target transaction order book is not required.
S1020, re-acquiring the updated resource conversion ratio of the target transaction resource pair, and if the re-acquired updated resource conversion ratio is greater than the last acquired updated resource conversion ratio, executing the step of comparing the re-acquired updated resource conversion ratio with the maximum reserved resource conversion ratio.
Because the current updated resource conversion ratio does not satisfy the transaction triggering condition of the reservation transaction order in the target transaction ledger, S230 needs to be continuously executed, and the updated resource conversion ratio of the target transaction resource pair is re-acquired to re-determine whether the transaction triggering condition is satisfied.
In the embodiment of the present application, before whether the transaction triggering condition is satisfied is determined again, it may be determined whether the re-acquired updated resource conversion ratio is greater than the updated resource conversion ratio acquired last time, for example, the updated resource conversion ratio at time t1 (last time) is x3, the updated resource conversion ratio at time t2 (current time) is x4, and if x4 is less than x3, the re-acquired updated resource conversion ratio does not satisfy the transaction triggering condition, and at this time, the step of comparing is not required.
If the re-acquired updated resource conversion ratio is greater than the last acquired updated resource conversion ratio, it may be further determined whether the re-acquired resource conversion ratio is lower than the current maximum reserved resource conversion ratio in the target transaction commission book, and further determine whether to make a corresponding reserved transaction order.
It should be noted that, for the detailed description of steps S210 to S230 and S810 to S850 shown in fig. 10, please refer to steps S210 to S230 and S810 to S850 shown in fig. 8, and the detailed description is omitted here.
In the embodiment of the application, when the maximum reserved resource conversion ratio is lower than the updated reserved resource conversion ratio, the comparison is terminated, and the invalid comparison is avoided by the newly acquired updated reserved resource conversion ratio and the updated reserved resource conversion ratio acquired last time, so that the number of times of invalid comparison (no reserved transaction list is completed after comparison) is at most 1, and the calculation resources are further reduced.
It should be noted that, in the embodiment of the present application, another resource processing method is provided, which may be applied to the implementation environment shown in fig. 1, and the method may be performed by a server or a conversion ratio provider, or may be performed jointly by a terminal, a server, and a conversion ratio provider, and in the embodiment of the present application, the method is described by performing the method by the server, as shown in fig. 11, and the resource processing method is extended to steps S1110 to S1120 in S220 on the basis of the implementation environment shown in fig. 2. The reservation transaction order further comprises a transaction direction of the transaction resource pair.
The steps S1110 to S1120 are described in detail as follows:
s1110, selecting a corresponding transaction commission account book according to the transaction resource pairs in the reserved transaction list.
As described above, different transaction resource pairs correspond to different transaction commission books, and in the embodiment of the present application, the transaction commission books further distinguish between different transaction directions, that is, different transaction directions also correspond to different transaction commission books. Firstly, based on the corresponding relation between transaction resource pairs and transaction commission accounts, selecting transaction commission accounts of all reservation transaction orders, wherein the selected transaction commission accounts comprise two transaction commission accounts of two transaction directions.
S1120, determining a transaction consignment account book with the same transaction direction as the transaction resource pair from the selected transaction consignment account books, and writing the conversion ratio of the reserved resources in the reserved transaction order into the transaction consignment account book with the same transaction direction.
In the embodiment of the application, the transaction consignment account book with the same transaction direction as the transaction resource pair is selected again from the two transaction consignment account books with the two selected transaction directions, and then the conversion ratio of the reservation resource in the reservation transaction order is written into the transaction consignment account book with the same transaction direction.
It should be noted that, for the detailed description of steps S210, S230 to S240 shown in fig. 11, please refer to steps S210, S230 to S240 shown in fig. 2, and the detailed description is omitted here.
When the transaction order is differentiated from the transaction direction, the transaction commission account book also distinguishes the transaction direction, and further when the transaction commission account book is written in, the transaction commission account book corresponding to the transaction resource pair is determined, and when the transaction commission account book identical to the transaction direction of the reservation transaction order is determined, the management of the reservation transaction order is more orderly and clear.
It should be noted that, in the embodiment of the present application, another resource processing method is provided, which may be applied to the implementation environment shown in fig. 1, and the method may be performed by a server or a conversion ratio provider, or may be performed jointly by a terminal, a server, and a conversion ratio provider, and in the embodiment of the present application, the method is described by performing the method by the server, as shown in fig. 12, and the resource processing method is extended to step S1210 in S220 on the basis of the embodiment shown in fig. 2. The reservation transaction list in S210 further includes a transaction amount of the transaction resource pair, which is used to characterize the number of the transaction resource pairs that need to be transacted.
Step S1210 is described in detail as follows:
S1210, if the transaction amount of the transaction resource pair in the reservation transaction order is lower than the preset transaction amount corresponding to the transaction resource pair, writing the conversion ratio of the reservation resource in the reservation transaction order into the corresponding transaction commission account book according to the transaction resource pair in the reservation transaction order.
In the embodiment of the application, the preset transaction amount corresponding to the supported transaction resource pairs is set in the server, and the reserved transaction amount is used for representing the number of the transaction resource pairs which can be transacted maximally. If the transaction amount of the transaction resource pair in the reserved transaction list is higher than the reserved transaction list corresponding to the transaction resource pair, the reserved transaction list is an excessive transaction list, and the server is invalid to deal with the reserved transaction list.
If the transaction amount of the transaction resource pair in the reservation transaction list is lower than the reservation transaction list corresponding to the transaction resource pair, writing the reservation resource conversion ratio in the reservation transaction list into the transaction commission account book according to the transaction resource pair in the reservation transaction list.
It can be understood that when the conversion ratio of the reserved resources in the reserved transaction list is written into the transaction commission account book, the transaction amount of the transaction resource pair can be written into the transaction commission account book, so that the amount of the transaction left by the server can be known when the reserved transaction list is submitted each time. For example, the reserved transaction amount of the transaction resource pair A-B is 10000 parts, a reserved transaction list is completed, 2000 parts of the transaction amount of the transaction resource pair in the reserved transaction list is reserved, and 8000 parts of the transaction resource pair A-B can be completed by the server.
It should be noted that, for the detailed description of steps S210, S230 to S240 shown in fig. 12, please refer to steps S210, S230 to S240 shown in fig. 2, and the detailed description is omitted here.
In the embodiment of the application, when the corresponding transaction commission account book is written, whether the transaction commission account book is written is determined by comparing the transaction amount of the transaction resource pair in the reserved transaction list with the corresponding preset transaction amount of the transaction resource pair, so that the situation that the transaction amount exceeding the reserved transaction amount cannot be met is avoided, and the memory resource is further reduced.
It should be noted that, in the embodiment of the present application, another resource processing method is provided, which may be applied to the implementation environment shown in fig. 1, and the method may be performed by a server or a conversion ratio provider, or may be performed jointly by a terminal, a server, and a conversion ratio provider, and in the embodiment of the present application, the method is described as being performed by the server, and steps S1310 to S1320 are added after S220 on the basis of the implementation environment shown in fig. 2 to 12. As shown in fig. 13, steps S1310 to S1320 are added to fig. 2.
Step S1310 is described in detail as follows:
S1310, acquiring writing time of writing the reserved resource conversion ratio in the reserved transaction list into the corresponding transaction commission account book.
In the embodiment of the application, when the conversion ratio of the reserved resources in the reserved transaction list is written into the corresponding transaction commission account book, the writing time of the transaction commission account book is required to be recorded, and the writing time of each reserved transaction list can be further acquired.
S1320, if the reservation transaction list is not completed within the preset time from the writing time, deleting the reservation resource conversion rate in the reservation transaction list from the transaction commission account book written in the reservation transaction list.
In the embodiment of the application, in order to avoid the long-term storage of invalid reservation transaction orders, the transaction commission account book is cleaned regularly. If the reservation transaction order is not completed within the reservation time from the writing time, the reservation transaction order is likely to be an invalid transaction order, the reservation resource conversion ratio in the reservation transaction order needs to be deleted from the transaction commission account written in the reservation transaction order, and if other information is written in the transaction commission account in addition to the reservation resource conversion ratio of the reservation transaction order, the other information is synchronously deleted so that the transaction commission account does not have the reservation transaction order.
The preset time can be flexibly adjusted according to actual conditions, if the preset time is 1 month, for example, the writing time of the reserved transaction list b is 2022, 9 months and 22 days, the reserved transaction list b is still not completed from 9 months and 22 days to 10 months and 22 days, and the reserved resource conversion rate of the reserved transaction list b is removed from the corresponding transaction commission account book.
It should be noted that, for the detailed description of steps S210 to S240 shown in fig. 13, please refer to steps S210 to S240 shown in fig. 2, and the detailed description is omitted here.
In the embodiment of the application, the writing time of the written transaction commission account book corresponding to the reserved transaction list is acquired, so that the reserved transaction list which is not yet met in the preset time is reserved from the writing time, the written transaction commission account book is removed, invalid data long-term storage is avoided, and memory resources are further reduced.
In order to facilitate understanding, the resource processing method provided by the embodiment of the present application is described below, where the resource processing method includes: 1. pre-constructing a transaction commission account book of all transaction resource pairs needing to be supported. 2. Each transaction commission book subscribes to the corresponding update message to the resource conversion ratio message event bus according to the transaction resources supported by the transaction commission book. 3. All reservation money transfer sheets of the object are recorded, the record contains information such as transaction resource pairs, amounts, reservation resource conversion ratios and the like, and a unique reservation transaction sheet number ID is generated. 4. The reservation transaction order routes the information to the corresponding transaction commission account book according to the transaction resource pair. 5. The transaction commission account book is updated according to the reserved resource conversion ratio and the processing methods of the three resource conversion ratio. 6. When the conversion ratio provider has the resource conversion ratio update, pushing a resource conversion ratio update message to the resource conversion ratio message event bus. 7. After receiving the resource conversion ratio price update message, the corresponding transaction commission account book performs comparison work of the latest resource conversion ratio price and the internal reservation resource conversion ratio. 8. Thus, the whole transaction flow based on the reservation transaction order is completed.
The detailed description is as follows:
As shown in fig. 14, a transaction commission account of all transaction resource pairs to be supported by the server itself is first pre-constructed, the transaction commission account is distinguished by the transaction resource pairs as dimensions, and a resource conversion ratio update event of the corresponding transaction resource pairs is subscribed to with the conversion ratio provider.
When the reservation object makes a reservation transaction order, recording a transaction resource pair, a transaction amount and a reservation resource conversion ratio of the reservation transaction order, taking an A resource conversion B resource as an example, and ordering information is as follows: A-B (transaction resource pair), reserved buying transaction amount Buy_ amout _id1 and reserved resource conversion proportion bid_price_1, recording the reserved transaction list as order_id1, and routing the reserved transaction list into a transaction consignment account book A-B according to the transaction resource pair at the moment, so that the transaction consignment account book A-B is shown in fig. 15 at present.
In fig. 15, bid_price_1 is a queue, and all reservation transaction List numbers with the conversion ratio of reservation resources being bid_price_1 are recorded in the queue, and the queue list_bid_price_1 only contains one List as order_id1.
Then, if there is a new reserved transaction order_id2 for converting the a resource into the B resource, the reserved transaction amount buy_ amout _id2 of the reserved transaction order and the reserved resource conversion ratio bid_price_2 are correspondingly processed according to the size relationship between bid_price_2 and bid_price_1, wherein the size relationship between bid_price_2 and bid_price_1 has three cases, bid_price_2< bid_price_1, bid_price_2> bid_price_1, bid_price_2=bid_price_1, which can be respectively described.
Case one, bid_price_2< bid_price_1:
As shown in fig. 16, a new record bid_price_2 is inserted under bid_price_1 in the transaction commission account book a-B, bid_price_2 is also a queue, and the queue converts all reservation transaction order numbers with the recording reservation resource conversion ratio bid_price_2, and at this time, the queue list_bid_price_2 only contains one order as order_id2.
Case two, bid_price_2> bid_price_1:
As shown in fig. 17, a new record bid_price_2 is inserted above bid_price_2 in the transaction commission account book a-B, bid_price_2 is also a queue, and the queue converts all reservation transaction order numbers with the recording reservation resource conversion ratio bid_price_2, and at this time, the queue list_bid_price_2 only contains one order as order_id2.
Case three, bid_price_2=bid_price_1:
As shown in fig. 18, no new record is required to be inserted into the transaction commission book a-B, at this moment, the queue list_bid_price_1 is found, and a new reservation transaction order_id2 is added at the end of the queue, so that list_bid_price_1 currently contains two reservation transaction orders.
According to the processing modes of the three situations, all reservation transaction orders can be loaded into corresponding transaction commission account books according to rules.
In some example embodiments, the reservation transaction order is recorded as order_id1, and if there are other reservation transaction orders, as order_id2, order_id3. Constructing a transaction commission account book A-B of the transaction resource pair A-B; ordering the reserved resource conversion ratio of the reserved transaction list of the same transaction resource pair and recording the ordered resource conversion ratio to the same transaction commission account book; if the order resource conversion ratios of order_id1, order_id2, and order_id3 are ordered to be bid_price_1> bid_price_2> bid_price_3, the transaction commission account book a-B is formed as shown in fig. 19. Namely, different transaction resource pairs are distinguished, the transaction commission book of all reservation transaction orders of the same type of transaction resource pairs is constructed according to reservation resource conversion rate sequencing, and then the event is updated according to the resource conversion rate of the same type of transaction resource pairs corresponding to the transaction commission book transaction resource pair type subscription conversion rate provider.
Resource conversion ratio update events due to having subscribed to corresponding transaction resource pairs; as shown in FIG. 20, when there is an update to A-B for a transaction resource in the conversion rate provider, the conversion rate provider pushes the updated resource conversion rate for A-B for the transaction resource to the conversion rate message event bus via an update message, and since transaction ledger A-B has subscribed to the updated update message for the conversion rate for A-B for the transaction resource, this update is received, and thus the updated resource conversion rate price_A-B_current for the current transaction resource to A-B is obtained.
When the server obtains the latest price_a-b_current, the stored reservation resource conversion ratios in the transaction commission account book a-B are sequentially taken out from top to bottom and compared with the price_a-b_current, and as shown in fig. 21, it is assumed that three reservation resource conversion ratios and a plurality of reservation transaction orders exist in the existing transaction commission account book a-B.
The reservation resource conversion ratio of transaction commission ledger a-B and the updated resource conversion ratio price_a-b_current comparison procedure are shown in fig. 22. Firstly, when receiving the updated resource conversion ratio price_a-b_current, firstly judging whether the corresponding transaction Order Book a-B is empty, if the transaction Order Book is not empty, namely, the data is stored therein, extracting the maximum reserved resource conversion ratio bid_price_1 and the updated resource conversion ratio price_a-b_current for comparison, then if the maximum reserved resource conversion ratio bid_price_1 is larger than the updated resource conversion ratio price_a-b_current, all reserved transaction sheets in the queues corresponding to bid_price_1 need to be submitted to form order_id1 and order_id2, clearing the bid_price_1 queue from the transaction Order Book a-B, and then continuously executing the steps of judging whether the order_book is empty or not, and sequentially cycling until the maximum reserved resource conversion ratio bid_1 is smaller than the updated resource conversion ratio price_a-b_current.
Through the above flow, transaction commission book A-B completes the comparison work of the updated resource conversion ratio, wherein the reservation transaction order meeting the condition of the updated resource conversion ratio also completes the transaction. Similarly, other transaction commission books are processed according to the steps.
When the transaction commission account book is constructed, the same transaction resource pair can distinguish the buying and selling directions of the transaction resource pair, namely, the transaction commission account book is constructed according to buying and selling, and when the conversion ratio provider subscribes to the updating event of the resource conversion ratio updating, the updating event of the buying resource conversion ratio and the selling resource conversion ratio updating is distinguished. After the transaction commission account book is constructed, when the reservation transaction list of the reservation transaction list is written into the corresponding queue, the transaction amount of each reservation transaction list can be added so as to avoid invalid transaction of excessive list.
For the conversion ratio provider, the provider of other institutions can be replaced, so that the problem that one conversion ratio provider fails and the transaction cannot be processed is avoided; if the conversion ratio provider for actively pushing the resource conversion ratio update is not available, the conversion ratio provider can be replaced by setting the query frequency according to different transaction resource pairs, and the queried resource conversion ratio is sent to the resource conversion ratio message event bus.
For the transaction of the reservation transaction list, the same virtual resource can be collected at the same time; and for the reservation transaction list which does not meet the transaction triggering condition, if the reservation transaction list exceeds a certain time range, the transaction commission account book can be removed.
In the embodiment of the application, a specific example is used for comparing and describing the related technology with the resource processing method provided by the application.
Assuming that there are 10000 reserved trade orders of different trade resource pairs according to the related technical scheme, the trade resource pairs supported by the server are n (n is a positive integer), and the set polling time interval is every minute, then every minute needs to query the latest resource conversion ratio of n trade resource pairs, and then the resource conversion ratio of 10000 orders is compared with the latest resource conversion ratio queried back 10000 times.
If the frequency is increased according to the related technical scheme, the polling time interval is set to be every second, and then the resource conversion ratio is required to be queried 60 x n times per minute, and the price comparison is performed 60 x 10000 times per minute. As the number of reserved transaction singular numbers and the number and frequency of supported transaction resources are increased, the number of times of conversion ratio of the query resources and the number of times of comparison ratio of the resource conversion are increased linearly.
According to the technical scheme provided by the application, 10000 orders are filled into n transaction commission books corresponding to n transaction resource pairs, only one transaction commission book comparison operation is triggered for each resource conversion ratio update, and the number of ineffective comparison (no reservation transaction order transaction after comparison) is at most 1. With the increase of the number of reserved transaction singular and supported resource transaction, the number of times of comparison of the resource conversion ratio is unchanged, the number of times of the resource conversion ratio is only in a 1:1 relation with the update frequency of the resource conversion ratio of the conversion ratio provider, so that the computing resource is greatly reduced, and the invalid comparison work is greatly reduced.
An embodiment of the apparatus of the present application is described herein, which may be used to perform the resource processing method in the above embodiment of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the resource processing method described above.
The embodiment of the application provides a resource processing device, as shown in fig. 23, which can be deployed in a server and in a conversion ratio provider, and comprises:
an obtaining module 2310, configured to obtain a plurality of reservation transaction orders, where the reservation transaction orders include a transaction resource pair and a reservation resource conversion ratio corresponding to the transaction resource pair, and the transaction resource pair includes a resource to be converted and a converted resource;
writing module 2320, configured to write, according to the transaction resource pairs in each reservation transaction order, the reservation resource conversion ratio in each reservation transaction order into a corresponding transaction commission account book, where different transaction resource pairs correspond to different transaction commission account books;
The obtaining module 2310 is further configured to obtain a conversion rate update message, where the conversion rate update message carries an updated resource conversion rate and a target transaction resource pair corresponding to the updated resource conversion rate;
And the processing module 2330 is used for searching a target transaction commission account book corresponding to the target transaction resource pair and processing a reservation transaction order corresponding to the target transaction commission account book according to the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission account book.
In one embodiment of the present application, based on the foregoing solution, the reservation transaction list further includes a transaction list number, and the writing module 2320 is further configured to write, if the transaction resource pair in the reservation transaction list includes a target transaction queue in the transaction commission book corresponding to the transaction resource pair, the reservation list number of the reservation transaction list into the target transaction queue, where the target transaction queue is a transaction queue having an association relationship with a conversion ratio of the reservation resource in the reservation transaction list.
In one embodiment of the present application, based on the foregoing solution, the writing module 2320 is further configured to, if the transaction resource pair in the reserved transaction order does not include the target transaction queue in the corresponding transaction commission account book, sort the reserved resource conversion ratio in the reserved transaction order and the reserved resource conversion ratios associated with other transaction queues in the transaction commission account book, and newly build the target transaction queue in the transaction commission account book according to the sorting result of the reserved resource conversion ratios; and writing the reservation list number of the reservation list into the target transaction queue.
In one embodiment of the present application, based on the foregoing scheme, the reservation transaction list further includes a transaction list number; the device also comprises a construction module for constructing a transaction commission account book corresponding to each supported transaction resource; at this time, the writing module 2320 is further configured to, if the supported transaction resource pairs include transaction resource pairs in the reserved transaction order, newly build a transaction queue in a transaction commission account book corresponding to the transaction resource pairs in the reserved transaction order; writing the reservation list number of the reservation list into a newly built transaction queue, and associating the newly built transaction queue with the reservation resource conversion ratio in the reservation list.
In one embodiment of the present application, based on the foregoing, the acquisition module 2310 is further configured to subscribe to a resource conversion ratio update event of the conversion ratio provider to receive a conversion ratio update message pushed by the conversion ratio provider at the time of resource conversion ratio update.
In one embodiment of the present application, based on the foregoing scheme, the obtaining module 2310 is further configured to obtain a query frequency corresponding to each transaction resource pair; and inquiring the conversion rate updating message of each transaction resource pair from the conversion rate provider according to the inquiry frequency corresponding to each transaction resource pair.
In one embodiment of the present application, based on the foregoing, processing module 2330 is further to extract a maximum reserved resource conversion ratio in the target transaction proxy account book; comparing the updated resource conversion ratio with the maximum reserved resource conversion ratio; if the maximum reservation resource conversion ratio is not lower than the updated resource conversion ratio, the reservation transaction list corresponding to the maximum reservation resource conversion ratio is submitted; deleting the maximum reserved resource conversion ratio from the target transaction commission account book, and continuing to execute the step of extracting the maximum reserved resource conversion ratio in the target transaction commission account book.
In one embodiment of the present application, based on the foregoing scheme, the reservation transaction list further includes a reservation time; the processing module 2330 is further configured to sort the plurality of reservation transaction orders according to reservation times of the plurality of reservation transaction orders in the target transaction commission account book if the number of reservation transaction orders corresponding to the maximum reservation resource conversion ratio is a plurality of; and sequentially trading the reservation transaction orders according to the sequencing result of the reservation transaction orders.
In one embodiment of the present application, based on the foregoing, processing module 2330 is further configured to stop comparing the updated resource conversion ratio to the reserved resource conversion ratio of the target transaction order ledger if the maximum reserved resource conversion ratio is less than the updated resource conversion ratio; and re-acquiring the updated resource conversion ratio of the target transaction resource pair, and if the re-acquired updated resource conversion ratio is greater than the last acquired updated resource conversion ratio, executing the step of comparing the re-acquired updated resource conversion ratio with the maximum reserved resource conversion ratio.
In one embodiment of the present application, based on the foregoing scheme, the reservation transaction list further includes a transaction direction of the transaction resource pair; write-in module 2320 is further configured to select a corresponding transaction commission account book according to the transaction resource pair in the reservation transaction ticket; and determining a transaction consignment account book which is the same as the transaction direction of the transaction resource pair from the selected transaction consignment account books, and writing the reservation resource conversion ratio in the reservation transaction order into the transaction consignment account book which is the same as the transaction direction.
In one embodiment of the present application, based on the foregoing, the reservation transaction list further includes a transaction amount of the transaction resource pair; the writing module 2320 is further configured to write, if the transaction amount of the transaction resource pair in the reserved transaction order is lower than the preset transaction amount corresponding to the transaction resource pair, the conversion ratio of the reserved resource in the reserved transaction order into the corresponding transaction commission account book according to the transaction resource pair in the reserved transaction order.
In one embodiment of the present application, based on the foregoing solution, the apparatus further includes a deletion module, where the deletion module is configured to obtain a writing time of writing the reserved resource conversion ratio in the reserved transaction order into the corresponding transaction commission account book; if the reservation transaction list is not completed within the preset time from the writing time, deleting the reservation resource conversion ratio in the reservation transaction list from the transaction commission account book written in the reservation transaction list.
It should be noted that, the apparatus provided in the foregoing embodiments and the method provided in the foregoing embodiments belong to the same concept, and the specific manner in which each module and unit perform the operation has been described in detail in the method embodiments, which is not repeated herein.
The embodiment of the application also provides an electronic device, which comprises one or more processors, and a storage device, wherein the storage device is used for storing one or more computer programs, and when the one or more computer programs are executed by the one or more processors, the electronic device is enabled to realize the resource processing method.
Fig. 24 shows a schematic diagram of a computer system suitable for use in implementing an embodiment of the application.
It should be noted that, the computer system 2400 of the electronic device shown in fig. 24 is only an example, and should not impose any limitation on the functions and the application scope of the embodiment of the present application, where the electronic device may be a terminal or a server.
As shown in fig. 24, the computer system 2400 includes a processor (Central Processing Unit, CPU) 2401, which can perform various appropriate actions and processes, such as performing the methods in the above-described embodiments, according to a program stored in a read-only memory (ROM) 2402 or a program loaded from a storage portion 2408 into a random access memory (Random Access Memory, RAM) 2403. In the RAM 2403, various programs and data required for system operation are also stored. The CPU 2401, ROM 2402, and RAM 2403 are connected to each other through a bus 2404. An Input/Output (I/O) interface 2405 is also connected to bus 2404.
In some embodiments, the following components are connected to I/O interface 2405: an input portion 2406 including a keyboard, a mouse, and the like; an output portion 2407 including a Cathode Ray Tube (CRT), a Liquid crystal display (Liquid CRYSTAL DISPLAY, LCD), and a speaker, etc.; a storage portion 2408 including a hard disk or the like; and a communication section 2409 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 2409 performs communication processing via a network such as the internet. The drive 2410 is also connected to the I/O interface 2405 as needed. A removable medium 2411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 2410 as needed, so that a computer program read out therefrom is installed into the storage section 2408 as needed.
In particular, according to embodiments of the present application, the process described above with reference to the flowcharts may be implemented as a computer program. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 2409, and/or installed from the removable medium 2411. When executed by a processor (CPU) 2401, performs various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (Erasable Programmable Read Only Memory), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with a computer-readable computer program embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer programs.
The units or modules involved in the embodiments of the present application may be implemented in software, or may be implemented in hardware, and the described units or modules may also be disposed in a processor. Where the names of the units or modules do not in some way constitute a limitation of the units or modules themselves.
Another aspect of the application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment or may exist alone without being incorporated in the electronic device.
Another aspect of the present application also provides a computer program product comprising a computer program stored in a computer readable storage medium. The processor of the electronic device reads the computer program from the computer readable storage medium and executes the computer program to cause the electronic device to perform the methods provided in the various embodiments described above.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
The foregoing is merely illustrative of the preferred embodiments of the present application and is not intended to limit the embodiments of the present application, and those skilled in the art can easily make corresponding variations or modifications according to the main concept and spirit of the present application, so that the protection scope of the present application shall be defined by the claims.

Claims (16)

1. A method of resource processing, comprising:
Acquiring a plurality of reservation transaction orders, wherein the reservation transaction orders comprise transaction resource pairs and reservation resource conversion ratios corresponding to the transaction resource pairs, and the transaction resource pairs comprise resources to be converted and converted resources;
Writing the conversion ratio of the reserved resources in each reserved transaction list into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction list, wherein different transaction resource pairs correspond to different transaction commission account books;
obtaining a conversion ratio update message, wherein the conversion ratio update message carries an updated resource conversion ratio and a target transaction resource pair corresponding to the updated resource conversion ratio;
Searching a target transaction commission account corresponding to the target transaction resource pair, and processing a reservation transaction order corresponding to the target transaction commission account according to the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction commission account.
2. The method of claim 1, wherein the reservation transaction order further comprises a transaction order number; writing the conversion ratio of the reserved resources in each reserved transaction order into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction order, wherein the method comprises the following steps:
And if the transaction resource pair in the reserved transaction list comprises a target transaction queue, writing the reserved transaction list number of the reserved transaction list into the target transaction queue, wherein the target transaction queue is a transaction queue with an association relation with the reserved resource conversion ratio in the reserved transaction list.
3. The method of claim 2, wherein writing the conversion ratio of the reserved resources in each reserved transaction order to the corresponding transaction commission account book according to the pair of reserved resources in each reserved transaction order, further comprises:
If the transaction resources in the reserved transaction list do not contain the target transaction queues in the corresponding transaction commission account book, sorting the reserved resource conversion ratio in the reserved transaction list and reserved resource conversion ratios associated with other transaction queues in the transaction commission account book, and newly building the target transaction queues in the transaction commission account book according to sorting results of the reserved resource conversion ratios;
and writing the reservation list number of the reservation list into the target transaction queue.
4. The method of claim 1, wherein the reservation transaction order further comprises a transaction order number; before writing the conversion ratio of the reserved resources in each reserved transaction order into the corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction order, the method further comprises: constructing transaction commission account books corresponding to the supported transaction resources respectively;
Writing the conversion ratio of the reserved resources in each reserved transaction order into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction order, wherein the method comprises the following steps:
If the supported transaction resource pairs comprise transaction resource pairs in the reserved transaction list, a transaction queue is newly built in a transaction commission account book corresponding to the transaction resource pairs in the reserved transaction list;
Writing the reservation list number of the reservation list into a newly built transaction queue, and associating the newly built transaction queue with the reservation resource conversion ratio in the reservation list.
5. The method of claim 1, wherein the obtaining a conversion ratio update message comprises:
a resource conversion ratio update event of a conversion ratio provider is subscribed to receive the conversion ratio update message pushed by the conversion ratio provider at a resource conversion ratio update.
6. The method of claim 1, wherein the obtaining a conversion ratio update message comprises:
acquiring the query frequency corresponding to each transaction resource pair respectively;
and inquiring the conversion rate updating message of each transaction resource pair from a conversion rate provider according to the inquiry frequency respectively corresponding to each transaction resource pair.
7. The method of claim 1, wherein the processing the reservation transaction order corresponding to the target transaction order according to the updated resource conversion ratio and the reservation resource conversion ratio in the target transaction order comprises:
extracting the maximum reserved resource conversion ratio in the target transaction commission account book;
Comparing the updated resource conversion ratio to the maximum reserved resource conversion ratio;
if the maximum reserved resource conversion ratio is not lower than the updated resource conversion ratio, a reserved transaction list corresponding to the maximum reserved resource conversion ratio is submitted;
Deleting the maximum reserved resource conversion ratio from the target transaction commission account book, and continuing to execute the step of extracting the maximum reserved resource conversion ratio in the target transaction commission account book.
8. The method of claim 7, wherein the reservation transaction order further comprises a reservation time; the transaction of the reservation transaction list corresponding to the maximum reservation resource conversion ratio comprises the following steps:
If the number of the reserved transaction orders corresponding to the maximum reserved resource conversion ratio is a plurality of, sequencing the reserved transaction orders in the target transaction commission account book according to the reserved time of the reserved transaction orders;
and sequentially trading the reservation transaction orders according to the sequencing result of the reservation transaction orders.
9. The method of claim 7, wherein the method further comprises:
If the maximum reserved resource conversion ratio is lower than the updated resource conversion ratio, stopping comparing the updated resource conversion ratio with the reserved resource conversion ratio of the target transaction commission account book;
And re-acquiring the updated resource conversion ratio of the target transaction resource pair, and if the re-acquired updated resource conversion ratio is greater than the updated resource conversion ratio acquired last time, executing the step of comparing the re-acquired updated resource conversion ratio with the maximum reserved resource conversion ratio.
10. The method of claim 1, the reservation transaction order further comprising a transaction direction for the transaction resource pair; writing the conversion ratio of the reserved resources in each reserved transaction order into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction order, wherein the method comprises the following steps:
Selecting the corresponding transaction commission account book according to the transaction resource pair in the reserved transaction list;
and determining a transaction consignment account book with the same transaction direction as the transaction resource pair from the selected transaction consignment account books, and writing the conversion ratio of the reserved resources in the reserved transaction order into the transaction consignment account book with the same transaction direction.
11. The method of claim 1, the reservation transaction order further comprising a transaction amount for the transaction resource pair; writing the conversion ratio of the reserved resources in each reserved transaction order into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction order, wherein the method comprises the following steps:
if the transaction amount of the transaction resource pair in the reservation transaction list is lower than the preset transaction amount corresponding to the transaction resource pair, writing the reservation resource conversion ratio in the reservation transaction list into the corresponding transaction commission account book according to the transaction resource pair in the reservation transaction list.
12. The method of any one of claims 1 to 11, wherein after writing the reserved resource conversion ratio in each of the reserved transaction sheets to the corresponding transaction commission book according to the pair of transaction resources in each of the reserved transaction sheets, the method further comprises:
acquiring writing time of writing the reserved resource conversion ratio in the reserved transaction list into a corresponding transaction commission account book;
and if the reserved transaction list is not completed within the preset time from the writing time, deleting the reserved resource conversion ratio in the reserved transaction list from the transaction commission account book written in by the reserved transaction list.
13. A resource processing apparatus, comprising:
The acquisition module is used for acquiring a plurality of reservation transaction orders, wherein the reservation transaction orders comprise transaction resource pairs and reservation resource conversion ratios corresponding to the transaction resource pairs, and the transaction resource pairs comprise resources to be converted and converted resources;
the writing module is used for writing the conversion ratio of the reserved resources in each reserved transaction list into a corresponding transaction commission account book according to the transaction resource pairs in each reserved transaction list, wherein different transaction resource pairs correspond to different transaction commission account books;
The acquisition module is further configured to acquire a conversion ratio update message, where the conversion ratio update message carries an updated resource conversion ratio and a target transaction resource pair corresponding to the updated resource conversion ratio;
The processing module is used for searching a target transaction commission account book corresponding to the target transaction resource pair, and processing a reserved transaction order corresponding to the target transaction commission account book according to the updated resource conversion ratio and the reserved resource conversion ratio in the target transaction commission account book.
14. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs that, when executed by the one or more processors, cause the electronic device to perform the method of any of claims 1-12.
15. A computer readable storage medium, having stored thereon a computer program which, when executed by a processor of an electronic device, causes the electronic device to perform the method of any of claims 1 to 12.
16. A computer program product, characterized in that it comprises a computer program stored in a computer readable storage medium, from which a processor of an electronic device reads and executes the computer program, causing the electronic device to perform the method of any one of claims 1 to 12.
CN202211263523.6A 2022-10-10 2022-10-10 Resource processing method, device, equipment and medium Pending CN117909033A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211263523.6A CN117909033A (en) 2022-10-10 2022-10-10 Resource processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211263523.6A CN117909033A (en) 2022-10-10 2022-10-10 Resource processing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117909033A true CN117909033A (en) 2024-04-19

Family

ID=90686503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211263523.6A Pending CN117909033A (en) 2022-10-10 2022-10-10 Resource processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117909033A (en)

Similar Documents

Publication Publication Date Title
CN112132674A (en) Transaction processing method and device
CN111857888A (en) Transaction processing method and device
CN111179080B (en) Order processing method and order processing device
CN111881329A (en) Account balance management method and system
CN114997448A (en) Service processing method and device
CN112884181A (en) Quota information processing method and device
CN114445102A (en) Quotation data processing method and device
CN110602215B (en) Resource processing method based on alliance block chain and alliance block chain system
CN117909033A (en) Resource processing method, device, equipment and medium
KR20200099268A (en) Satellite data service system for sharing the data
CN112258306B (en) Account information checking method, device, electronic equipment and storage medium
CN113762819A (en) Channel scheduling method and device
CN113326095A (en) Commission data processing method and device
CN111833037A (en) Account management method and device
CN111415263A (en) Data matching method and device
CN114070847A (en) Current limiting method, device, equipment and storage medium of server
CN115134320B (en) Transaction system for determining time sequence based on message distribution
CN109741055A (en) Blacklist call method, device, server and storage medium
CN111882118B (en) Decision making system and method
CN114756556B (en) Method, device, electronic equipment and computer readable medium for processing account data
CN114529287A (en) Service processing method and device, electronic equipment and computer readable medium
CN113344706A (en) Product quota control method, device, electronic equipment and computer readable medium
CN115131140A (en) Settlement information display method, device, equipment and storage medium of information resource
CN114169997A (en) Deduction method and device
CN114706911A (en) Service processing method and device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication