WO2019033605A1 - Method and apparatus for asynchronous order processing, and storage medium and terminal - Google Patents

Method and apparatus for asynchronous order processing, and storage medium and terminal Download PDF

Info

Publication number
WO2019033605A1
WO2019033605A1 PCT/CN2017/112761 CN2017112761W WO2019033605A1 WO 2019033605 A1 WO2019033605 A1 WO 2019033605A1 CN 2017112761 W CN2017112761 W CN 2017112761W WO 2019033605 A1 WO2019033605 A1 WO 2019033605A1
Authority
WO
WIPO (PCT)
Prior art keywords
order
transaction request
end device
transaction
order transaction
Prior art date
Application number
PCT/CN2017/112761
Other languages
French (fr)
Chinese (zh)
Inventor
彭川宇
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019033605A1 publication Critical patent/WO2019033605A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0633Lists, e.g. purchase orders, compilation or processing
    • G06Q30/0635Processing of requisition or of purchase orders

Definitions

  • the present application belongs to the field of communications technologies, and in particular, to a method, an apparatus, a storage medium, and a terminal for asynchronous processing of an order.
  • the order management system makes it easy for private equity funds to manage assets, such as independently deployed safe pay orders, life insurance orders, land orders, direct orders, and live orders.
  • the order management system front-end equipment adopts synchronous calling to process, that is, the back-end server of the order management system receives the next order for processing after completing an order transaction operation.
  • the way of synchronous call will put a lot of pressure on the back-end server, which will often crush the back-end server and reduce the response speed of the back-end server to the front-end device, thus reducing the front-end.
  • the throughput of the device to the order uses new servers to cope with high concurrency. When the peak of concurrency has passed, the newly added server lacks “useful land”, which leads to waste of resources.
  • the embodiment of the present invention provides a method, a device, a storage medium, and a terminal for asynchronous processing of an order, so as to solve the problem that the back-end server in the existing order management system cannot withstand the high concurrency of the front-end device and the waste of resources when the capacity is expanded.
  • a method for asynchronous processing of an order comprising:
  • the method further includes:
  • the method further includes:
  • the reading the order transaction request from the message queue in a first-in first-out order, executing the transaction operation corresponding to the order transaction request, and obtaining the transaction result includes:
  • the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  • the method further includes:
  • the revenue file segment is uploaded to the front end device whenever a revenue file segment is written.
  • an apparatus for asynchronously processing an order comprising:
  • An order cache module configured to: when receiving an order transaction request sent by the front-end device, buffer the order transaction request into a message queue, and send a response message to the front-end device to notify the front-end device of the order transaction The request has been successfully received;
  • An order processing module configured to read an order transaction request from the message queue in a first-in first-out order, execute a transaction operation corresponding to the order transaction request, and obtain a transaction result;
  • a callback module configured to obtain the transaction result, and the uniform resource locator provided by the callback front end device returns the transaction result to the front end device to notify the front end device that the order transaction request has been successfully executed and the corresponding transaction result.
  • the device further includes:
  • a storage module configured to save the order transaction request to a MongoDB database before caching the order transaction request to a message queue
  • an update module configured to, after obtaining the transaction result, write back status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
  • the request processing module includes:
  • a multi-thread processing unit configured to read an order transaction request from the message queue in a first-in first-out order, and allocate the read order transaction request to one of the multi-threads, and execute through the allocated thread The transaction operation corresponding to the order transaction request;
  • the callback module is also used to:
  • the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  • the device further includes:
  • a filtering module configured to obtain revenue data generated during execution of the transaction operation, and filter the revenue data
  • a fragment generation module configured to start reading and writing dual threads, and reading the filtered profit data by reading the thread to write to the memory queue, and simultaneously reading the profit data from the memory queue and writing the income data to the income file through the write thread in parallel In the fragment;
  • the segment uploading module is configured to upload the revenue file segment to the front end device whenever the profit file segment is written.
  • a third aspect is a computer readable storage medium having stored thereon computer readable instructions that, when executed by a processor, implement the following steps:
  • the embodiment of the present application further provides a terminal, including a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, when the processor executes the computer readable instruction Implement the following steps:
  • the embodiment of the present application uses java to reconstruct the order management system.
  • the transaction Requesting in a synchronous receiving manner, each time an order transaction request sent by the front-end device is received, the order transaction request is cached in a message queue, and a response message is sent to the front-end device to notify the front-end device
  • the order transaction request has been successfully received, so that the front-end device can directly feed back the message to the user without waiting for the transaction result of the order management system, which is beneficial to improve the concurrent throughput of the front-end device;
  • the asynchronous processing method is adopted, according to the advanced first Executing an order transaction request from the message queue, executing a transaction operation corresponding to the order transaction request, and obtaining a transaction result; and finally returning a uniform resource locator provided by the front-end device to return the transaction result to the front-end device
  • the back-end server in a synchronous receiving manner, each time an order transaction request sent by the front-end device is received, the order transaction request is cached in a message queue,
  • FIG. 1 is a first implementation flowchart of a method for asynchronous processing of an order provided by an embodiment of the present application
  • FIG. 2 is a second implementation flowchart of a method for asynchronous processing of an order provided by an embodiment of the present application
  • FIG. 3 is a third implementation flowchart of a method for asynchronous processing of an order provided by an embodiment of the present application
  • FIG. 4 is a fourth implementation flowchart of a method for asynchronous processing of an order provided by an embodiment of the present application
  • FIG. 5 is a structural diagram of a device for asynchronous processing of an order provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a terminal provided by an embodiment of the present application.
  • the existing order management system adopts the synchronous calling method. After an order is processed, the next order is received and processed. When a large number of orders are encountered, the synchronous calling method will put a lot of pressure on the back-end server, thus affecting the The efficiency of response to orders.
  • the embodiment of the present application uses java to reconstruct the original order management system, and the back-end server adopts the kafka architecture to improve the transaction operation to asynchronous processing.
  • kafka is a distributed based release / A system for subscribing to messages that can handle all action flow data in a consumer-sized website.
  • the action flow data includes, but is not limited to, a page view amount, information on the viewed content, and a search situation.
  • the Kafka cluster can include one or more servers that do not maintain the consumption state of the data, ensure high timeliness, high throughput, and directly use the disk for storage, linear reading, and fast response.
  • the embodiment of the present application can effectively increase the throughput of front-end orders by adopting the kafka architecture in the back-end server.
  • FIG. 1 shows a first implementation flow of a method for asynchronous processing of an order provided by an embodiment of the present application.
  • the order is a transaction order generated by a Hang Seng order management system.
  • the embodiment of the present application will describe an asynchronous processing procedure for a front-end order transaction request from the perspective of a back-end server, including but not limited to a computer, a server, and a notebook computer.
  • the method for asynchronous processing of the order includes:
  • step S101 when receiving the order transaction request sent by the front-end device, the order transaction request is cached into the message queue, and a response message is sent to the front-end device to inform the front-end device of the order transaction request. Received successfully.
  • the front-end device includes, but is not limited to, a smartphone, a tablet, a computer, and is responsible for sending a message to a back-end server and reading a message to a back-end server, pulling data and processing.
  • the front-end device receives an order transaction request submitted by a user in a Hang Seng order management system.
  • the order transaction request includes, but is not limited to, a securities transaction request, a fund transaction request, and a transaction account number, a fund code, and a request time information are recorded in each order transaction request.
  • the front end device then sends the order transaction request to the backend server.
  • the backend server receives the order transaction request, and caches the order transaction request into a message queue according to the request time information.
  • the message queue is used by the backend server to buffer the received order transaction request, so that the front end device can continuously receive the order transaction request, thereby improving the order throughput of the front end device.
  • the backend server may further send a response message to the front end device to notify the front end device that the order transaction request has been successfully received, so that the front end device can be based on the The response message outputs to the user a prompt message that the order transaction request is successfully received without waiting for the processing result of the backend server, ensuring that the user experience of the front end device still seems to be synchronized.
  • step S102 an order transaction request is read from the message queue in a first-in first-out order, and a transaction operation corresponding to the order transaction request is executed to obtain a transaction result.
  • the order transaction request is cached in the message queue of the backend server memory according to the order of the request time, and the transaction request at the bottom of the stack is earlier than the request time corresponding to the order transaction request at the top of the stack. Therefore, the embodiment of the present application reads the order transaction request for processing in a first-in-first-out manner.
  • the first in first out is a method of processing the program request from the queue or the stack, so that the earliest order transaction request in the message queue is prioritized and then processed. The next earliest order transaction request, thus guaranteeing the backend server
  • the order transaction request is still responded to in the order in which the front end device receives the order transaction request.
  • the transaction operation includes any process of securities transactions, such as computerized content such as account opening, commissioning, closing, delivery, and transfer.
  • the transaction result is status information of the order transaction request after the transaction operation is completed, including but not limited to the transaction party account number, fund code, transaction status, transaction time, and transaction mode.
  • step S103 the transaction result is obtained, and the uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device to notify the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
  • the backend server obtains the transaction result, puts the transaction result into the body part of the HTTP response message, and calls back the uniform resource locator provided by the front end device to The transaction result is returned to the front end device.
  • the front-end device may invoke the above-mentioned uniform resource locator to obtain the HTTP response message by using the HTTP protocol, and then display the transaction result on the browser, thereby completing the query operation of the transaction result of the order transaction request.
  • the backend server uses an Oracle database, and the corresponding transaction operation of the order transaction request is completed in the Oracle database.
  • the prior art also stores the transaction result in the Oracle database, so that the read and write operations are completed in the Oracle database, and the processing of the order transaction request and the query result of the transaction result are not high.
  • a second implementation flow of the method for asynchronous processing of the order provided by the embodiment of the present application is proposed, as shown in FIG. 2 .
  • the method for asynchronous processing of the order includes:
  • step S201 when the order transaction request sent by the front-end device is received, the order transaction request is saved to the MongoDB database, and the order transaction request is cached in the message queue, and the response is sent to the front-end device. a message to inform the front end device that the order transaction request has been successfully received.
  • the embodiment of the present application adds a MongoDB database. Before the order transaction request is cached to the message queue, the order transaction request is first saved in the MongoDB database to store the order transaction request through the MongoDB database.
  • the MongoDB is a product between a relational database and a non-relational database.
  • step S202 the order transaction request is read from the message queue in a first-in first-out order, the transaction operation corresponding to the order transaction request is executed, the transaction result is obtained, and the MongoDB database is written back according to the transaction result. State information corresponding to the order transaction request.
  • the transaction operation remains in the Oracle database.
  • the embodiment of the present application saves the transaction result to the MongoDB database, specifically, to write back the status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
  • the front-end device queries the transaction result corresponding to the order transaction request
  • the back-end server can directly query the MongoDB database to obtain the transaction result without querying the Oracle database, thereby realizing the separation of the transaction operation and the query operation, which is beneficial to reducing the processing pressure of the Oracle database. , which in turn improves the response speed of the backend server to the transaction request.
  • step S203 the transaction result is obtained, and the uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device to notify the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
  • the step S203 is the same as the step S103 described in the embodiment of the present invention.
  • details refer to the description of the foregoing embodiment, and details are not described herein again.
  • the embodiment of the present application adopts the method of sub-database, and combines the oracle database and the MongoDB database, and different databases perform different functions.
  • the process flow and approval data involved in the asynchronous processing of the order are stored in the oracle database, the transaction operation is completed by the Oracle database, the transaction result is stored in the MongoDB database, and the transaction query is completed by the MongoDB database, and the read-write separation is realized;
  • Query directly to the MongoDB database query, without querying the Oracle database improve the response speed to the order transaction request, but also improve the query response speed of the transaction results.
  • the backend server after receiving the order transaction request, the backend server first caches the order transaction request into the message queue, and then reads the order transaction request in a first-in first-out order for asynchronous processing.
  • the time required for the backend server to read the order transaction request one by one for processing is very large and the processing efficiency is low.
  • the third implementation flow of the method for asynchronous processing of the order provided by the embodiment of the present application is proposed, as shown in FIG. 3 .
  • the order transaction request is read from the message queue in the first-in first-out order in step S102, and the transaction operation corresponding to the order transaction request is executed, and the transaction result is obtained:
  • step S301 multithreading is started.
  • any one of the multi-threads is used to execute a transaction operation corresponding to an order transaction request.
  • the number of multithreads is based on actual processor performance and is not limited here.
  • step S302 an order transaction request is read from the message queue in a first-in first-out order, and the read order transaction request is allocated to one of the multi-threads, and the executed thread executes the Order transaction request Corresponding transaction operation.
  • the backend server determines whether there is an idle thread in real time; if yes, reads an order transaction request from the message queue, and allocates the order transaction request to the currently idle thread for processing, The thread processes the transaction request to improve the overall processing efficiency of the order transaction request; if not, it indicates that the current multiple threads are processing the order transaction request, and then waiting for the idle thread to appear.
  • the status flag is set to 1, indicating that the thread is busy; if the thread has completed the transaction operation, the status flag is set to 0, indicating that the thread is idle.
  • the backend server determines if there are free threads by identifying the flag bits of the thread.
  • the thread may further write back the status information corresponding to the order transaction request in the MongoDB database according to the transaction result, and simultaneously execute the transaction.
  • the result is recalled to the front-end device.
  • the uniform resource locator provided by the callback front-end device in the step S103 may return the transaction result to the front-end device, and may further include:
  • step S303 after the transaction request is processed, the unified resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  • the thread completes a transaction request, and returns the transaction result corresponding to the order transaction request to the front-end device through the uniform resource locator provided by the front-end device.
  • the embodiment of the present application asynchronously processes an order transaction request by starting a plurality of threads, thereby effectively improving the overall processing efficiency of the order transaction request.
  • the backend server generates revenue data during the asynchronous processing of reading the order transaction request.
  • the prior art is to uniformly generate transaction data into a revenue file, and then periodically upload the revenue file to a front-end device, including but not limited to a partner payment institution and a brokerage institution.
  • a front-end device including but not limited to a partner payment institution and a brokerage institution.
  • different users and different order transaction requests may generate revenue data.
  • there are more than four GB of revenue data every day and the generated income file is very large, which results in the speed of the income file being uploaded to the front-end device. very slow.
  • front-end devices are not easy to parse such huge revenue files.
  • the fourth implementation flow of the method for asynchronous processing of the order provided by the embodiment of the present application is proposed, as shown in FIG. 4 .
  • the method for asynchronous processing of the order includes:
  • Steps S401 to S403, wherein the steps S401 to S403 are the same as the steps S101 to S103 described in the embodiment of the present invention.
  • steps S401 to S403 are the same as the steps S101 to S103 described in the embodiment of the present invention.
  • details refer to the description of the foregoing embodiment, and details are not described herein again.
  • step S404 after performing the transaction operation corresponding to the transaction request, the revenue data generated during the execution of the transaction operation is acquired, and the revenue data is filtered.
  • the embodiment of the present application sets a filtering rule in advance by writing a SQL statement.
  • the filtering The rule may be to remove the revenue data with a return of zero or to remove the revenue data without the cumulative benefit.
  • the backend server After executing the transaction operation corresponding to the order transaction request, acquires the revenue data, reads the SQL statement, and filters the revenue data according to the SQL statement to reduce the size of the generated income file; The filtered revenue data is cached into the specified memory to wait for writing into the revenue file fragment.
  • the embodiment of the present application splits the income file into several segments for reading and writing, and the size of each segment is smaller than the revenue file.
  • step S405 the read/write dual thread is started, and the filtered profit data is read into the memory queue by the read thread, and the profit data is read out from the memory queue by the write thread in parallel and written to the profit file fragment. in.
  • the back-end server uses the read-write dual-threading method to write the revenue data into the revenue file fragment.
  • the read thread reads a row of revenue data and writes it to the memory queue.
  • the write thread synchronously reads the revenue data from the memory queue and writes the income file segment, and the read data and the write file are decoupled and separated, so that the revenue data is read.
  • the revenue document fragment was almost finished.
  • the generation time of the revenue file segment is equivalent to the reading time of the revenue data.
  • the time spent reading the data is the sum of the data time and the file time, which greatly speeds up the generation of the revenue file segment.
  • step S406 the revenue file segment is uploaded to the front end device whenever a revenue file segment is written.
  • the backend server monitors in real time whether there is a revenue file fragment full, and if so, uploads the revenue file fragment to the front end device and then begins writing a revenue file fragment. Since the revenue file fragment is divided by the revenue file, the amount of data is less, which facilitates the upload operation of the backend server and facilitates the parsing operation of the front end device. After receiving the revenue file segment, the front-end device can process without waiting for the remaining revenue data. When all revenue data is uploaded through the revenue file segment, the front-end device has processed multiple revenue file fragments, which effectively speeds up the processing of the revenue file by the front-end device.
  • the size of the serial number of each step does not mean the order of execution order, and the order of execution of each step should be determined by its function and internal logic, and should not constitute any implementation process of the embodiment of the present application. limited.
  • the storage medium may be a read only memory, a magnetic disk or an optical disk, or the like.
  • FIG. 5 is a structural diagram of an apparatus for asynchronous processing of an order provided by an embodiment of the present application. For convenience of description, only parts related to the embodiment of the present application are shown.
  • the device for asynchronous processing of the order is used to implement the method for asynchronous processing of the order described in the foregoing embodiments of FIG. 1 to FIG. 4, which may be a software unit, a hardware unit or a combination of hardware and software built in the terminal.
  • Unit. Place The terminal is a back-end server in the Hang Seng order management system, including but not limited to computers, servers, and notebook computers.
  • the device for asynchronously processing an order includes:
  • the order cache module 51 is configured to: when receiving the order transaction request sent by the front-end device, buffer the order transaction request into the message queue, and send a response message to the front-end device to notify the front-end device of the order The transaction request has been successfully received;
  • An order processing module 52 configured to read an order transaction request from the message queue in a first-in first-out order, execute a transaction operation corresponding to the order transaction request, and obtain a transaction result;
  • a callback module 53 is configured to obtain the transaction result, and the uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device to notify the front-end device that the order transaction request has been successfully executed and corresponding Transaction results.
  • the backend server receives the order transaction request through the order cache module 51, and caches the order transaction request into the message queue according to the request time information, so that the front end device can continuously receive the order transaction request, thereby improving the front end. Order throughput of the device.
  • the order cache module 51 may further send a response message to the front end device to inform the front end device that the order transaction request has been successfully received, so that the front end device can be based on The response message outputs to the user a prompt message that the order transaction request is successfully received without waiting for the processing result of the backend server, ensuring that the user experience of the front end device still appears to be synchronized.
  • the order transaction request is cached to the message queue, it is read and processed asynchronously by the order processing module 52, so that the back-end server can withstand the high concurrency of the front-end device and does not need to be expanded.
  • the back-end server is unbearable and the capacity is wasted.
  • the device further includes:
  • the storage module 54 is configured to save the order transaction request to the MongoDB database before caching the order transaction request to the message queue;
  • the update module 55 is configured to, after obtaining the transaction result, write back the status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
  • the back-end server uses the Oracle database, the transaction operation corresponding to the order transaction request is completed in the Oracle database, and the order transaction request and its corresponding transaction result are stored in the MongoDB database.
  • the embodiment of the present application realizes the separation of the transaction operation and the result query; the subsequent front-end device query can directly query the MongoDB database, and does not need to query the Oracle database, thereby reducing the pressure on the Oracle database and improving the The response speed of the order transaction request also increases the response speed of the query to the transaction result.
  • the order processing module 52 includes:
  • the starting unit 521 is configured to start multithreading
  • the multi-thread processing unit 522 is configured to read an order transaction request from the message queue in a first-in first-out order, and allocate the read order transaction request to one of the multi-threads, through the allocated thread Executing a transaction operation corresponding to the order transaction request;
  • the callback module 53 is further configured to:
  • the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  • the back-end server of the embodiment of the present application adopts asynchronous processing, and further asynchronously processes the order transaction request by starting multiple threads, thereby effectively improving the overall processing efficiency of the order transaction request.
  • the device further includes:
  • the filtering module 56 is configured to obtain the revenue data generated during the execution of the transaction operation, and filter the revenue data;
  • the fragment generation module 57 is configured to start reading and writing dual threads, and the read profit data is read into the memory queue by reading the thread, and the profit data is read from the memory queue and written to the revenue through the write thread in parallel.
  • the file fragment In the file fragment;
  • the segment uploading module 58 is configured to upload the revenue file segment to the front end device whenever the revenue file segment is written.
  • the embodiment of the present application splits the income file into several segments, and sets the size of each revenue file segment to be smaller than the revenue file.
  • the generated revenue data is filled into the income file segment, and after being filled up, uploaded to the front-end device, and then begins to write a revenue file segment. Because the revenue file fragment is small, it facilitates the upload operation of the back-end server and facilitates the parsing operation of the front-end device, which effectively speeds up the processing speed of the front-end device on the revenue file.
  • the segment generation module 57 adopts the method of reading and writing dual threads, reading a row of revenue data by the read thread and writing to the specified queue, and the write thread synchronously reads from the specified queue.
  • the income data is written into the income file fragment, and the read data and the write file are decoupled, so that when the income data is read, the income file fragment is almost finished.
  • the generation time of the revenue file segment is equivalent to the reading time of the revenue data.
  • the time spent reading the data is the sum of the data time and the file time, which greatly speeds up the generation of the revenue file segment. .
  • the terminal in the embodiment of the present application may be used to implement all the technical solutions in the foregoing method embodiments. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, only the division of each functional unit and module described above is exemplified. In practical applications, the above functions may be assigned to different functional units according to needs.
  • the module is completed by dividing the internal structure of the device into different functional units or modules to perform all or part of the functions described above.
  • Each functional unit and module in the embodiment can be integrated into one processing unit, Each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
  • FIG. 6 is a schematic diagram of a terminal according to an embodiment of the present application.
  • the terminal 6 of this embodiment includes a processor 60, a memory 61, and computer readable instructions 62 stored in the memory 61 and executable on the processor 60.
  • the steps in the method embodiment of the above-mentioned order asynchronous processing when the processor 60 executes the computer readable instructions 62, such as steps S101 to S102 shown in FIG. 1 and steps S201 to S203 shown in FIG. 2, FIG. Steps S1031 to S1032 are shown, and steps S401 to S406 shown in FIG. 4 are shown.
  • the functions of the modules/units in the apparatus embodiment for implementing the above-described order asynchronous processing when the processor 60 executes the computer readable instructions 62 such as the functions of the modules 51 to 58 shown in FIG.
  • the computer readable instructions 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60, To complete this application.
  • the one or more modules/units may be a series of computer readable instruction segments capable of performing a particular function for describing the execution of the computer readable instructions 62 in the terminal 6.
  • the computer readable instructions 62 may be divided into an order cache module, an order processing module, and a callback module, and the specific functions of each module are as follows:
  • An order cache module configured to: when receiving an order transaction request sent by the front-end device, buffer the order transaction request into a message queue, and send a response message to the front-end device to notify the front-end device of the order transaction The request has been successfully received;
  • An order processing module configured to read an order transaction request from the message queue in a first-in first-out order, execute a transaction operation corresponding to the order transaction request, and obtain a transaction result;
  • a callback module configured to obtain the transaction result, and the uniform resource locator provided by the callback front end device returns the transaction result to the front end device to notify the front end device that the order transaction request has been successfully executed and the corresponding transaction result.
  • computer readable instructions 62 can also be segmented:
  • a storage module configured to save the order transaction request to a MongoDB database before caching the order transaction request to a message queue
  • An update module configured to, after obtaining the transaction result, write back the subscription in the MongoDB database according to the transaction result Status information corresponding to a single transaction request.
  • the request processing module may further include:
  • a multi-thread processing unit configured to read an order transaction request from the message queue in a first-in first-out order, and allocate the read order transaction request to one of the multi-threads, and execute through the allocated thread The transaction operation corresponding to the order transaction request;
  • the callback module is also used to:
  • the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  • computer readable instructions 62 can also be segmented:
  • a filtering module configured to obtain revenue data generated during execution of the transaction operation, and filter the revenue data
  • a fragment generation module configured to start reading and writing dual threads, and reading the filtered profit data by reading the thread to write to the memory queue, and simultaneously reading the profit data from the memory queue and writing the income data to the income file through the write thread in parallel In the fragment;
  • the segment uploading module is configured to upload the revenue file segment to the front end device whenever the profit file segment is written.
  • the terminal 6 can be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal may include, but is not limited to, a processor 60, a memory 61. It will be understood by those skilled in the art that FIG. 6 is merely an example of the terminal 6, and does not constitute a limitation of the terminal 6, and may include more or less components than those illustrated, or combine some components, or different components, such as
  • the terminal may also include an input/output device, a network access device, a bus, and the like.
  • the processor 60 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like, which is a control center of the terminal, and connects various parts of the entire terminal using various interfaces and lines.
  • the memory 61 can be used to store the computer readable instructions and/or modules by running or executing computer readable instructions and/or modules stored in the memory, and recalling data stored in the memory Implementing various functions of the terminal.
  • the memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored. Data created based on the use of the terminal, etc.
  • the memory may include a high-speed random access memory, and may also include a non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media) Card, SMC), Secure Digital (SD), Flash Card, at least one disk storage device, flash memory device or other volatile solid-state storage device.
  • a non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media) Card, SMC), Secure Digital (SD), Flash Card, at least one disk storage device, flash memory device or other volatile solid-state storage device.
  • the disclosed apparatus/terminal and method may be implemented in other manners.
  • the device/terminal device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units.
  • components may be combined or integrated into another system, or some features may be omitted or not performed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated modules/units if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
  • the present application implements all or part of the processes in the foregoing embodiments, and may also be implemented by computer readable instructions, which may be stored in a computer readable storage medium.
  • the computer readable instructions when executed by a processor, may implement the steps of the various method embodiments described above.
  • the computer readable instructions comprise computer readable instruction code, which may be in the form of source code, an object code form, an executable file or some intermediate form or the like.
  • the computer readable storage medium may include any entity or device capable of carrying the computer readable instruction code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read only memory (ROM, Read- Only Memory), Random Access Memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the computer readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable The storage medium does not include an electrical carrier signal and a telecommunication signal.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application is applicable to the technical field of communications. Provided are a method and apparatus for asynchronous order processing, and a storage medium and a terminal. The method comprises: when an order transaction request sent by a front-end device is received, caching the order transaction request into a message queue, and sending a response message to the front-end device, so as to notify the front-end device that the order transaction request has been successfully received; reading the order transaction request from the message queue according to a first-in-first-out sequence, and executing a transaction operation corresponding to the order transaction request, so as to obtain a transaction result; and acquiring the transaction result, and calling back a uniform resource locator provided by the front-end device to return the transaction result to the front-end device, so as to notify the front-end device of the order transaction request being successfully executed and of a corresponding transaction result. The present application solves the problems that a back-end server in the existing order management system cannot bear high concurrency of front-end orders and that resource waste is generated when the high concurrency of front-end orders is dealt with through capacity expansion.

