Disclosure of Invention
In view of this, embodiments of the present invention provide a matching method and apparatus based on a production mode, which can at least solve the problems that the existing matching method is low in matching efficiency, and especially under the conditions of high concurrency and large data volume, the processing performance is not desirable.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a match matching method based on a production mode, including:
according to the borrowing amount of the borrowing list, the investment amount of the investment list and a grouping amount threshold value, grouping the borrowing list and the investment list respectively to obtain a borrowing list set and an investment list set;
analyzing the difference between the total amount of the borrowed money list set and the total amount of the investment list set, and determining the matching relation between the borrowed money list set and the investment list set, wherein the difference value is within a preset difference value range;
and traversing the difference value between each borrowing sheet in the borrowing sheet set and each investment sheet in the investment sheet set in the determined matching relation, and determining that the investment sheet with the minimum difference value is matched with the corresponding borrowing sheet.
Optionally, before the step of grouping the borrowing bill and the investment bill respectively according to the borrowing amount of the borrowing bill, the investment amount of the investment bill and the threshold of the grouping amount, the method further includes:
extracting all the received borrowing bills and investment bills in a preset period; and/or
And determining a receiving time stamp of the borrowing list and a receiving time stamp of the investment list, and extracting the first preset amount of the borrowing list and the second preset amount of the investment list in sequence.
Optionally, the grouping amount threshold is a predetermined grouping amount threshold or a maximum debit amount in all current debit sheets;
according to the amount of borrowing of the borrowing list, the investment amount of the investment list and the threshold value of the grouped amount of the investment list, the borrowing list and the investment list are respectively grouped, and the method comprises the following steps: according to the grouping amount threshold value, combining the borrowing units with the sum of the borrowing amounts smaller than or equal to the grouping amount threshold value into a group, and combining the investment units with the sum of the investment amounts larger than or equal to the grouping amount threshold value into a group.
Optionally, in the determined matching relationship, traversing a difference between each of the borrowed bills in the borrowed bill set and each of the investment bills in the investment bill set, and determining that the investment bill with the smallest difference is matched with the corresponding borrowed bill, further comprising:
extracting the determined and matched first investment order and first debit order, and determining a first investment amount of the first investment order and a first debit amount of the first debit order;
when the first investment amount is larger than the first borrowing amount, splitting the first investment order into a second investment order and a third investment order, and determining that the second investment order is matched with the first borrowing order; wherein the investment amount of the second investment order is equal to the first debit amount;
and when the first investment amount is smaller than the first borrowing amount and a split fourth investment order exists, if the difference between the sum of the investment amount of the fourth investment order and the first investment amount and the first borrowing amount is within a first preset difference range, determining that the first investment order and the fourth investment order are matched with the first borrowing order.
Optionally, the method further includes: counting the unprocessed amount of the borrowing list and the investment list in the current preset time, and executing the frequency reduction operation on the received amount of the borrowing list and the investment list when the unprocessed amount is larger than a preset unprocessed amount threshold value.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a match matching apparatus based on a production mode, including:
the grouping module is used for grouping the borrowing bill and the investment bill respectively according to the borrowing amount of the borrowing bill, the investment amount of the investment bill and a grouping amount threshold value to obtain a borrowing bill set and an investment bill set;
the first matching module is used for analyzing the difference between the total borrowing amount of the borrowing list set and the total investment amount of the investment list set and determining the matching relation between the borrowing list set and the investment list set, wherein the difference value is within a preset difference value range;
and the second matching module is used for traversing the difference value between each borrowing list in the borrowing list set and each investment list in the investment list set in the determined matching relation, and determining that the investment list with the minimum difference value is matched with the corresponding borrowing list.
Optionally, the apparatus further includes a receiving module, configured to:
extracting all the received borrowing bills and investment bills in a preset period; and/or
And determining a receiving time stamp of the borrowing list and a receiving time stamp of the investment list, and extracting the first preset amount of the borrowing list and the second preset amount of the investment list in sequence.
Optionally, the grouping amount threshold is a predetermined grouping amount threshold or a maximum debit amount in all current debit sheets;
the grouping module is configured to: and combining the borrowed units with the sum of borrowed money smaller than or equal to the grouping amount threshold value into a group and combining the investment units with the sum of investment money larger than or equal to the grouping amount threshold value into a group according to the grouping amount threshold value.
Optionally, the second matching module is configured to:
extracting the determined and matched first investment order and first debit order, and determining a first investment amount of the first investment order and a first debit amount of the first debit order;
when the first investment amount is larger than the first borrowing amount, splitting the first investment order into a second investment order and a third investment order, and determining that the second investment order is matched with the first borrowing order; wherein the investment amount of the second investment order is equal to the first debit amount;
and when the first investment amount is smaller than the first borrowing amount and a split fourth investment order exists, if the difference between the sum of the investment amount of the fourth investment order and the first investment amount and the first borrowing amount is within a first preset difference range, determining that the first investment order and the fourth investment order are matched with the first borrowing order.
Optionally, the apparatus further includes a down-conversion module, configured to: counting the unprocessed amount of the borrowing list and the investment list in the current preset time, and executing the frequency reduction operation on the received amount of the borrowing list and the investment list when the unprocessed amount is larger than a preset unprocessed amount threshold value.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a match matching electronic device based on a production mode.
The electronic device of the embodiment of the invention comprises: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors realize any one of the matching and matching methods based on the production mode.
To achieve the above object, according to a further aspect of the embodiments of the present invention, there is provided a computer readable medium having a computer program stored thereon, the computer program, when executed by a processor, implements any one of the above-mentioned matching methods based on production patterns.
According to the scheme provided by the invention, one embodiment of the invention has the following advantages or beneficial effects: a new production line processing mode is provided, a producer consumer mode is adopted for data calculation, the traditional thread pool mode is replaced, and the CPU utilization rate and the throughput capacity of the system are improved; meanwhile, intelligent frequency reduction can be realized according to the transaction amount and the processing speed, perfect efficient matching of the borrowing sheet and the investment sheet is achieved, each link in the matching process can be monitored and early warned, and smooth execution of the transaction is finally guaranteed.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiment of the present invention is mainly applicable to the financial field, and mainly aims at a transaction matching scenario, and mainly takes P2P network credit as an example for description.
The production line mode architecture adopted by the invention includes, but is not limited to, a dispruptor, but the invention is mainly explained by taking the dispruptor as an example because the performance of the dispruptor is superior.
The borrowing sheet/investment sheet in the invention can also be understood as a buying/selling party in financial transaction, and has universality.
The words to which the invention relates are to be construed as follows:
the Disproptor: a high performance asynchronous processing framework, or the fastest message framework (light-weight JMS), may also be considered an observer mode implementation, or an event-listening mode implementation, directly called the disaraptor mode. The maximum characteristic of the disraptor is high performance, the LMAX architecture of the disraptor can obtain 6 million orders per second, and the throughput is 100K + with 1 microsecond delay.
Thread pool: the basic idea is also an object pool idea, a memory space is opened up, a plurality of threads are stored in the memory space, and thread execution scheduling in the pool is processed by a pool manager. When a thread task exists, one thread object is taken from the pool, and the thread object is returned to the pool after the execution is finished, so that the performance expense caused by repeatedly creating the thread object can be avoided, and the resources of the system are saved.
Blocking the queue: the blocking queue is a queue that supports two additional operations on a queue basis. Two additional operations: (1) the insertion method is that when the queue is full, the queue can block the thread for inserting the element until the queue is not full. (2) In the removal method, when the queue is empty, the thread that obtains the element waits for the queue to become non-empty.
Blocking: in the multi-thread domain: so-called blocking, in some cases a thread is suspended (i.e., blocked), and once the condition is met, the suspended thread is automatically awakened.
Frequency reduction: the power consumption and the operating temperature of the CPU (mainly in a notebook computer) are reduced by temporarily changing the operating frequency of the CPU.
GC (garbage collection): the memory processing is a place where problems are easy to occur to programmers, the instability and even crash of a program or a system can be caused by forgetting or wrong memory recovery, the GC function provided by Java can automatically monitor whether an object exceeds a scope of action, and therefore the purpose of automatically recovering the memory is achieved, and a display operation method for releasing the allocated memory is not provided by Java.
P2P: the small amount loan mode is a folk small amount loan mode for gathering small amount funds to loan the small amount funds to people with fund demands.
Referring to fig. 1, a main flowchart of a matching method based on a production mode according to an embodiment of the present invention is shown, which includes the following steps:
s101: according to the borrowing amount of the borrowing list, the investment amount of the investment list and a grouping amount threshold value, grouping the borrowing list and the investment list respectively to obtain a borrowing list set and an investment list set;
s102: analyzing the difference between the total amount of the borrowed money list set and the total amount of the investment list set, and determining the matching relation between the borrowed money list set and the investment list set, wherein the difference value is within a preset difference value range;
s103: and traversing the difference value between each borrowing sheet in the borrowing sheet set and each investment sheet in the investment sheet set in the determined matching relation, and determining that the investment sheet with the minimum difference value is matched with the corresponding borrowing sheet.
In the above embodiment, as for step S101, the screening manufacturer job is mainly responsible for obtaining the borrow form and the investment form in batch, screening and assembling the borrow form and the investment form into the target, and storing the target in the RingBuffer data structure, which is specifically shown in fig. 2. The object here includes two: a borrowing list set and an investment list set.
In the existing mode, although one borrowing sheet can be obtained each time, and then a proper investment sheet is searched, the efficiency is low. The invention adopts a mode of obtaining orders and grouping orders in batches to improve the processing efficiency of the whole operation flow.
Batch acquisition can take a variety of ways, and multiple borrowing/investment records can be acquired at one time:
1) periodically acquiring a borrowing bill and an investment bill; for example, the statistics are carried out once every 10 minutes, and only all the borrow bills and the investment bills in the period are processed once;
2) according to the time sequence, correspondingly extracting a certain amount of borrow lists and investment lists; for example, only 20 borrowed orders and 20 investment orders, or 20 borrowed orders and 30 investment orders, or 30 borrowed orders and 20 investment orders are processed at a time.
For the form combining mode, specifically, the following may be used:
according to the grouping amount threshold value, combining the borrowing units with the sum of the borrowing amounts smaller than or equal to the preset grouping amount threshold value into one group, and combining the investment units with the sum of the investment amounts larger than or equal to the preset grouping amount threshold value into one group.
The grouping amount threshold may be preset by the operator, for example, each time the money is grouped by 2 ten thousand yuan (or other currency units, the present invention mainly takes renminbi as an example); or the maximum debit amount in all the currently processed debit notes, for example, if the debit notes have 2 ten thousand yuan, 3 ten thousand yuan and 5 ten thousand yuan, the grouping amount threshold value is 5 ten thousand yuan. The invention is mainly explained by taking 2 ten thousand yuan as an example.
Assuming that there are 5 borrowing bills with 5000, 7000, 3000, 8000 and 5000 units of borrowing, the combination mode can be:
1) combining the 5000 x 2+7000+3000 borrow sheets, and forming a residual 8000 sheet by itself;
2) the average distribution resulted in 7000+8000 and 5000 x 2+ 3000.
Thus, the plurality of debit sheets are treated as a single sheet.
The above combination is also applicable to the investment sheet, but in this case, the investment sheets with the total investment amount greater than or equal to the value need to be combined, for example, 6 investment sheets are respectively 50000, 10000, 5000 × 2, 6000 and 30000 yuan, and in this case, the combination is as follows:
1)50000, 30000 in one group each, the remaining 10000, 5000 x 2 and 6000 in one group;
2)50000 is a group, the remaining 10000+5000 x 2 is a group, and 30000+6000 is a group.
However, since the number of investment orders is large, in order to avoid the situation that a plurality of investment orders with the investment amount far exceeding the predetermined value are combined together (excluding the situation that the investment amount of one investment order is large originally, for example, 5 ten thousand yuan, and the predetermined grouping threshold value is 2 ten thousand yuan), a certain grouping upper limit value, for example, 6 ten thousand yuan, may be set, so that a plurality of investment order sets may be obtained.
Further, before the screening operation, a production line needs to be constructed, and the system architecture thereof is also shown in fig. 2:
1) the whole matching process is regarded as a production line, and important processing logics are decoupled and used as independent operation units;
2) firstly, initializing a production line, and defining the operation composition in the production line:
the unit for storing data in the middle is realized by a RingBuffer annular cache queue, before the operation is started, the dispatcher framework initializes RingBuffer, pre-allocates memory and constructs an empty RingBuffer.
Thus, only the attributes in the existing objects in RingBuffer are modified at the time of subsequent production of data, and the objects are not created and deleted. The RingBuffer is always present, but the data in the RingBuffer is always updated and replaced, but the RingBuffer is still present when no data exists. Therefore, the problem of expensive expenditure of locks of common blocking queues and the problem of continuous Garbage Collection (GC) caused by frequent object collection are solved, the overall system performance is improved, and the method has good universality.
3) The production line is divided into two job processing units according to the service: a screening operation unit and a batch processing operation unit; the screening job unit refers to the description of step S101 and subsequent step S102, and the batch processing job unit refers to the description of subsequent step S103.
Each job is an independent processing unit with its own independent producer and consumer, whose mode is based on the dispatcher architecture. The dispatcher is a high-performance asynchronous processing framework and is realized by adopting an observer mode.
The whole process can be regarded as a production line, different operation units do different things, the division of work is clear, and processed data can be transferred in a first-level and a second-level manner like the flow operation, so that the control and the monitoring are simpler and more reasonable.
For step S102, in addition to the screening producer described above, a screening consumer is included.
The producer's collection of the borrowed bills and the investment bill collection can be put into the RingBuffer, which updates the cursors of the blocks, wakes up the screening consumption thread, and informs the consumer that there is a collection that needs consumption processing, as shown in fig. 3. The start Bean is a module for summarizing, processing and sending data, and is functional.
The present invention, by using the RingBuffer model (see right side of fig. 3), has only two threads to be executed specifically, one production thread and one consumption thread. The production thread is mainly used for grouping the bills to generate a borrowing bill set and an investment bill set; the consumption thread is mainly responsible for extracting the produced 'borrow sheet set and investment sheet set' and putting the extracted 'borrow sheet set and investment sheet set' into the memory so as to match in the memory.
Compared with the traditional thread pool mode (see the left side of the figure 3), the RingBuffer model can ensure that the threads are controllable and cannot be excessively created, and avoids the situation that the thread pool is occupied with full and blocked because the thread processing service time is long, the old threads are not released and new threads are continuously created.
It should be noted that, for the consumer's dispatcher framework, a lock-free framework is mainly used to implement, so as to solve the problems of high overhead and low performance of the existing blocking queue lock. And consumption calculation does not involve updating in the aspect of the database, and only is simple memory calculation, so that the processing efficiency is high.
The consumer would traverse the total amount of the borrowed bill set and then select the investment bill set with the sum of the borrowed bill set larger than or equal to the sum of the borrowed bill set to match the borrowed bill set. Various matching algorithms may be supported here, for example:
the total amount of the loan of a certain loan order set is 20500 yuan, two investment order sets are provided, 25000 yuan and 30000 yuan are respectively invested, in order to make the resources reasonably utilized, the 25000 yuan investment order set can be matched with the investment order set, because the difference 4500 of (25000-.
In step S103, the customer in the screening job matches the matching order in the memory, and then delivers the order that matches successfully to the producer of the batch job for processing and classification (specifically, the order may be set according to the business of the enterprise). And for the orders matched successfully, the orders can be assembled into a new object and put into batch processing operation.
Batch jobs are also divided into batch producers and batch consumers. Because the entire matching process is a production line, the producer of the batch job takes over the data generated by the consumption of the last job (screening job).
In general, the investment amount of the investment order may not exactly match the amount of the debit order, and may be larger or smaller, so that the investment amount of the investment order may be split and recombined:
the method comprises the following steps: extracting the determined and matched first investment order and first debit order, and determining a first investment amount of the first investment order and a first debit amount of the first debit order;
step two: when the first investment amount is larger than the first borrowing amount, splitting the first investment order into a second investment order and a third investment order, and determining that the second investment order is matched with the first borrowing order; wherein the investment amount of the second investment order is equal to the first borrowing amount;
step three: and when the first investment amount is smaller than the first borrowing amount and the split fourth investment order exists, if the sum of the investment amount of the fourth investment order and the first investment amount and the difference of the sum and the first borrowing amount are within a first preset difference range, determining that the first investment order and the fourth investment order are matched with the first borrowing order.
With particular reference to FIG. 4: three borrowing lists respectively borrow 5000 yuan, 3000 yuan and 4000 yuan, and three investment lists respectively invest 5000 yuan, 1000 yuan and 6000 yuan, and the matching relationship is obtained through analysis: 5000-. Assuming that the predetermined difference is 2000-bins maximum, the difference 1000 for 5000-.
1)5000 yuan of first borrowing unit is perfectly matched with 5000 yuan of investment unit;
2) in the ideal case, the second borrowing unit is 3000 yuan, and the corresponding investment unit 1000 yuan does not satisfy the borrowing, so that the combined investment is needed;
3) similarly, the third borrowing unit is 4000 yuan, and the corresponding investment unit 6000 yuan remains on the premise of meeting the 4000 yuan borrowing.
Since the method has a certain threshold value for the grouped sets, for example, the borrow sum of the borrow list set is 2 ten thousand yuan, and the investment sum of the investment list set is 2 ten thousand yuan minimum, the resources are required to be reasonably utilized. Specifically, the method comprises the following steps:
a 6000 dollar investment order may be split into two orders: 2000 yuan and 4000 yuan, wherein 2000 yuan is matched with the second borrowing unit, and 4000 yuan is matched with the third borrowing unit 4000 yuan.
From the dimension of the database, the first two orders (5000 and 1000) are complete matches, and only the investment order needs to be marked as a complete match. And for the third order, splitting is needed, and two new orders are generated.
With the dimension, the order can be divided into an updated batch and a newly added batch, and the updated batch and the newly added batch are assembled into a new object to be placed into the RingBuffer of the operation to trigger the consumer to consume. For the newly added investment tickets, the states also need to be changed into 'complete matching' or 'unmatched'.
And (4) carrying out batch updating and batch storage and warehousing according to the batch after the batch processing consumer monitors the data. In particular, batch operations may be performed based on the number of orders in a batch, avoiding situations where the amount of data is too large to exceed the database execution load.
In the implementation process, the investment notes are combined or disassembled, so that the investment notes and the borrowing notes are perfectly matched. And by adopting the architecture design screening operation based on the Disproptor, the order can be obtained and matched at the highest speed, and the performance is improved qualitatively.
In the batch processing operation, the grouped objects are put into a warehouse in batch, and the invention can adopt other modes as well:
1) classifying the objects according to the business requirements of the enterprise, then putting the objects into the memory objects, and then acquiring the objects in the memory through a timing task to execute updating and put the objects in the memory into a warehouse;
2) and through the processing of message middleware such as MQ and the like, the classified objects are uniformly sent out through messages, for example, the objects are sent out after being processed by one message, and the processing is considered to be successful.
The downstream system then listens for messages to process, which is also an asynchronous process.
It should be noted that although both of these two methods can also increase the execution rate of the production line, the final warehousing time is delayed.
Furthermore, in the whole production line, each operation unit can be monitored by a current limiter, and an independent intelligent alarm system is arranged to determine the execution frequency of a producer and a consumer.
For each job unit, a current limiter (see also fig. 2) can be configured to avoid the situation that the processing speed of a consumer is too slow, the speed of a producer is too fast, and the situation that the RingBuffer is overstocked and needs long waiting time is caused.
Therefore, the occupancy of the RingBuffer can be monitored simultaneously when the data is produced, and the subsequent process can be controlled according to the occupancy. For example, when RingBuffer occupancy reaches 50%, the production speed of the producer is reduced; however, if the rate exceeds 80%, an alarm is given and the producer is allowed to sleep for a certain period of time.
In addition, because the whole operation is in a production line and each operation unit is relatively independent, when the producer of one operation reduces the frequency, the overall execution speed is not influenced, the operation only acts on the operation unit of the producer and indirectly influences the execution frequency of the consumer of the previous operation. This is equivalent to a buffer action, which ensures the maximum throughput of the system as much as possible.
In the implementation process, each matching process in the production line is clearly split, the bottleneck of each operation unit can be clearly and visually found out according to the current-limiting monitor, and then effective monitoring and alarming are carried out, so that the fault tolerance rate of the system is high, alarming is timely, and a basis is provided for intelligent current limiting of the production line.
The method provided by the embodiment of the invention provides a new production line processing mode, adopts a producer consumer mode to calculate data, replaces the traditional thread pool mode, and improves the CPU utilization rate and the throughput capacity of the system; meanwhile, intelligent frequency reduction can be realized according to the transaction amount and the processing speed, perfect efficient matching of the borrowing sheet and the investment sheet is achieved, each link in the matching process can be monitored and early warned, and smooth execution of the transaction is finally guaranteed.
Referring to fig. 5, a schematic block diagram of a matching apparatus 500 based on a production mode according to an embodiment of the present invention is shown, including:
the grouping module 501 is configured to group the borrowing statement and the investment statement respectively according to the borrowing amount of the borrowing statement, the investment amount of the investment statement and a grouping amount threshold, so as to obtain a borrowing statement set and an investment statement set;
a first matching module 502, configured to analyze a difference between a total amount of the borrowed bills and a total amount of the investment bills in the collection of the borrowed bills, and determine a matching relationship between the borrowed bills in a preset difference range and the investment bills in the collection of the investment bills;
and a second matching module 503, configured to traverse differences between each of the borrowed orders in the borrowed order set and each of the investment orders in the investment order set in the determined matching relationship, and determine that the investment order with the smallest difference matches the corresponding borrowed order.
Optionally, a receiving module 504 (not shown) is further included, configured to:
extracting all the received borrowing bills and investment bills in a preset period; and/or
And determining a receiving time stamp of the borrowing list and a receiving time stamp of the investment list, and extracting the first preset amount of the borrowing list and the second preset amount of the investment list in sequence.
Optionally, the grouping amount threshold is a predetermined grouping amount threshold or a maximum debit amount in all current debit sheets;
the grouping module 501 is configured to: and combining the borrowed units with the sum of borrowed money smaller than or equal to the grouping amount threshold value into a group and combining the investment units with the sum of investment money larger than or equal to the grouping amount threshold value into a group according to the grouping amount threshold value.
Optionally, the second matching module 503 is configured to:
extracting the determined and matched first investment order and first debit order, and determining a first investment amount of the first investment order and a first debit amount of the first debit order;
when the first investment amount is larger than the first borrowing amount, splitting the first investment order into a second investment order and a third investment order, and determining that the second investment order is matched with the first borrowing order; wherein the investment amount of the second investment order is equal to the first debit amount;
and when the first investment amount is smaller than the first borrowing amount and a split fourth investment order exists, if the difference between the sum of the investment amount of the fourth investment order and the first investment amount and the first borrowing amount is within a first preset difference range, determining that the first investment order and the fourth investment order are matched with the first borrowing order.
Optionally, a frequency reducing module 505 (not shown) is further included for: counting the unprocessed amount of the borrowing list and the investment list in the current preset time, and executing the frequency reduction operation on the received amount of the borrowing list and the investment list when the unprocessed amount is larger than a preset unprocessed amount threshold value.
In addition, the detailed implementation of the matching device based on the production mode in the embodiment of the present invention is already described in detail in the above matching method based on the production mode, and therefore, the repeated description is not repeated here.
The device provided by the embodiment of the invention provides a new production line processing mode, adopts a producer consumer mode to calculate data, replaces the traditional thread pool mode, and improves the CPU utilization rate and the throughput capacity of the system; meanwhile, intelligent frequency reduction can be realized according to the transaction amount and the processing speed, perfect efficient matching of the borrowing sheet and the investment sheet is achieved, each link in the matching process can be monitored and early warned, and smooth execution of the transaction is finally guaranteed.
Fig. 6 shows an exemplary system architecture 600 of a match matching method based on production patterns or a match matching apparatus based on production patterns to which embodiments of the present invention can be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605 (by way of example only). The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the matching method based on the production pattern provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the matching device based on the production pattern is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. 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 (EPROM or 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 invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, 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 instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a grouping module, a first matching module, and a second matching module. Where the names of these modules do not in some cases constitute a limitation on the module itself, for example, a first matching module may also be described as a "module matching a collection of borrowed orders and a collection of investment orders".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
according to the borrowing amount of the borrowing list, the investment amount of the investment list and a grouping amount threshold value, grouping the borrowing list and the investment list respectively to obtain a borrowing list set and an investment list set;
analyzing the difference between the total amount of the borrowed money list set and the total amount of the investment list set, and determining the matching relation between the borrowed money list set and the investment list set, wherein the difference value is within a preset difference value range;
and traversing the difference value between each borrowing sheet in the borrowing sheet set and each investment sheet in the investment sheet set in the determined matching relation, and determining that the investment sheet with the minimum difference value is matched with the corresponding borrowing sheet.
According to the technical scheme of the embodiment of the invention, a new production line processing mode is provided, a producer consumer mode is adopted for data calculation, the traditional thread pool mode is replaced, and the CPU utilization rate and the throughput capacity of the system are improved; meanwhile, intelligent frequency reduction can be realized according to the transaction amount and the processing speed, perfect efficient matching of the borrowing sheet and the investment sheet is achieved, each link in the matching process can be monitored and early warned, and smooth execution of the transaction is finally guaranteed.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.