Description

订单异步处理的方法、装置、存储介质及终端Method, device, storage medium and terminal for asynchronous processing of orders
本专利申请以2017年8月17日提交的申请号为201710706714.8,名称为“订单异步处理的方法、装置、存储介质及终端”的中国发明专利申请为基础,并要求其优先权。This patent application is based on the Chinese Patent Application No. 201710706714.8 filed on Aug. 17, 2017, entitled "Method, Apparatus, Storage Medium and Terminal for Asynchronous Order Processing", and requires priority.
技术领域Technical field
本申请属于通信技术领域,尤其涉及一种订单异步处理的方法、装置、存储介质及终端。The present application belongs to the field of communications technologies, and in particular, to a method, an apparatus, a storage medium, and a terminal for asynchronous processing of an order.
背景技术Background technique
订单管理系统可以方便私募基金管理资产,例如独立部署的平安付订单、寿险订单、陆金所订单、直销订单和民生订单。对于订单管理系统前端设备接收的订单,现有技术采用同步调用的方式来进行处理,即订单管理系统的后端服务器在完成一个订单交易操作后才接收下一个订单进行处理。当遇到大批量订单并发时,同步调用的方式会对后端服务器造成非常大的压力,往往会把后端服务器压垮,且降低了后端服务器对前端设备的响应速度,从而降低了前端设备对订单的吞吐量。现有技术采用增加新的服务器来应对高并发。而当并发峰值过后,新增加的服务器又缺乏“用武之地”,从而导致了资源的浪费。The order management system makes it easy for private equity funds to manage assets, such as independently deployed safe pay orders, life insurance orders, land orders, direct orders, and live orders. For the orders received by the order management system front-end equipment, the prior art adopts synchronous calling to process, that is, the back-end server of the order management system receives the next order for processing after completing an order transaction operation. When encountering large-volume order concurrency, the way of synchronous call will put a lot of pressure on the back-end server, which will often crush the back-end server and reduce the response speed of the back-end server to the front-end device, thus reducing the front-end. The throughput of the device to the order. The prior art uses new servers to cope with high concurrency. When the peak of concurrency has passed, the newly added server lacks “useful land”, which leads to waste of resources.
发明内容Summary of the invention
本申请实施例提供了一种订单异步处理的方法、装置、存储介质及终端,以解决现有的订单管理系统中后端服务器无法承受前端设备的高并发、扩容应对时产生资源浪费的问题。The embodiment of the present invention provides a method, a device, a storage medium, and a terminal for asynchronous processing of an order, so as to solve the problem that the back-end server in the existing order management system cannot withstand the high concurrency of the front-end device and the waste of resources when the capacity is expanded.
第一方面,一种订单异步处理的方法,所述方法包括:In a first aspect, a method for asynchronous processing of an order, the method comprising:
当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;Receiving the order transaction request sent by the front-end device, buffering the order transaction request into the message queue, and sending a response message to the front-end device to notify the front-end device that the order transaction request has been successfully received;
按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;Reading an order transaction request from the message queue in a first-in first-out order, executing a transaction operation corresponding to the order transaction request, and obtaining a transaction result;
获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。Acquiring the transaction result, and returning the uniform resource locator provided by the front-end device to return the transaction result to the front-end device, to inform the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
进一步地,在将所述订单交易请求缓存至消息队列前,所述方法还包括:Further, before the order transaction request is cached to the message queue, the method further includes:
将所述订单交易请求保存至MongoDB数据库中;Saving the order transaction request to the MongoDB database;
在得到交易结果后,所述方法还包括: After obtaining the transaction result, the method further includes:
根据所述交易结果回写MongoDB数据库中所述订单交易请求对应的状态信息。And returning status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
进一步地,所述按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果包括:Further, the reading the order transaction request from the message queue in a first-in first-out order, executing the transaction operation corresponding to the order transaction request, and obtaining the transaction result includes:
启动多线程;Start multithreading;
按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;Reading an order transaction request from the message queue in a first-in first-out order, and allocating the read order transaction request to one of the multi-threads, and executing the order transaction request by the allocated thread Trading operation
所述回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备包括:Returning the transaction result to the front-end device by using the uniform resource locator provided by the callback front-end device includes:
在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
进一步地,在按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作后,所述方法还包括:Further, after the order transaction request is read from the message queue in a first-in first-out order, and the transaction operation corresponding to the order transaction request is executed, the method further includes:
获取交易操作执行过程中产生的收益数据,对所述收益数据进行过滤;Obtaining revenue data generated during the execution of the transaction operation, and filtering the revenue data;
启动读写双线程,通过读线程读取过滤后的收益数据写入至内存队列中,同时并行地通过写线程从所述内存队列中读出收益数据写入至收益文件片段中;Starting to read and write dual threads, reading the filtered profit data through the read thread to write to the memory queue, and simultaneously reading the profit data from the memory queue through the write thread into the income file segment;
每当有收益文件片段写完时,将所述收益文件片段上传至前端设备。The revenue file segment is uploaded to the front end device whenever a revenue file segment is written.
第二方面,一种订单异步处理的装置,所述装置包括:In a second aspect, an apparatus for asynchronously processing an order, the apparatus comprising:
订单缓存模块,用于当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;An order cache module, configured to: when receiving an order transaction request sent by the front-end device, buffer the order transaction request into a message queue, and send a response message to the front-end device to notify the front-end device of the order transaction The request has been successfully received;
订单处理模块,用于按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;An order processing module, configured to read an order transaction request from the message queue in a first-in first-out order, execute a transaction operation corresponding to the order transaction request, and obtain a transaction result;
回调模块,用于获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。a callback module, configured to obtain the transaction result, and the uniform resource locator provided by the callback front end device returns the transaction result to the front end device to notify the front end device that the order transaction request has been successfully executed and the corresponding transaction result.
进一步地,所述装置还包括:Further, the device further includes:
存储模块,用于在将所述订单交易请求缓存至消息队列前,将所述订单交易请求保存至MongoDB数据库中;a storage module, configured to save the order transaction request to a MongoDB database before caching the order transaction request to a message queue;
更新模块,用于在得到交易结果后,根据所述交易结果回写MongoDB数据库中所述订单交易请求对应的状态信息。And an update module, configured to, after obtaining the transaction result, write back status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
进一步地,所述请求处理模块包括: Further, the request processing module includes:
启动单元,用于启动多线程;a startup unit for starting multithreading;
多线程处理单元,用于按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;a multi-thread processing unit, configured to read an order transaction request from the message queue in a first-in first-out order, and allocate the read order transaction request to one of the multi-threads, and execute through the allocated thread The transaction operation corresponding to the order transaction request;
所述回调模块还用于:The callback module is also used to:
在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
进一步地,所述装置还包括:Further, the device further includes:
过滤模块,用于获取交易操作执行过程中产生的收益数据,对所述收益数据进行过滤;a filtering module, configured to obtain revenue data generated during execution of the transaction operation, and filter the revenue data;
片段生成模块,用于启动读写双线程,通过读线程读取过滤后的收益数据写入至内存队列中,同时并行地通过写线程从所述内存队列中读出收益数据写入至收益文件片段中;a fragment generation module, configured to start reading and writing dual threads, and reading the filtered profit data by reading the thread to write to the memory queue, and simultaneously reading the profit data from the memory queue and writing the income data to the income file through the write thread in parallel In the fragment;
片段上传模块,用于每当有收益文件片段写完时,将所述收益文件片段上传至前端设备。The segment uploading module is configured to upload the revenue file segment to the front end device whenever the profit file segment is written.
第三方面,一种计算机可读存储介质,其上存储有计算机可读指令,该计算机可读指令被处理器执行时实现如下步骤:A third aspect is a computer readable storage medium having stored thereon computer readable instructions that, when executed by a processor, implement the following steps:
当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;Receiving the order transaction request sent by the front-end device, buffering the order transaction request into the message queue, and sending a response message to the front-end device to notify the front-end device that the order transaction request has been successfully received;
按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;Reading an order transaction request from the message queue in a first-in first-out order, executing a transaction operation corresponding to the order transaction request, and obtaining a transaction result;
获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。Acquiring the transaction result, and returning the uniform resource locator provided by the front-end device to return the transaction result to the front-end device, to inform the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
第四方面,本申请实施例还提供了一种终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:In a fourth aspect, the embodiment of the present application further provides a terminal, including a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, when the processor executes the computer readable instruction Implement the following steps:
当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;Receiving the order transaction request sent by the front-end device, buffering the order transaction request into the message queue, and sending a response message to the front-end device to notify the front-end device that the order transaction request has been successfully received;
按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;Reading an order transaction request from the message queue in a first-in first-out order, executing a transaction operation corresponding to the order transaction request, and obtaining a transaction result;
获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。Acquiring the transaction result, and returning the uniform resource locator provided by the front-end device to return the transaction result to the front-end device, to inform the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
与现有技术相比,本申请实施例采用java对订单管理系统做了重构。其中,对于交易 请求,采用同步接收方式,每当接收到前端设备发送的订单交易请求时,则将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收,从而使得前端设备可以不用等待订单管理系统的交易结果直接向用户反馈消息,有利于提高前端设备的并发吞吐量;而对于交易操作,采用异步处理方式,按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;最后回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果;从而使得所述后端服务器可以承受前端设备的高并发,且无需扩容,解决了现有同步调用方式在遇到高并发时后端服务器难以承受、扩容产生资源浪费的问题。Compared with the prior art, the embodiment of the present application uses java to reconstruct the order management system. Among them, for the transaction Requesting, in a synchronous receiving manner, each time an order transaction request sent by the front-end device is received, the order transaction request is cached in a message queue, and a response message is sent to the front-end device to notify the front-end device The order transaction request has been successfully received, so that the front-end device can directly feed back the message to the user without waiting for the transaction result of the order management system, which is beneficial to improve the concurrent throughput of the front-end device; and for the transaction operation, the asynchronous processing method is adopted, according to the advanced first Executing an order transaction request from the message queue, executing a transaction operation corresponding to the order transaction request, and obtaining a transaction result; and finally returning a uniform resource locator provided by the front-end device to return the transaction result to the front-end device In order to inform the front-end device that the order transaction request has been successfully executed and the corresponding transaction result; thus, the back-end server can withstand the high concurrency of the front-end device, and does not need to be expanded, and solves the problem that the existing synchronous calling mode is encountered. Backend servers are unbearable and scalable when high concurrency Waste of raw resources.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative work for those skilled in the art.
图1是本申请实施例提供的订单异步处理的方法的第一实现流程图;1 is a first implementation flowchart of a method for asynchronous processing of an order provided by an embodiment of the present application;
图2是本申请实施例提供的订单异步处理的方法的第二实现流程图;2 is a second implementation flowchart of a method for asynchronous processing of an order provided by an embodiment of the present application;
图3是本申请实施例提供的订单异步处理的方法的第三实现流程图;3 is a third implementation flowchart of a method for asynchronous processing of an order provided by an embodiment of the present application;
图4是本申请实施例提供的订单异步处理的方法的第四实现流程图;4 is a fourth implementation flowchart of a method for asynchronous processing of an order provided by an embodiment of the present application;
图5是本申请实施例提供的订单异步处理的装置的组成结构图;5 is a structural diagram of a device for asynchronous processing of an order provided by an embodiment of the present application;
图6是本申请实施例提供的终端的示意图。FIG. 6 is a schematic diagram of a terminal provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
现有的订单管理系统采用同步调用的方式,一个订单处理完才接收并处理下一个订单,当遇到大量订单并发时,同步调用的方式会对后端服务器造成非常大的压力,从而影响了对订单的响应效率。鉴于此,本申请实施例采用java对原来的订单管理系统做了重构,后端服务器采用kafka架构,将交易操作改进为异步处理。在这里,kafka是一种分布式基于发布/ 订阅消息的系统,可以处理消费者规模的网站中的所有动作流数据。所述动作流数据包括但不限于页面访问量(Page View)、被查看内容方面的信息以及搜索情况等内容。Kafka集群可以包括一个或多个服务器,这些服务器不维护数据的消费状态,保证了高时效、大吞吐量,且直接使用磁盘进行存储,线性读取,响应速度快。本申请实施例在后端服务器采用kafka架构可以有效地增加前端订单的吞吐量。The existing order management system adopts the synchronous calling method. After an order is processed, the next order is received and processed. When a large number of orders are encountered, the synchronous calling method will put a lot of pressure on the back-end server, thus affecting the The efficiency of response to orders. In view of this, the embodiment of the present application uses java to reconstruct the original order management system, and the back-end server adopts the kafka architecture to improve the transaction operation to asynchronous processing. Here, kafka is a distributed based release / A system for subscribing to messages that can handle all action flow data in a consumer-sized website. The action flow data includes, but is not limited to, a page view amount, information on the viewed content, and a search situation. The Kafka cluster can include one or more servers that do not maintain the consumption state of the data, ensure high timeliness, high throughput, and directly use the disk for storage, linear reading, and fast response. The embodiment of the present application can effectively increase the throughput of front-end orders by adopting the kafka architecture in the back-end server.
图1示出了本申请实施例提供的订单异步处理的方法的第一实现流程。在本申请实施例中,所述订单为恒生订单管理系统产生的交易订单。本申请实施例将从后端服务器的角度描述对前端订单交易请求的异步处理过程,所述后端服务器包括但不限于计算机、服务器、笔记本电脑。参阅图1,所述订单异步处理的方法包括:FIG. 1 shows a first implementation flow of a method for asynchronous processing of an order provided by an embodiment of the present application. In the embodiment of the present application, the order is a transaction order generated by a Hang Seng order management system. The embodiment of the present application will describe an asynchronous processing procedure for a front-end order transaction request from the perspective of a back-end server, including but not limited to a computer, a server, and a notebook computer. Referring to FIG. 1, the method for asynchronous processing of the order includes:
在步骤S101中,当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收。In step S101, when receiving the order transaction request sent by the front-end device, the order transaction request is cached into the message queue, and a response message is sent to the front-end device to inform the front-end device of the order transaction request. Received successfully.
在这里,所述前端设备包括但不限于智能手机、平板电脑、计算机,负责发送消息到后端服务器以及向后端服务器读取消息,拉取数据并进行处理。在本申请实施例中,所述前端设备接收用户在恒生订单管理系统中提交的订单交易请求。所述订单交易请求包括但不限于证券交易请求、基金交易请求,每一个订单交易请求中记录了交易账号、基金代码、请求时间信息。然后所述前端设备将所述订单交易请求发送至后端服务器。Here, the front-end device includes, but is not limited to, a smartphone, a tablet, a computer, and is responsible for sending a message to a back-end server and reading a message to a back-end server, pulling data and processing. In the embodiment of the present application, the front-end device receives an order transaction request submitted by a user in a Hang Seng order management system. The order transaction request includes, but is not limited to, a securities transaction request, a fund transaction request, and a transaction account number, a fund code, and a request time information are recorded in each order transaction request. The front end device then sends the order transaction request to the backend server.
后端服务器接收所述订单交易请求,根据所述请求时间信息将所述订单交易请求缓存至消息队列中。在这里,所述消息队列用于后端服务器缓存所接收到的订单交易请求,从而使得前端设备可以持续地接收订单交易请求,提高了前端设备的订单吞吐量。进一步地,在缓存订单交易请求之后,所述后端服务器还可以向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收,从而使得所述前端设备可以根据所述响应消息向用户输出订单交易请求接收成功的提示信息,而无需等待后端服务器的处理结果,保证了前端设备的用户体验看起来仍然是同步的。The backend server receives the order transaction request, and caches the order transaction request into a message queue according to the request time information. Here, the message queue is used by the backend server to buffer the received order transaction request, so that the front end device can continuously receive the order transaction request, thereby improving the order throughput of the front end device. Further, after the order transaction request is cached, the backend server may further send a response message to the front end device to notify the front end device that the order transaction request has been successfully received, so that the front end device can be based on the The response message outputs to the user a prompt message that the order transaction request is successfully received without waiting for the processing result of the backend server, ensuring that the user experience of the front end device still seems to be synchronized.
在步骤S102中,按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果。In step S102, an order transaction request is read from the message queue in a first-in first-out order, and a transaction operation corresponding to the order transaction request is executed to obtain a transaction result.
在本申请实施例中,订单交易请求按照请求时间的先后顺序缓存至后端服务器内存的消息队列中,栈底的交易请求比栈顶的订单交易请求对应的请求时间更早。因此,本申请实施例采用先进先出的方式读取所述订单交易请求进行处理。其中,所述先进先出(FIFO,first-in,first-out)是处理从队列或堆栈发出的程序工作要求的一种方法,使消息队列中最早的订单交易请求被优先处理,然后再处理下一个最早的订单交易请求,从而保证了后端服务器 仍按照前端设备接收订单交易请求的顺序响应所述订单交易请求。In the embodiment of the present application, the order transaction request is cached in the message queue of the backend server memory according to the order of the request time, and the transaction request at the bottom of the stack is earlier than the request time corresponding to the order transaction request at the top of the stack. Therefore, the embodiment of the present application reads the order transaction request for processing in a first-in-first-out manner. Wherein, the first in first out (FIFO) is a method of processing the program request from the queue or the stack, so that the earliest order transaction request in the message queue is prioritized and then processed. The next earliest order transaction request, thus guaranteeing the backend server The order transaction request is still responded to in the order in which the front end device receives the order transaction request.
在读取出订单交易请求后,解析所述订单交易请求,得到交易账号和基金代码,根据所述交易账号和基金代码执行对应的交易操作,得到交易结果。示例性地,所述交易操作包括证券交易的任意过程,比如开户、委托、成交、交割和过户等计算机处理的内容。所述交易结果为交易操作完成后订单交易请求的状态信息,包括但不限于交易双方账号、基金代码、交易状态、交易时间、交易方式。After reading the order transaction request, parsing the order transaction request, obtaining a transaction account number and a fund code, and performing a corresponding transaction operation according to the transaction account number and the fund code to obtain a transaction result. Illustratively, the transaction operation includes any process of securities transactions, such as computerized content such as account opening, commissioning, closing, delivery, and transfer. The transaction result is status information of the order transaction request after the transaction operation is completed, including but not limited to the transaction party account number, fund code, transaction status, transaction time, and transaction mode.
在步骤S103中,获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。In step S103, the transaction result is obtained, and the uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device to notify the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
在这里,通过步骤S102完成对订单交易请求的交易操作后,后端服务器获取交易结果,将所述交易结果放入HTTP响应消息的body部分,并回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备。前端设备可以以HTTP协议调用上述统一资源定位符来获取所述HTTP响应消息,然后在浏览器上显示所述交易结果,从而完成对所述订单交易请求的交易结果的查询操作。通过消息队列缓存订单交易请求后再逐一读取并异步处理,使得所述后端服务器可以承受前端设备的高并发,且无需扩容,解决了现有同步调用方式在遇到高并发时后端服务器难以承受、扩容产生资源浪费的问题。Here, after completing the transaction operation of the order transaction request by step S102, the backend server obtains the transaction result, puts the transaction result into the body part of the HTTP response message, and calls back the uniform resource locator provided by the front end device to The transaction result is returned to the front end device. The front-end device may invoke the above-mentioned uniform resource locator to obtain the HTTP response message by using the HTTP protocol, and then display the transaction result on the browser, thereby completing the query operation of the transaction result of the order transaction request. Cache the order transaction request through the message queue, and then read and process it one by one, so that the back-end server can withstand the high concurrency of the front-end device, and does not need to be expanded, and solves the problem that the existing synchronous calling mode encounters high concurrency when the back-end server is encountered. Unbearable and expanding problems cause waste of resources.
可选地,如前所述,后端服务器使用Oracle数据库,所述订单交易请求对应的交易操作是在所述Oracle数据库中完成。现有技术将交易结果也存储在Oracle数据库中,使得读写操作都在Oracle数据库中完成,对订单交易请求的处理和对交易结果的查询速率不高。为了解决上述问题,在图1提供的订单异步处理的方法的第一实现流程的基础上,提出本申请实施例提供的订单异步处理的方法的第二实现流程,如图2所示。Optionally, as described above, the backend server uses an Oracle database, and the corresponding transaction operation of the order transaction request is completed in the Oracle database. The prior art also stores the transaction result in the Oracle database, so that the read and write operations are completed in the Oracle database, and the processing of the order transaction request and the query result of the transaction result are not high. In order to solve the above problem, on the basis of the first implementation flow of the method for processing the asynchronous processing of the order provided in FIG. 1 , a second implementation flow of the method for asynchronous processing of the order provided by the embodiment of the present application is proposed, as shown in FIG. 2 .
在图2中,所述订单异步处理的方法包括:In FIG. 2, the method for asynchronous processing of the order includes:
在步骤S201中,当接收到前端设备发送的订单交易请求时,将所述订单交易请求保存至MongoDB数据库中,再将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收。In step S201, when the order transaction request sent by the front-end device is received, the order transaction request is saved to the MongoDB database, and the order transaction request is cached in the message queue, and the response is sent to the front-end device. a message to inform the front end device that the order transaction request has been successfully received.
在这里,本申请实施例增加使用了MongoDB数据库。在将所述订单交易请求缓存至消息队列前,先将所述订单交易请求保存在MongoDB数据库中,以通过MongoDB数据库来存储订单交易请求。所述MongoDB是一个介于关系数据库和非关系数据库之间的产品。Here, the embodiment of the present application adds a MongoDB database. Before the order transaction request is cached to the message queue, the order transaction request is first saved in the MongoDB database to store the order transaction request through the MongoDB database. The MongoDB is a product between a relational database and a non-relational database.
在步骤S202中,按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果,根据所述交易结果回写MongoDB数据库中所 述订单交易请求对应的状态信息。In step S202, the order transaction request is read from the message queue in a first-in first-out order, the transaction operation corresponding to the order transaction request is executed, the transaction result is obtained, and the MongoDB database is written back according to the transaction result. State information corresponding to the order transaction request.
在本申请实施例中,交易操作仍然保留在Oracle数据库中完成。对于交易操作后得到交易结果后,本申请实施例将所述交易结果保存至MongoDB数据库中,具体为根据所述交易结果回写所述MongoDB数据库中所述订单交易请求对应的状态信息。在前端设备查询订单交易请求对应的交易结果时,后端服务器可以直接查询MongoDB数据库来得到交易结果,而无需查询Oracle数据库,实现了交易操作和查询操作的分离,有利于降低Oracle数据库的处理压力,进而提高了后端服务器对交易请求的响应速度。In the embodiment of the present application, the transaction operation remains in the Oracle database. After obtaining the transaction result after the transaction operation, the embodiment of the present application saves the transaction result to the MongoDB database, specifically, to write back the status information corresponding to the order transaction request in the MongoDB database according to the transaction result. When the front-end device queries the transaction result corresponding to the order transaction request, the back-end server can directly query the MongoDB database to obtain the transaction result without querying the Oracle database, thereby realizing the separation of the transaction operation and the query operation, which is beneficial to reducing the processing pressure of the Oracle database. , which in turn improves the response speed of the backend server to the transaction request.
在步骤S203中,获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。In step S203, the transaction result is obtained, and the uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device to notify the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
步骤S203与图1实施例中所述的步骤S103相同,具体请参见上述实施例的叙述,此处不再赘述。The step S203 is the same as the step S103 described in the embodiment of the present invention. For details, refer to the description of the foregoing embodiment, and details are not described herein again.
本申请实施例采用分库的方式,结合使用了oracle数据库和MongoDB数据库,不同的数据库执行不同的功能。其中,订单异步处理涉及的流程流转及审批数据存储在oracle数据库中,由Oracle数据库完成交易操作,交易结果存储在MongoDB数据库中,并由MongoDB数据库完成交易查询,实现了读写分离;后续前端设备查询时直接到MongoDB数据库查询即可,无需查询Oracle数据库,提高了对订单交易请求的响应速度,也提高了对交易结果的查询响应速度。The embodiment of the present application adopts the method of sub-database, and combines the oracle database and the MongoDB database, and different databases perform different functions. Among them, the process flow and approval data involved in the asynchronous processing of the order are stored in the oracle database, the transaction operation is completed by the Oracle database, the transaction result is stored in the MongoDB database, and the transaction query is completed by the MongoDB database, and the read-write separation is realized; Query directly to the MongoDB database query, without querying the Oracle database, improve the response speed to the order transaction request, but also improve the query response speed of the transaction results.
可选地,如前所述,后端服务器在接收到订单交易请求后,先将订单交易请求缓存至消息队列中,然后按照先进先出顺序读取订单交易请求进行异步处理。当消息队列中的订单交易请求过多时,后端服务器一个一个地读取订单交易请求进行处理所需的时间成本非常大,处理效率低。为了解决上述问题,在图1提供的订单异步处理的方法的第一实现流程的基础上,提出本申请实施例提供的订单异步处理的方法的第三实现流程,如图3所示。Optionally, as described above, after receiving the order transaction request, the backend server first caches the order transaction request into the message queue, and then reads the order transaction request in a first-in first-out order for asynchronous processing. When there are too many order transaction requests in the message queue, the time required for the backend server to read the order transaction request one by one for processing is very large and the processing efficiency is low. In order to solve the above problem, on the basis of the first implementation flow of the method for processing the asynchronous processing of the order provided in FIG. 1 , the third implementation flow of the method for asynchronous processing of the order provided by the embodiment of the present application is proposed, as shown in FIG. 3 .
在图3中,步骤S102中所述的按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果包括:In FIG. 3, the order transaction request is read from the message queue in the first-in first-out order in step S102, and the transaction operation corresponding to the order transaction request is executed, and the transaction result is obtained:
在步骤S301中,启动多线程。In step S301, multithreading is started.
在这里,所述多线程中的任一线程用于执行订单交易请求对应的交易操作。多线程的数量根据实际的处理器性能开辟,此处不做限制。Here, any one of the multi-threads is used to execute a transaction operation corresponding to an order transaction request. The number of multithreads is based on actual processor performance and is not limited here.
在步骤S302中,按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求 对应的交易操作。In step S302, an order transaction request is read from the message queue in a first-in first-out order, and the read order transaction request is allocated to one of the multi-threads, and the executed thread executes the Order transaction request Corresponding transaction operation.
在本申请实施例中,后端服务器实时地判断是否存在空闲的线程;若是,则从消息队列中读取订单交易请求,将该订单交易请求分配给当前空闲的线程进行处理,以通过所述线程来处理该交易请求,提高订单交易请求的整体处理效率;若否时,表明当前的多个线程均在处理订单交易请求,则等待空闲的线程出现。在这里,可以使用状态标志位来记录每一个线程的状态。示例性地,若线程正在执行交易操作时,状态标志位设为1,表示线程忙;若线程已完成交易操作,状态标志位设为0,表示线程空闲。后端服务器通过识别线程的标志位来判断是否有空闲的线程。In the embodiment of the present application, the backend server determines whether there is an idle thread in real time; if yes, reads an order transaction request from the message queue, and allocates the order transaction request to the currently idle thread for processing, The thread processes the transaction request to improve the overall processing efficiency of the order transaction request; if not, it indicates that the current multiple threads are processing the order transaction request, and then waiting for the idle thread to appear. Here, you can use the status flags to record the status of each thread. Illustratively, if the thread is performing a transaction operation, the status flag is set to 1, indicating that the thread is busy; if the thread has completed the transaction operation, the status flag is set to 0, indicating that the thread is idle. The backend server determines if there are free threads by identifying the flag bits of the thread.
可选地,多线程的任一线程执行完订单交易请求对应的交易操作之后,还可以根据所述交易结果回写所述MongoDB数据库中所述订单交易请求对应的状态信息,同时将所述交易结果回调给前端设备。在图1实施例中,步骤S103中所述的回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备还可以包括:Optionally, after executing the transaction operation corresponding to the order transaction request, the thread may further write back the status information corresponding to the order transaction request in the MongoDB database according to the transaction result, and simultaneously execute the transaction. The result is recalled to the front-end device. In the embodiment of FIG. 1, the uniform resource locator provided by the callback front-end device in the step S103 may return the transaction result to the front-end device, and may further include:
在步骤S303中,在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。In step S303, after the transaction request is processed, the unified resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
至此,该线程完成一个交易请求,则将所述订单交易请求对应的交易结果通过前端设备提供的统一资源定位符返回给前端设备。本申请实施例通过启动多个线程来对订单交易请求进行异步处理,有效地提高了订单交易请求的整体处理效率。At this point, the thread completes a transaction request, and returns the transaction result corresponding to the order transaction request to the front-end device through the uniform resource locator provided by the front-end device. The embodiment of the present application asynchronously processes an order transaction request by starting a plurality of threads, thereby effectively improving the overall processing efficiency of the order transaction request.
可选地,后端服务器在读取订单交易请求进行异步处理的过程中,会产生收益数据。现有技术是统一将交易数据生成收益文件,然后定时将所述收益文件上传至前端设备,所述的前端设备包括但不限于合作伙伴支付机构、券商机构。然而,不同的用户、不同的订单交易请求都有可能产生收益数据,据统计,每天都会有超过四个GB的收益数据,所生成的收益文件非常巨大,从而导致收益文件上传至前端设备的速度非常慢。且前端设备也不容易解析如此巨大的收益文件。为了解决上述问题,在图1提供的订单异步处理的方法的第一实现流程的基础上,提出本申请实施例提供的订单异步处理的方法的第四实现流程,如图4所示。Optionally, the backend server generates revenue data during the asynchronous processing of reading the order transaction request. The prior art is to uniformly generate transaction data into a revenue file, and then periodically upload the revenue file to a front-end device, including but not limited to a partner payment institution and a brokerage institution. However, different users and different order transaction requests may generate revenue data. According to statistics, there are more than four GB of revenue data every day, and the generated income file is very large, which results in the speed of the income file being uploaded to the front-end device. very slow. And front-end devices are not easy to parse such huge revenue files. In order to solve the above problem, on the basis of the first implementation flow of the method for processing the asynchronous processing of the order provided in FIG. 1, the fourth implementation flow of the method for asynchronous processing of the order provided by the embodiment of the present application is proposed, as shown in FIG. 4 .
在图4中,所述订单异步处理的方法包括:In FIG. 4, the method for asynchronous processing of the order includes:
步骤S401至步骤S403,其中步骤S401至步骤S403与图1实施例中所述的步骤S101至步骤S103相同,具体请参见上述实施例的叙述,此处不再赘述。Steps S401 to S403, wherein the steps S401 to S403 are the same as the steps S101 to S103 described in the embodiment of the present invention. For details, refer to the description of the foregoing embodiment, and details are not described herein again.
在步骤S404中,在执行所述交易请求对应的交易操作后,获取交易操作执行过程中产生的收益数据,对所述收益数据进行过滤。In step S404, after performing the transaction operation corresponding to the transaction request, the revenue data generated during the execution of the transaction operation is acquired, and the revenue data is filtered.
在这里,本申请实施例预先通过编写SQL语句来设置过滤规则。示例性地,所述过滤 规则可以为将收益为0的收益数据去除或者将没有累计收益的收益数据去除。在执行所述订单交易请求对应的交易操作后,后端服务器获取收益数据,读取SQL语句并根据所述SQL语句对所述收益数据进行过滤,以缩小所生成的收益文件的大小;然后将过滤后的所述收益数据缓存至指定内存中,以等待写入收益文件片段中。与现有技术不同,本申请实施例将收益文件拆分为若干个片段来进行读写,每个片段的大小小于所述收益文件。Here, the embodiment of the present application sets a filtering rule in advance by writing a SQL statement. Illustratively, the filtering The rule may be to remove the revenue data with a return of zero or to remove the revenue data without the cumulative benefit. After executing the transaction operation corresponding to the order transaction request, the backend server acquires the revenue data, reads the SQL statement, and filters the revenue data according to the SQL statement to reduce the size of the generated income file; The filtered revenue data is cached into the specified memory to wait for writing into the revenue file fragment. Different from the prior art, the embodiment of the present application splits the income file into several segments for reading and writing, and the size of each segment is smaller than the revenue file.
在步骤S405中,启动读写双线程,通过读线程读取过滤后的收益数据写入至内存队列中,同时并行地通过写线程从所述内存队列中读出收益数据写入至收益文件片段中。In step S405, the read/write dual thread is started, and the filtered profit data is read into the memory queue by the read thread, and the profit data is read out from the memory queue by the write thread in parallel and written to the profit file fragment. in.
在这里,后端服务器采用读写双线程的方式将收益数据写入收益文件片段中。通过读线程读一行收益数据并写入至内存队列中,写线程同步地从该内存队列中读取收益数据并写入收益文件片段,读数据和写文件解耦分离,使得收益数据读完的时候,收益文件片段也差不多写完。收益文件片段的生成时间相当于收益数据的读取时间,相比于现有读写同步的方式耗费的时间为读数据时间与写文件时间之和,大大地加快了收益文件片段的生成效率。Here, the back-end server uses the read-write dual-threading method to write the revenue data into the revenue file fragment. The read thread reads a row of revenue data and writes it to the memory queue. The write thread synchronously reads the revenue data from the memory queue and writes the income file segment, and the read data and the write file are decoupled and separated, so that the revenue data is read. At the time, the revenue document fragment was almost finished. The generation time of the revenue file segment is equivalent to the reading time of the revenue data. Compared with the existing method of reading and writing synchronization, the time spent reading the data is the sum of the data time and the file time, which greatly speeds up the generation of the revenue file segment.
在步骤S406中,每当有收益文件片段写完时,将所述收益文件片段上传至前端设备。In step S406, the revenue file segment is uploaded to the front end device whenever a revenue file segment is written.
后端服务器实时地监测是否有收益文件片段写满,若是,则将所述收益文件片段上传至前端设备,然后再开始写下一个收益文件片段。由于收益文件片段是由收益文件分割而成,数据量更少,从而方便了后端服务器的上传操作且方便了前端设备的解析操作。前端设备在接收到所述收益文件片段之后,无需等待其余收益数据就可以进行处理。在所有收益数据通过收益文件片段上传完时,前端设备已经处理了多个收益文件片段,有效地加快了前端设备对收益文件的处理速度。The backend server monitors in real time whether there is a revenue file fragment full, and if so, uploads the revenue file fragment to the front end device and then begins writing a revenue file fragment. Since the revenue file fragment is divided by the revenue file, the amount of data is less, which facilitates the upload operation of the backend server and facilitates the parsing operation of the front end device. After receiving the revenue file segment, the front-end device can process without waiting for the remaining revenue data. When all revenue data is uploaded through the revenue file segment, the front-end device has processed multiple revenue file fragments, which effectively speeds up the processing of the revenue file by the front-end device.
应理解,在上述实施例中,各步骤的序号的大小并不意味着执行顺序的先后,各步骤的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in the foregoing embodiments, the size of the serial number of each step does not mean the order of execution order, and the order of execution of each step should be determined by its function and internal logic, and should not constitute any implementation process of the embodiment of the present application. limited.
需要说明的是,本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过计算机可读指令来指令相关的硬件完成,所述的计算机可读指令可以存储于一种计算机可读存储介质中,所述存储介质可以是只读存储器,磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by computer readable instructions, and the computer readable instructions may be stored. In a computer readable storage medium, the storage medium may be a read only memory, a magnetic disk or an optical disk, or the like.
图5示出了本申请实施例提供的订单异步处理的装置的组成结构图,为了便于说明,仅示出了与本申请实施例相关的部分。FIG. 5 is a structural diagram of an apparatus for asynchronous processing of an order provided by an embodiment of the present application. For convenience of description, only parts related to the embodiment of the present application are shown.
在本申请实施例中,所述订单异步处理的装置用于实现上述图1至图4实施例中所述的订单异步处理的方法,可以是内置于终端的软件单元、硬件单元或者软硬件结合的单元。所 述终端为恒生订单管理系统中的后端服务器,包括但不限于计算机、服务器、笔记本电脑。In the embodiment of the present application, the device for asynchronous processing of the order is used to implement the method for asynchronous processing of the order described in the foregoing embodiments of FIG. 1 to FIG. 4, which may be a software unit, a hardware unit or a combination of hardware and software built in the terminal. Unit. Place The terminal is a back-end server in the Hang Seng order management system, including but not limited to computers, servers, and notebook computers.
参阅图5,所述订单异步处理的装置包括:Referring to FIG. 5, the device for asynchronously processing an order includes:
订单缓存模块51,用于当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;The order cache module 51 is configured to: when receiving the order transaction request sent by the front-end device, buffer the order transaction request into the message queue, and send a response message to the front-end device to notify the front-end device of the order The transaction request has been successfully received;
订单处理模块52,用于按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;An order processing module 52, configured to read an order transaction request from the message queue in a first-in first-out order, execute a transaction operation corresponding to the order transaction request, and obtain a transaction result;
回调模块53,用于获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。a callback module 53 is configured to obtain the transaction result, and the uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device to notify the front-end device that the order transaction request has been successfully executed and corresponding Transaction results.
在这里,后端服务器通过订单缓存模块51接收订单交易请求,并根据所述请求时间信息将所述订单交易请求缓存至消息队列中,从而使得前端设备可以持续地接收订单交易请求,提高了前端设备的订单吞吐量。进一步地,在缓存订单交易请求之后,所述订单缓存模块51还可以向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收,从而使得所述前端设备可以根据所述响应消息向用户输出订单交易请求接收成功的提示信息,而无需等待后端服务器的处理结果,保证了前端设备的用户体验看起来仍然是同步的。更进一步地,在订单交易请求缓存至消息队列之后,再通过所述订单处理模块52从中逐一读取并异步处理,使得所述后端服务器可以承受前端设备的高并发,且无需扩容,解决了现有同步调用方式在遇到高并发时后端服务器难以承受、扩容产生资源浪费的问题。Here, the backend server receives the order transaction request through the order cache module 51, and caches the order transaction request into the message queue according to the request time information, so that the front end device can continuously receive the order transaction request, thereby improving the front end. Order throughput of the device. Further, after the order transaction request is cached, the order cache module 51 may further send a response message to the front end device to inform the front end device that the order transaction request has been successfully received, so that the front end device can be based on The response message outputs to the user a prompt message that the order transaction request is successfully received without waiting for the processing result of the backend server, ensuring that the user experience of the front end device still appears to be synchronized. Further, after the order transaction request is cached to the message queue, it is read and processed asynchronously by the order processing module 52, so that the back-end server can withstand the high concurrency of the front-end device and does not need to be expanded. When the existing synchronous calling method encounters high concurrency, the back-end server is unbearable and the capacity is wasted.
可选地,所述装置还包括:Optionally, the device further includes:
存储模块54,用于在将所述订单交易请求缓存至消息队列前,将所述订单交易请求保存至MongoDB数据库中;The storage module 54 is configured to save the order transaction request to the MongoDB database before caching the order transaction request to the message queue;
更新模块55,用于在得到交易结果后,根据所述交易结果回写MongoDB数据库中所述订单交易请求对应的状态信息。The update module 55 is configured to, after obtaining the transaction result, write back the status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
在本申请实施例中,后端服务器使用Oracle数据库,所述订单交易请求对应的交易操作是在所述Oracle数据库中完成的,而订单交易请求及其对应的交易结果则存储在MongoDB数据库中。通过采用分库的方式,本申请实施例实现了交易操作和结果查询的分离;后续前端设备查询时直接到MongoDB数据库查询即可,无需查询Oracle数据库,从而降低了Oracle数据库的压力,提高了对订单交易请求的响应速度,也提高了对交易结果的查询响应速度。In the embodiment of the present application, the back-end server uses the Oracle database, the transaction operation corresponding to the order transaction request is completed in the Oracle database, and the order transaction request and its corresponding transaction result are stored in the MongoDB database. By adopting the method of sub-database, the embodiment of the present application realizes the separation of the transaction operation and the result query; the subsequent front-end device query can directly query the MongoDB database, and does not need to query the Oracle database, thereby reducing the pressure on the Oracle database and improving the The response speed of the order transaction request also increases the response speed of the query to the transaction result.
可选地,所述订单处理模块52包括: Optionally, the order processing module 52 includes:
启动单元521,用于启动多线程;The starting unit 521 is configured to start multithreading;
多线程处理单元522,用于按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;The multi-thread processing unit 522 is configured to read an order transaction request from the message queue in a first-in first-out order, and allocate the read order transaction request to one of the multi-threads, through the allocated thread Executing a transaction operation corresponding to the order transaction request;
所述回调模块53还用于:The callback module 53 is further configured to:
在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
本申请实施例后端服务器采用异步处理的基础上,进一步通过启动多个线程来对订单交易请求进行异步处理,有效地提高了订单交易请求的整体处理效率。The back-end server of the embodiment of the present application adopts asynchronous processing, and further asynchronously processes the order transaction request by starting multiple threads, thereby effectively improving the overall processing efficiency of the order transaction request.
可选地,所述装置还包括:Optionally, the device further includes:
过滤模块56,用于获取交易操作执行过程中产生的收益数据,对所述收益数据进行过滤;The filtering module 56 is configured to obtain the revenue data generated during the execution of the transaction operation, and filter the revenue data;
片段生成模块57,用于启动读写双线程,通过读线程读取过滤后的收益数据写入至内存队列中,同时并行地通过写线程从所述内存队列中读出收益数据写入至收益文件片段中;The fragment generation module 57 is configured to start reading and writing dual threads, and the read profit data is read into the memory queue by reading the thread, and the profit data is read from the memory queue and written to the revenue through the write thread in parallel. In the file fragment;
片段上传模块58,用于每当有收益文件片段写完时,将所述收益文件片段上传至前端设备。The segment uploading module 58 is configured to upload the revenue file segment to the front end device whenever the revenue file segment is written.
在这里,本申请实施例将收益文件拆分为若干个片段,并设置每个收益文件片段的大小小于所述收益文件。在执行订单交易请求对应的交易操作的过程中,将产生的收益数据填充至所述收益文件片段中,并在填满之后上传至前端设备,然后开始写下一个收益文件片段。由于收益文件片段较小,从而方便了后端服务器的上传操作,以及方便了前端设备的解析操作,有效地加快了前端设备对收益文件的处理速度。进一步地,在写收益文件片段时,所述片段生成模块57采用读写双线程的方式,由读线程读一行收益数据并写入至指定队列中,写线程同步地从该指定队列中读取收益数据并写入收益文件片段,读数据和写文件解耦分离,使得收益数据读完的时候,收益文件片段也差不多写完。收益文件片段的生成时间相当于收益数据的读取时间,相比于现有读写同步的方式耗费的时间为读数据时间与写文件时间之和,从而大大地加快了收益文件片段的生成效率。Here, the embodiment of the present application splits the income file into several segments, and sets the size of each revenue file segment to be smaller than the revenue file. In the process of executing the transaction operation corresponding to the order transaction request, the generated revenue data is filled into the income file segment, and after being filled up, uploaded to the front-end device, and then begins to write a revenue file segment. Because the revenue file fragment is small, it facilitates the upload operation of the back-end server and facilitates the parsing operation of the front-end device, which effectively speeds up the processing speed of the front-end device on the revenue file. Further, when writing the profit file segment, the segment generation module 57 adopts the method of reading and writing dual threads, reading a row of revenue data by the read thread and writing to the specified queue, and the write thread synchronously reads from the specified queue. The income data is written into the income file fragment, and the read data and the write file are decoupled, so that when the income data is read, the income file fragment is almost finished. The generation time of the revenue file segment is equivalent to the reading time of the revenue data. Compared with the existing method of reading and writing synchronization, the time spent reading the data is the sum of the data time and the file time, which greatly speeds up the generation of the revenue file segment. .
需要说明的是,本申请实施例中的终端可以用于实现上述方法实施例中的全部技术方案。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也 可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It should be noted that the terminal in the embodiment of the present application may be used to implement all the technical solutions in the foregoing method embodiments. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, only the division of each functional unit and module described above is exemplified. In practical applications, the above functions may be assigned to different functional units according to needs. The module is completed by dividing the internal structure of the device into different functional units or modules to perform all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into one processing unit, Each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of the respective functional units and modules are only for the purpose of facilitating mutual differentiation, and are not intended to limit the scope of protection of the present application. For the specific working process of the foregoing units and modules, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described herein again.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the parts that are not detailed or described in the specific embodiments may be referred to the related descriptions of other embodiments.
图6是本申请实施例提供的一种终端的示意图。如图6所示,该实施例的终端6包括:处理器60、存储器61以及存储在所述存储器61中并可在所述处理器60上运行的计算机可读指令62。所述处理器60执行所述计算机可读指令62时实现上述订单异步处理的方法实施例中的步骤,例如图1所示的步骤S101至S102、图二所示的步骤S201至S203、图3所示的步骤S1031至S1032、图4所示的步骤S401至S406。或者,所述处理器60执行所述计算机可读指令62时实现上述订单异步处理的装置实施例中各模块/单元的功能,例如图5所示模块51至58的功能。FIG. 6 is a schematic diagram of a terminal according to an embodiment of the present application. As shown in FIG. 6, the terminal 6 of this embodiment includes a processor 60, a memory 61, and computer readable instructions 62 stored in the memory 61 and executable on the processor 60. The steps in the method embodiment of the above-mentioned order asynchronous processing when the processor 60 executes the computer readable instructions 62, such as steps S101 to S102 shown in FIG. 1 and steps S201 to S203 shown in FIG. 2, FIG. Steps S1031 to S1032 are shown, and steps S401 to S406 shown in FIG. 4 are shown. Alternatively, the functions of the modules/units in the apparatus embodiment for implementing the above-described order asynchronous processing when the processor 60 executes the computer readable instructions 62, such as the functions of the modules 51 to 58 shown in FIG.
示例性的,所述计算机可读指令62可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器61中,并由所述处理器60执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机可读指令62在所述终端6中的执行过程。例如,所述计算机可读指令62可以被分割成订单缓存模块、订单处理模块、回调模块,各模块具体功能如下:Illustratively, the computer readable instructions 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60, To complete this application. The one or more modules/units may be a series of computer readable instruction segments capable of performing a particular function for describing the execution of the computer readable instructions 62 in the terminal 6. For example, the computer readable instructions 62 may be divided into an order cache module, an order processing module, and a callback module, and the specific functions of each module are as follows:
订单缓存模块,用于当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;An order cache module, configured to: when receiving an order transaction request sent by the front-end device, buffer the order transaction request into a message queue, and send a response message to the front-end device to notify the front-end device of the order transaction The request has been successfully received;
订单处理模块,用于按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;An order processing module, configured to read an order transaction request from the message queue in a first-in first-out order, execute a transaction operation corresponding to the order transaction request, and obtain a transaction result;
回调模块,用于获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。a callback module, configured to obtain the transaction result, and the uniform resource locator provided by the callback front end device returns the transaction result to the front end device to notify the front end device that the order transaction request has been successfully executed and the corresponding transaction result.
进一步地,所述计算机可读指令62还可以分割出:Further, the computer readable instructions 62 can also be segmented:
存储模块,用于在将所述订单交易请求缓存至消息队列前,将所述订单交易请求保存至MongoDB数据库中;a storage module, configured to save the order transaction request to a MongoDB database before caching the order transaction request to a message queue;
更新模块,用于在得到交易结果后,根据所述交易结果回写MongoDB数据库中所述订 单交易请求对应的状态信息。An update module, configured to, after obtaining the transaction result, write back the subscription in the MongoDB database according to the transaction result Status information corresponding to a single transaction request.
进一步地,所述请求处理模块还可以包括:Further, the request processing module may further include:
启动单元,用于启动多线程;a startup unit for starting multithreading;
多线程处理单元,用于按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;a multi-thread processing unit, configured to read an order transaction request from the message queue in a first-in first-out order, and allocate the read order transaction request to one of the multi-threads, and execute through the allocated thread The transaction operation corresponding to the order transaction request;
所述回调模块还用于:The callback module is also used to:
在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
进一步地,所述计算机可读指令62还可以分割出:Further, the computer readable instructions 62 can also be segmented:
过滤模块,用于获取交易操作执行过程中产生的收益数据,对所述收益数据进行过滤;a filtering module, configured to obtain revenue data generated during execution of the transaction operation, and filter the revenue data;
片段生成模块,用于启动读写双线程,通过读线程读取过滤后的收益数据写入至内存队列中,同时并行地通过写线程从所述内存队列中读出收益数据写入至收益文件片段中;a fragment generation module, configured to start reading and writing dual threads, and reading the filtered profit data by reading the thread to write to the memory queue, and simultaneously reading the profit data from the memory queue and writing the income data to the income file through the write thread in parallel In the fragment;
片段上传模块,用于每当有收益文件片段写完时,将所述收益文件片段上传至前端设备。The segment uploading module is configured to upload the revenue file segment to the front end device whenever the profit file segment is written.
所述终端6可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端可包括,但不仅限于,处理器60、存储器61。本领域技术人员可以理解,图6仅仅是终端6的示例,并不构成对终端6的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端还可以包括输入输出设备、网络接入设备、总线等。The terminal 6 can be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The terminal may include, but is not limited to, a processor 60, a memory 61. It will be understood by those skilled in the art that FIG. 6 is merely an example of the terminal 6, and does not constitute a limitation of the terminal 6, and may include more or less components than those illustrated, or combine some components, or different components, such as The terminal may also include an input/output device, a network access device, a bus, and the like.
所称处理器60可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器是所述终端的控制中心,利用各种接口和线路连接整个终端的各个部分。The processor 60 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like, which is a control center of the terminal, and connects various parts of the entire terminal using various interfaces and lines.
所述存储器61可用于存储所述计算机可读指令和/或模块,所述处理器通过运行或执行存储在所述存储器内的计算机可读指令和/或模块,以及调用存储在存储器内的数据,实现所述终端的各种功能。所述存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端的使用所创建的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘、智能存储卡(Smart Media  Card,SMC)、安全数字卡(Secure Digital,SD)、闪存卡(Flash Card),至少一个磁盘存储器件、闪存器件或其他易失性固态存储器件。The memory 61 can be used to store the computer readable instructions and/or modules by running or executing computer readable instructions and/or modules stored in the memory, and recalling data stored in the memory Implementing various functions of the terminal. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored. Data created based on the use of the terminal, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media) Card, SMC), Secure Digital (SD), Flash Card, at least one disk storage device, flash memory device or other volatile solid-state storage device.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided by the present application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other manners. For example, the device/terminal device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units. Or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读 存储介质不包括是电载波信号和电信信号。The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the processes in the foregoing embodiments, and may also be implemented by computer readable instructions, which may be stored in a computer readable storage medium. The computer readable instructions, when executed by a processor, may implement the steps of the various method embodiments described above. Wherein, the computer readable instructions comprise computer readable instruction code, which may be in the form of source code, an object code form, an executable file or some intermediate form or the like. The computer readable storage medium may include any entity or device capable of carrying the computer readable instruction code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read only memory (ROM, Read- Only Memory), Random Access Memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the computer readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable The storage medium does not include an electrical carrier signal and a telecommunication signal.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。 The above-mentioned embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still implement the foregoing embodiments. The technical solutions described in the examples are modified or equivalently replaced with some of the technical features; and the modifications or substitutions do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种订单异步处理的方法,其特征在于,所述方法包括:A method for asynchronously processing an order, the method comprising:
    当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;Receiving the order transaction request sent by the front-end device, buffering the order transaction request into the message queue, and sending a response message to the front-end device to notify the front-end device that the order transaction request has been successfully received;
    按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;Reading an order transaction request from the message queue in a first-in first-out order, executing a transaction operation corresponding to the order transaction request, and obtaining a transaction result;
    获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。Acquiring the transaction result, and returning the uniform resource locator provided by the front-end device to return the transaction result to the front-end device, to inform the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
  2. 如权利要求1所述的订单异步处理的方法,其特征在于,在将所述订单交易请求缓存至消息队列前,所述方法还包括:The method of processing an order asynchronous process according to claim 1, wherein before the buffering the order transaction request to the message queue, the method further comprises:
    将所述订单交易请求保存至MongoDB数据库中;Saving the order transaction request to the MongoDB database;
    在得到交易结果后,所述方法还包括:After obtaining the transaction result, the method further includes:
    根据所述交易结果回写MongoDB数据库中所述订单交易请求对应的状态信息。And returning status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
  3. 如权利要求1所述的订单异步处理的方法,其特征在于,所述按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果包括:The method for asynchronous processing of an order according to claim 1, wherein said reading an order transaction request from said message queue in a first-in first-out order, executing a transaction operation corresponding to said order transaction request, and obtaining a transaction result include:
    启动多线程;Start multithreading;
    按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;Reading an order transaction request from the message queue in a first-in first-out order, and allocating the read order transaction request to one of the multi-threads, and executing the order transaction request by the allocated thread Trading operation
    所述回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备包括:Returning the transaction result to the front-end device by using the uniform resource locator provided by the callback front-end device includes:
    在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  4. 如权利要求2所述的订单异步处理的方法,其特征在于,所述按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果包括:The method for asynchronous processing of an order according to claim 2, wherein said reading an order transaction request from said message queue in a first-in first-out order, executing a transaction operation corresponding to said order transaction request, and obtaining a transaction result include:
    启动多线程;Start multithreading;
    按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作; Reading an order transaction request from the message queue in a first-in first-out order, and allocating the read order transaction request to one of the multi-threads, and executing the order transaction request by the allocated thread Trading operation
    所述回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备包括:Returning the transaction result to the front-end device by using the uniform resource locator provided by the callback front-end device includes:
    在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  5. 如权利要求3或4所述的订单异步处理的方法,其特征在于,在按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作后,所述方法还包括:The method for asynchronous processing of an order according to claim 3 or 4, wherein after the order transaction request is read from the message queue in a first-in first-out order, and the transaction operation corresponding to the order transaction request is executed, The method also includes:
    获取交易操作执行过程中产生的收益数据,对所述收益数据进行过滤;Obtaining revenue data generated during the execution of the transaction operation, and filtering the revenue data;
    启动读写双线程,通过读线程读取过滤后的收益数据写入至内存队列中,同时并行地通过写线程从所述内存队列中读出收益数据写入至收益文件片段中;Starting to read and write dual threads, reading the filtered profit data through the read thread to write to the memory queue, and simultaneously reading the profit data from the memory queue through the write thread into the income file segment;
    每当有收益文件片段写完时,将所述收益文件片段上传至前端设备。The revenue file segment is uploaded to the front end device whenever a revenue file segment is written.
  6. 一种订单异步处理的装置,其特征在于,所述装置包括:An apparatus for asynchronously processing an order, wherein the apparatus comprises:
    订单缓存模块,用于当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;An order cache module, configured to: when receiving an order transaction request sent by the front-end device, buffer the order transaction request into a message queue, and send a response message to the front-end device to notify the front-end device of the order transaction The request has been successfully received;
    订单处理模块,用于按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;An order processing module, configured to read an order transaction request from the message queue in a first-in first-out order, execute a transaction operation corresponding to the order transaction request, and obtain a transaction result;
    回调模块,用于获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。a callback module, configured to obtain the transaction result, and the uniform resource locator provided by the callback front end device returns the transaction result to the front end device to notify the front end device that the order transaction request has been successfully executed and the corresponding transaction result.
  7. 如权利要求6所述的订单异步处理的装置,其特征在于,所述装置还包括:The device for asynchronously processing an order according to claim 6, wherein the device further comprises:
    存储模块,用于在将所述订单交易请求缓存至消息队列前,将所述订单交易请求保存至MongoDB数据库中;a storage module, configured to save the order transaction request to a MongoDB database before caching the order transaction request to a message queue;
    更新模块,用于在得到交易结果后,根据所述交易结果回写MongoDB数据库中所述订单交易请求对应的状态信息。And an update module, configured to, after obtaining the transaction result, write back status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
  8. 如权利要求6所述的订单异步处理的装置,其特征在于,所述请求处理模块包括:The apparatus for asynchronously processing an order according to claim 6, wherein the request processing module comprises:
    启动单元,用于启动多线程;a startup unit for starting multithreading;
    多线程处理单元,用于按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;a multi-thread processing unit, configured to read an order transaction request from the message queue in a first-in first-out order, and allocate the read order transaction request to one of the multi-threads, and execute through the allocated thread The transaction operation corresponding to the order transaction request;
    所述回调模块还用于:The callback module is also used to:
    在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的 订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, each thread will call back the uniform resource locator provided by the front-end device to process the processed The transaction result of the order transaction request is returned to the front end device.
  9. 如权利要求7所述的订单异步处理的装置,其特征在于,所述请求处理模块包括:The apparatus for asynchronously processing an order according to claim 7, wherein the request processing module comprises:
    启动单元,用于启动多线程;a startup unit for starting multithreading;
    多线程处理单元,用于按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;a multi-thread processing unit, configured to read an order transaction request from the message queue in a first-in first-out order, and allocate the read order transaction request to one of the multi-threads, and execute through the allocated thread The transaction operation corresponding to the order transaction request;
    所述回调模块还用于:The callback module is also used to:
    在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  10. 如权利要求8或9所述的订单异步处理的装置,其特征在于,所述装置还包括:The device for asynchronously processing an order according to claim 8 or 9, wherein the device further comprises:
    过滤模块,用于获取交易操作执行过程中产生的收益数据,对所述收益数据进行过滤;a filtering module, configured to obtain revenue data generated during execution of the transaction operation, and filter the revenue data;
    片段生成模块,用于启动读写双线程,通过读线程读取过滤后的收益数据写入至内存队列中,同时并行地通过写线程从所述内存队列中读出收益数据写入至收益文件片段中;a fragment generation module, configured to start reading and writing dual threads, and reading the filtered profit data by reading the thread to write to the memory queue, and simultaneously reading the profit data from the memory queue and writing the income data to the income file through the write thread in parallel In the fragment;
    片段上传模块,用于每当有收益文件片段写完时,将所述收益文件片段上传至前端设备。The segment uploading module is configured to upload the revenue file segment to the front end device whenever the profit file segment is written.
  11. 一种计算机可读存储介质,其上存储有计算机可读指令,其特征在于,该计算机可读指令被处理器执行时实现如下步骤:A computer readable storage medium having stored thereon computer readable instructions, wherein the computer readable instructions are executed by a processor to:
    当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;Receiving the order transaction request sent by the front-end device, buffering the order transaction request into the message queue, and sending a response message to the front-end device to notify the front-end device that the order transaction request has been successfully received;
    按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;Reading an order transaction request from the message queue in a first-in first-out order, executing a transaction operation corresponding to the order transaction request, and obtaining a transaction result;
    获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。Acquiring the transaction result, and returning the uniform resource locator provided by the front-end device to return the transaction result to the front-end device, to inform the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
  12. 如权利要求11所述的计算机可读存储介质,其特征在于,所述将所述订单交易请求缓存至消息队列,之前还包括:The computer readable storage medium of claim 11, wherein the buffering the order transaction request to a message queue further comprises:
    将所述订单交易请求保存至MongoDB数据库中;Saving the order transaction request to the MongoDB database;
    在得到交易结果后,所述方法还包括:After obtaining the transaction result, the method further includes:
    根据所述交易结果回写MongoDB数据库中所述订单交易请求对应的状态信息。And returning status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
  13. 如权利要求11所述的计算机可读存储介质,其特征在于,所述按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果,包括: The computer readable storage medium according to claim 11, wherein said reading an order transaction request from said message queue in a first in first out order, executing a transaction operation corresponding to said order transaction request, and obtaining a transaction result , including:
    启动多线程;Start multithreading;
    按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;Reading an order transaction request from the message queue in a first-in first-out order, and allocating the read order transaction request to one of the multi-threads, and executing the order transaction request by the allocated thread Trading operation
    所述回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,包括:The uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device, including:
    在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  14. 如权利要求12所述的计算机可读存储介质,其特征在于,所述按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果,包括:The computer readable storage medium according to claim 12, wherein said reading an order transaction request from said message queue in a first in first out order, executing a transaction operation corresponding to said order transaction request, and obtaining a transaction result ,include:
    启动多线程;Start multithreading;
    按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;Reading an order transaction request from the message queue in a first-in first-out order, and allocating the read order transaction request to one of the multi-threads, and executing the order transaction request by the allocated thread Trading operation
    所述回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,包括:The uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device, including:
    在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  15. 如权利要求13或14所述的计算机可读存储介质,其特征在于,所述按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,之后还包括:The computer readable storage medium according to claim 13 or 14, wherein said reading an order transaction request from said message queue in a first in first out order, executing a transaction operation corresponding to said order transaction request, and thereafter Also includes:
    获取交易操作执行过程中产生的收益数据,对所述收益数据进行过滤;Obtaining revenue data generated during the execution of the transaction operation, and filtering the revenue data;
    启动读写双线程,通过读线程读取过滤后的收益数据写入至内存队列中,同时并行地通过写线程从所述内存队列中读出收益数据写入至收益文件片段中;Starting to read and write dual threads, reading the filtered profit data through the read thread to write to the memory queue, and simultaneously reading the profit data from the memory queue through the write thread into the income file segment;
    每当有收益文件片段写完时,将所述收益文件片段上传至前端设备。The revenue file segment is uploaded to the front end device whenever a revenue file segment is written.
  16. 一种终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现以下步骤:A terminal comprising a memory, a processor, and computer readable instructions stored on the memory and operable on the processor, wherein the processor, when executing the computer readable instructions, implements the following steps:
    当接收到前端设备发送的订单交易请求时,将所述订单交易请求缓存至消息队列中,并向所述前端设备发送响应消息,以告知所述前端设备所述订单交易请求已成功接收;Receiving the order transaction request sent by the front-end device, buffering the order transaction request into the message queue, and sending a response message to the front-end device to notify the front-end device that the order transaction request has been successfully received;
    按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果;Reading an order transaction request from the message queue in a first-in first-out order, executing a transaction operation corresponding to the order transaction request, and obtaining a transaction result;
    获取所述交易结果,回调前端设备提供的统一资源定位符将所述交易结果返回至所述 前端设备,以告知所述前端设备所述订单交易请求已成功执行及对应的交易结果。Obtaining the transaction result, and returning the uniform resource locator provided by the front-end device to return the transaction result to the a front-end device to inform the front-end device that the order transaction request has been successfully executed and the corresponding transaction result.
  17. 如权利要求16所述的终端,其特征在于,所述将所述订单交易请求缓存至消息队列,之前还包括:The terminal according to claim 16, wherein said buffering said order transaction request to a message queue further comprises:
    将所述订单交易请求保存至MongoDB数据库中;Saving the order transaction request to the MongoDB database;
    在得到交易结果后,所述方法还包括:After obtaining the transaction result, the method further includes:
    根据所述交易结果回写MongoDB数据库中所述订单交易请求对应的状态信息。And returning status information corresponding to the order transaction request in the MongoDB database according to the transaction result.
  18. 如权利要求16所述的终端,其特征在于,所述按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果,包括:The terminal according to claim 16, wherein the reading an order transaction request from the message queue in a first-in first-out order, executing a transaction operation corresponding to the order transaction request, and obtaining a transaction result, including:
    启动多线程;Start multithreading;
    按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;Reading an order transaction request from the message queue in a first-in first-out order, and allocating the read order transaction request to one of the multi-threads, and executing the order transaction request by the allocated thread Trading operation
    所述回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,包括:The uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device, including:
    在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  19. 如权利要求17所述的终端,其特征在于,所述按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,得到交易结果,包括:The terminal according to claim 17, wherein the order transaction request is read from the message queue in a first-in-first-out order, and the transaction operation corresponding to the order transaction request is executed to obtain a transaction result, including:
    启动多线程;Start multithreading;
    按照先进先出顺序从所述消息队列中读取订单交易请求,并将所读取的订单交易请求分配给所述多线程中的一个线程,通过所分配的线程执行所述订单交易请求对应的交易操作;Reading an order transaction request from the message queue in a first-in first-out order, and allocating the read order transaction request to one of the multi-threads, and executing the order transaction request by the allocated thread Trading operation
    所述回调前端设备提供的统一资源定位符将所述交易结果返回至所述前端设备,包括:The uniform resource locator provided by the callback front-end device returns the transaction result to the front-end device, including:
    在交易请求处理完后,由每一个线程回调前端设备提供的统一资源定位符将所处理的订单交易请求的交易结果返回至所述前端设备。After the transaction request is processed, the uniform resource locator provided by the front-end device is returned by each thread to return the transaction result of the processed order transaction request to the front-end device.
  20. 如权利要求18或19所述的终端,其特征在于,所述按照先进先出顺序从所述消息队列中读取订单交易请求,执行所述订单交易请求对应的交易操作,之后还包括:The terminal according to claim 18 or 19, wherein the order transaction request is read from the message queue in a first-in first-out order, and the transaction operation corresponding to the order transaction request is executed, and further includes:
    获取交易操作执行过程中产生的收益数据,对所述收益数据进行过滤;Obtaining revenue data generated during the execution of the transaction operation, and filtering the revenue data;
    启动读写双线程,通过读线程读取过滤后的收益数据写入至内存队列中,同时并行地通过写线程从所述内存队列中读出收益数据写入至收益文件片段中;Starting to read and write dual threads, reading the filtered profit data through the read thread to write to the memory queue, and simultaneously reading the profit data from the memory queue through the write thread into the income file segment;
    每当有收益文件片段写完时,将所述收益文件片段上传至前端设备。 The revenue file segment is uploaded to the front end device whenever a revenue file segment is written.
PCT/CN2017/112761 2017-08-17 2017-11-24 Method and apparatus for asynchronous order processing, and storage medium and terminal WO2019033605A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710706714.8 2017-08-17
CN201710706714.8A CN107679931A (en) 2017-08-17 2017-08-17 Method, apparatus, storage medium and the terminal of order asynchronous process

Publications (1)

Publication Number Publication Date
WO2019033605A1 true WO2019033605A1 (en) 2019-02-21

Family

ID=61134289

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/112761 WO2019033605A1 (en) 2017-08-17 2017-11-24 Method and apparatus for asynchronous order processing, and storage medium and terminal

Country Status (2)

Country Link
CN (1) CN107679931A (en)
WO (1) WO2019033605A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112950307A (en) * 2021-01-29 2021-06-11 成都环宇知了科技有限公司 Swoole framework-based second killing method and system

Families Citing this family (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107872398A (en) * 2017-06-25 2018-04-03 平安科技(深圳)有限公司 High concurrent data processing method, device and computer-readable recording medium
CN108418821B (en) * 2018-03-06 2021-06-18 北京焦点新干线信息技术有限公司 Redis and Kafka-based high-concurrency scene processing method and device for online shopping system
CN110297708B (en) * 2018-03-22 2023-04-28 阿里巴巴集团控股有限公司 Ticket issuing processing and scheduling method, server and ticket issuing platform
CN110196769A (en) * 2018-04-19 2019-09-03 财付通支付科技有限公司 A kind of information processing method, device, server and storage medium
CN108595282A (en) * 2018-05-02 2018-09-28 广州市巨硅信息科技有限公司 A kind of implementation method of high concurrent message queue
CN108765083B (en) * 2018-05-30 2023-06-02 平安科技(深圳)有限公司 Routing order configuration and processing method and system
CN110659124A (en) * 2018-06-28 2020-01-07 北京京东尚科信息技术有限公司 Message processing method and device
CN109472577A (en) * 2018-09-26 2019-03-15 中国平安人寿保险股份有限公司 Account keeps accounts method, apparatus, computer equipment and storage medium
CN109214938A (en) * 2018-10-08 2019-01-15 中国平安财产保险股份有限公司 Insure asynchronous price quoting method, device, computer equipment and storage medium
CN109862063A (en) * 2018-11-12 2019-06-07 平安科技(深圳)有限公司 Distribution subscription matching process, device and storage medium based on MQTT
CN109492016A (en) * 2018-11-19 2019-03-19 中国银联股份有限公司 A kind of exchange settlement method and device
CN109670958A (en) * 2018-12-26 2019-04-23 中国银联股份有限公司 A kind of method of commerce and device
CN109783254A (en) * 2019-01-02 2019-05-21 深圳壹账通智能科技有限公司 Asynchronism callback method, apparatus, computer equipment and storage medium
CN110413424B (en) * 2019-07-24 2021-12-10 深圳乐信软件技术有限公司 Configurable third-party message callback method, device, server and storage medium
CN110473097B (en) * 2019-08-06 2023-05-02 深圳证券交易所 Transaction monitoring method, terminal and computer readable storage medium
CN111061804B (en) * 2019-10-30 2023-09-29 平安科技(深圳)有限公司 Asynchronous data processing method, device, equipment and storage medium based on big data
CN111080888B (en) * 2019-12-18 2021-12-24 中体彩科技发展有限公司 Number limiting processing method and system for lottery betting
CN111179080B (en) * 2019-12-23 2023-10-27 中国建设银行股份有限公司 Order processing method and order processing device
CN111242621B (en) * 2020-01-16 2023-07-28 广州虎牙科技有限公司 Transaction data storage method, device, equipment and storage medium
CN111429059A (en) * 2020-03-20 2020-07-17 上海中通吉网络技术有限公司 Order receiving method and system
CN111562995A (en) * 2020-04-30 2020-08-21 成都库珀区块链科技有限公司 Method, system and related device for processing transaction message
CN111694683A (en) * 2020-06-22 2020-09-22 中国银行股份有限公司 Data processing method and device, computer equipment and computer readable storage medium
CN112148441A (en) * 2020-07-28 2020-12-29 易视飞科技成都有限公司 Embedded message queue realizing method of dynamic storage mode
CN111930801A (en) * 2020-07-31 2020-11-13 银盛通信有限公司 Order processing system and method based on non-relational database
CN112333083B (en) * 2020-10-30 2023-04-28 平安付科技服务有限公司 Transaction information processing method, device, computer equipment and computer readable medium
CN112561650B (en) * 2020-12-17 2024-02-02 深圳希施玛数据科技有限公司 Order service request processing system
CN112561687A (en) * 2020-12-18 2021-03-26 厦门投融汇网络有限公司 Multithreading account fund asynchronous processing method
CN113312538B (en) * 2021-07-30 2022-02-25 深圳市工易付电子科技有限公司 Transaction query method, device, equipment and readable storage medium
CN113934541B (en) * 2021-10-15 2022-07-08 珠海百丰网络科技有限公司 Financial terminal data identification and processing system and method connected with Internet of things

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102194011A (en) * 2011-06-17 2011-09-21 北京互信互通信息技术股份有限公司 Multi-path video data read-write method
US20120005174A1 (en) * 2010-07-02 2012-01-05 Exact Solutions, Inc. Method and a system for replaying database workload with transactional consistency
CN105183549A (en) * 2015-08-27 2015-12-23 携程计算机技术(上海)有限公司 Automatic ticketing system based on task assignment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030036966A1 (en) * 2001-08-16 2003-02-20 International Business Machines Corporation Computer system, method, and business method for integrating an e-commerce application with a back-end business processing application
CN103856724B (en) * 2012-12-05 2017-03-29 成都索贝数码科技股份有限公司 It is a kind of to make emergency system
CN104112010B (en) * 2014-07-16 2017-09-01 深圳国泰安教育技术股份有限公司 A kind of date storage method and device
CN105160570A (en) * 2015-09-15 2015-12-16 浪潮软件股份有限公司 Concurrent on-line transaction processing method capable of horizontal expansion
CN105224651A (en) * 2015-09-30 2016-01-06 国网天津市电力公司 A kind of infosystem intranet and extranet database optimizing method based on read and write abruption
CN105357266B (en) * 2015-09-30 2018-11-16 山东乾云启创信息科技股份有限公司 It is suitble to the SOCKET communication and management of process general-purpose platform and method of several scenes
CN105468784A (en) * 2015-12-24 2016-04-06 北京京东尚科信息技术有限公司 Method and device for processing highly concurrent traffic
CN106156309A (en) * 2016-07-01 2016-11-23 五八同城信息技术有限公司 Method for reading data and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120005174A1 (en) * 2010-07-02 2012-01-05 Exact Solutions, Inc. Method and a system for replaying database workload with transactional consistency
CN102194011A (en) * 2011-06-17 2011-09-21 北京互信互通信息技术股份有限公司 Multi-path video data read-write method
CN105183549A (en) * 2015-08-27 2015-12-23 携程计算机技术(上海)有限公司 Automatic ticketing system based on task assignment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112950307A (en) * 2021-01-29 2021-06-11 成都环宇知了科技有限公司 Swoole framework-based second killing method and system

Also Published As

Publication number Publication date
CN107679931A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
WO2019033605A1 (en) Method and apparatus for asynchronous order processing, and storage medium and terminal
CN107169083B (en) Mass vehicle data storage and retrieval method and device for public security card port and electronic equipment
US11422982B2 (en) Scaling stateful clusters while maintaining access
US10069916B2 (en) System and method for transparent context aware filtering of data requests
WO2020233212A1 (en) Log record processing method, server, and storage medium
US9836516B2 (en) Parallel scanners for log based replication
US8903782B2 (en) Application instance and query stores
WO2013078583A1 (en) Method and apparatus for optimizing data access, method and apparatus for optimizing data storage
CN104580437A (en) Cloud storage client and high-efficiency data access method thereof
US9613082B2 (en) Database auditing for bulk operations
US9817753B2 (en) Flash memory management
WO2020047840A1 (en) Bill information caching method, bill information query method and terminal device
CN105069151A (en) HBase secondary index construction apparatus and method
US11836132B2 (en) Managing persistent database result sets
CN102567378A (en) Information retrieval system based on heterogeneous data
US20230418811A1 (en) Transaction processing method and apparatus, computing device, and storage medium
US20160055195A1 (en) Method and system for providing concurrent buffer pool and page cache
CN105989065B (en) Flash data processing method and system
CN113010334A (en) Request processing method, device and equipment
CN103645873A (en) Method for achieving high-efficiency data caching in trend curve system
CN108280123B (en) HBase column polymerization method
CN113190528A (en) Parallel distributed big data architecture construction method and system
CN105740166A (en) Cache reading and reading processing method and device
US20200379775A1 (en) Techniques for accelerating compaction
US20210319031A1 (en) Managing Real Time Data Stream Processing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17921456

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17921456

Country of ref document: EP

Kind code of ref document: A1