Method, device, apparatus and computer-readable medium for processing orders

By converting the order information into a memory model and verifying it in the memory, the problem of low order verification efficiency in the existing technology is solved, and stable processing efficiency improvement under high concurrency is achieved.

CN111861649BActive Publication Date: 2024-09-24CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010645847.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-07
Publication Date
2024-09-24
Estimated Expiration
2040-07-07

AI Technical Summary

Technical Problem

In the transaction process of commodity payment clearing, the order verification efficiency in the existing technology is low, especially in high concurrency situations, resulting in a decrease in processing efficiency.

Method used

By parsing the order request message, converting it into a memory model and storing it in the memory, including the order management class and payment refund management class, the request object is locked to ensure data consistency, and the amount and payer are verified in the memory model. After passing the verification, the order information is persisted to the database.

Benefits of technology

It improves the efficiency of order verification, avoids the need to repeatedly write code under different hardware and operating systems, achieves consistency in memory access, and ensures the stability of order processing under high concurrency conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111861649B
    Figure CN111861649B
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and computer-readable medium for processing orders, and relates to the field of computer technology. A specific implementation of the method includes: parsing an order request message to obtain order information; converting the order information into a memory model and storing it in a memory, wherein the memory model includes an order management class and a payment refund management class; verifying the amount, payee and payee in the memory model, and persisting the order information to a database after the memory model is verified. This implementation can improve the efficiency of verifying orders.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and computer-readable medium for processing an order. Background Art

[0002] With the development of Internet technology, more and more users are purchasing a variety of goods through the Internet. Merchants use direct bank-enterprise connections to complete transaction processes involving commodity payment settlement with the help of banks.

[0003] Bank-enterprise direct connection is a way provided by banks for users to connect with merchants' online banking systems. It realizes the networking connection between the internal systems of banks and merchants through the Internet.

[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: in the transaction process involving the settlement of commodity payment, the efficiency of verifying orders is low. Summary of the invention

[0005] In view of this, embodiments of the present invention provide a method, apparatus, device and computer-readable medium for processing an order, which can improve the efficiency of verifying an order.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for processing an order is provided, comprising:

[0007] Parse the order request message to obtain order information;

[0008] Convert the order information into a memory model and store it in the memory, wherein the memory model includes an order management class and a payment refund management class;

[0009] The amount, payee and payee in the memory model are verified. After the memory model is verified, the order information is persisted to the database.

[0010] The method of converting the order information into a memory model and storing the model in the server memory further includes:

[0011] A lock request object includes one or more types of the order request message, including order placement, payment, and refund.

[0012] The order request message is an order request message;

[0013] The converting the order information into a memory model and storing the model in the memory includes:

[0014] Convert the order information into a memory model and store it in the memory;

[0015] Generate contract order number using database sequence.

[0016] The order request message includes a main-sub-order order request message, and the main-sub-order order request message includes main order information and sub-location information;

[0017] The verifying the amount, payee and payee in the memory model includes:

[0018] Verify the amount in the main order information, the amount in the sub-order information, the payee in the main order information, the payee in the sub-order information, the payee in the main order information and the payee in the sub-order information.

[0019] The order request message is a payment request message or a refund request message;

[0020] The converting the order information into a memory model and storing the model in the memory includes:

[0021] A lock request object, wherein the request object includes the contract order number of the order request message;

[0022] The order information is converted into a memory model and stored in the memory.

[0023] The lock request object includes:

[0024] The key-value pair in the redis database lock is added to the redis database to lock the request object, wherein the primary key in the key-value pair is generated based on the contract order number in the order information.

[0025] The lock request object includes:

[0026] Insert the key-value pair corresponding to the contract order number into the database table to lock the request object. The database table belongs to the Oracle database.

[0027] The key-value pair corresponding to the contract order number is inserted into the database table to lock the request object, including:

[0028] Insert the key-value pair corresponding to the contract order number into the database table. No error message is received to lock the request object.

[0029] The key-value pair corresponding to the contract order number is inserted into the database table to lock the request object, and the key-value pair corresponding to the contract order number is inserted into the database table to lock the request object, including:

[0030] Insert the key-value pair corresponding to the contract order number into the database table, receive an error message, and determine that the expiration time of the lock request object is earlier than the current time;

[0031] The expiration time is updated according to the current time to lock the requested object.

[0032] The order request message is a payment request message or a refund request message;

[0033] The verifying the amount, payee and payee in the memory model includes:

[0034] The amount, payee and payee in the memory model are verified, wherein the verification includes a repeat verification and / or a timeout verification.

[0035] The order request message includes a payment request message, and the payment request message includes the entire payment request or a portion of the payment request.

[0036] The order request message includes a refund request message, and the refund request message includes a full refund request or a partial refund request.

[0037] According to a second aspect of an embodiment of the present invention, there is provided a device for processing an order, comprising:

[0038] A parsing module, used to parse the order request message to obtain order information;

[0039] A conversion module, used to convert the order information into a memory model and store it in the memory, wherein the memory model includes an order management class and a payment refund management class;

[0040] The storage module is used to verify the amount, payee and payee in the memory model. After the memory model is verified, the order information is persisted to the database.

[0041] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for processing an order, comprising:

[0042] one or more processors;

[0043] a storage device for storing one or more programs,

[0044] When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.

[0045] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method as described above is implemented.

[0046] An embodiment of the above invention has the following advantages or beneficial effects: parsing the order request message to obtain the order information; converting the order information into a memory model and storing it in the memory, the memory model includes an order management class and a payment refund management class; verifying the amount, payee and payee in the memory model, and persisting the order information to the database after the memory model is verified. By converting the order information into a memory model, different hardware and operating systems can access the memory model without repeatedly writing code, achieving consistency in memory access, thereby improving the efficiency of verifying orders.

[0047] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0049] Figure 1 This is a schematic diagram of the current order processing process;

[0050] Figure 2 is a schematic diagram of the main process of the method for processing an order according to an embodiment of the present invention;

[0051] Figure 3 is a class diagram corresponding to the memory model according to an embodiment of the present invention;

[0052] Figure 4 is a schematic diagram of a lock interface class according to an embodiment of the present invention;

[0053] Figure 5 is a schematic diagram of abstract methods included in an interface class according to an embodiment of the present invention;

[0054] Figure 6 1 is a schematic diagram of a locking process of an Oracle data lock according to an embodiment of the present invention;

[0055] Figure 7 1 is a schematic diagram of an unlocking process of an Oracle data lock according to an embodiment of the present invention;

[0056] Figure 8 is a schematic diagram of the main structure of an apparatus for processing orders according to an embodiment of the present invention;

[0057] Fig. 9 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0058] Fig.10 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0060] At present, in the transaction process involving commodity payment settlement, the following solutions can be adopted:

[0061] Process the order request message sent through the bank-enterprise direct connection, parse and complete the processing of order placement, payment and refund functions, and return the processing results.

[0062] See also Figure 1 , Figure 1 This is a schematic diagram of the current order processing process, with the following steps:

[0063] 1. Order request message

[0064] Send order request message through the bank-enterprise direct connection channel.

[0065] 2. Message conversion

[0066] After the first message conversion on the switching platform, it reaches the back-end server.

[0067] 3. Message format verification.

[0068] The backend server performs a format check on the order request message and the check is successful.

[0069] 4. Parse and convert messages.

[0070] The backend server parses and converts the successfully verified messages.

[0071] 5. Rule verification.

[0072] The back-end server interacts with the Oracle database to perform logic verification.

[0073] 6. Persistent database.

[0074] The back-end server interacts with the Oracle database to store information.

[0075] 7. Return processing results

[0076] The backend server returns the processing result of the message

[0077] In the above solution, although orders can be processed, different codes are difficult to reuse for different transaction scenarios, and the development cost is very high. In addition, when order request messages are highly concurrent, the number of interactions with the database library is high, resulting in a linear increase in transaction time.

[0078] In summary, in the transaction process involving commodity payment settlement, the efficiency of verifying orders is low.

[0079] In order to solve the technical problem of low efficiency in verifying orders, the following technical solution in the embodiment of the present invention may be adopted.

[0080] See also Figure 2 , Figure 2 is a schematic diagram of the main process of the method for processing an order according to an embodiment of the present invention, in which the order information is converted into a memory model and verified so as to be persisted in a database. Figure 2 As shown, the specific steps include:

[0081] S201. Parse the order request message to obtain order information.

[0082] In the transaction process involving commodity payment settlement, the order request message sent through the bank-enterprise direct connection channel is converted by the exchange platform and reaches the back-end server. The back-end server performs format verification on the converted message, and then parses the message that succeeds the verification to obtain the order information.

[0083] The order information is the order-related information in the order request message. As an example, the order information may include the amount, the payee, and the payee.

[0084] S202: Convert the order information into a memory model and store it in the memory. The memory model includes an order management class and a payment refund management class.

[0085] The memory model can be called the Java memory model, which is used to shield the differences in memory access of Java programs on various hardware and operating systems, so that Java programs can achieve consistency in memory access on various platforms.

[0086] The order information is converted into a memory model. Order request messages on different platforms can access the memory model without re-editing the code, which is convenient for parameter transmission. The data involved in the order request message is stored in the memory and can be obtained by other programs at any time. In addition, the unified memory model is more convenient for storage and facilitates persistence operations.

[0087] Specifically, the order information is converted into a memory model and stored in the memory instead of in the database, so that the order information can be directly obtained from the memory without going through the database.

[0088] In the embodiment of the present invention, the memory model includes an order management class and a payment refund management class. That is, the memory model can execute an order through the order management class, and can execute a payment or refund through the payment refund management class.

[0089] See also Figure 3 , Figure 3 : is a class diagram corresponding to the memory model according to an embodiment of the present invention. The memory model includes a payment and order management center class. The payment and order management center class has a payment refund management class and an order management class. The payment refund management class has an accounting information management class. The order management class has an order information management class. It can be understood that the memory model includes an order management class and a payment refund management class.

[0090] In one embodiment of the present invention, when the order request message is an order request message, the order information is converted into a memory model, stored in the memory, and a contract order number is generated using a database sequence.

[0091] The contract order number is the primary key of the system order table generated when an order is created, and is used to identify the uniqueness of the order. Payment and refunds also need to be processed based on the contract order number.

[0092] As an example, the contract order number is composed of the order type, the time when the contract order number is generated, and a digital sequence. The digital sequence is generated by a database sequence. The order types include order placement, payment, and refund.

[0093] In one embodiment of the present invention, the applicant has found in practice that, in the case of high concurrency of order request messages, the order status is chaotic, resulting in a sharp drop in the efficiency of processing orders.

[0094] As an example, at a first time point, an order request message includes an order with contract order number 1 involving payment; at a second time point, another order request message includes an order with contract order number 1 involving refund. Since the above two order request messages involve the same contract order number, the orders with the same contract order number are confused, and it is difficult to process the order request message involving contract order number 1 in a timely manner within a short time point.

[0095] In the embodiment of the present invention, the request object can be locked according to the transaction type, that is, the request object can be locked by a database lock. It can be understood that the request object includes one or more types of order request messages, including order placement, payment, and refund.

[0096] In this way, after a certain type of order request message is locked, another type of order request message can be processed only after the processing of the certain type of order request message is completed.

[0097] In the embodiment of the present invention, the request object can be locked according to the contract order number, that is, locked from the order dimension. Since the contract order number has not been generated when the order request message is an order request message, locking the request object according to the contract order number does not include locking the order request message.

[0098] That is, when the order request message is a payment request message or a refund request message, the request object is locked, and the request object includes the contract order number of the order request message; then, the order information is converted into a memory model and stored in the memory.

[0099] In one embodiment of the present invention, the payment request message includes the entire payment request or a portion of the payment request.

[0100] In one embodiment of the present invention, the refund request message includes a full refund request or a partial refund request.

[0101] In this way, in the case of locking the payment request message or the refund request message, another request message of the contract order number can be processed only after the payment request message or the refund request message is processed.

[0102] In the embodiment of the present invention, different database locks may be used for different databases, such as using a redis data lock for a redis database and using an Oracle data lock for Oracle data.

[0103] See also Figure 4 , Figure 4 Schematic diagram of a lock interface class according to an embodiment of the present invention, wherein the lock interface class includes a redis lock implementation class and an Oracle lock implementation class.

[0104] See also Figure 5 , Figure 5 Schematic diagram of abstract methods included in an interface class according to an embodiment of the present invention, wherein IRedisRepository is an interface class containing basic abstract methods.

[0105] It is understandable that the request object needs to be locked before the order information is converted into the memory model.

[0106] The following describes redis data lock.

[0107] In one embodiment of the present invention, a key-value pair in a redis database lock is added to the redis database to lock the request object, and the primary key in the key-value pair is generated based on the contract order number in the order information.

[0108] If the same key-value pair exists in the redis database, it means that the request object has been locked; if the same key-value pair does not exist in the redis database, it means that the request object is not locked.

[0109] As an example, the primary key in the key-value pair can be: product component + type + underscore + contract order number, such as: pecf-prod-app.ARORDER_NO_31201911010001. The value in the key-value pair can be a 25-digit global tracking number. The global tracking number can be pre-set.

[0110] The following describes Oracle data locks.

[0111] The Oracle database locks and unlocks through database tables and key-value pairs. The primary key of the key-value pair is generated based on the order type and contract order number, and the value in the key-value pair is a 25-digit global tracking number. The global tracking number can be pre-set.

[0112] See also Figure 6 , Figure 6 The following is a schematic diagram of the locking process of an Oracle data lock according to an embodiment of the present invention, which specifically includes:

[0113] S601. Insert a key-value pair into a database.

[0114] Insert the key-value pair corresponding to the contract order number into the database table, which belongs to the Oracle database.

[0115] S602: Whether an error message is received.

[0116] If an error message is received, it means that the request object corresponding to the key-value pair has been locked, and S603 is executed; if no error message is received, it means that the request object corresponding to the key-value pair has not been locked, and the request object can be locked.

[0117] S603: Determine whether the expiration time of the lock request object is earlier than the current time.

[0118] If it is determined that the expiration time of the lock request object is earlier than the current time, the expiration time can be updated according to the current time to lock the request object, thereby ensuring that the lock time of the request object is extended.

[0119] If the expiration time of the lock request object is not earlier than the current time, the process ends.

[0120] It is understandable that the above steps can be summarized as follows:

[0121] Insert the key-value pair corresponding to the contract order number into the database table. No error message is received to lock the request object.

[0122] Insert the key-value pair corresponding to the contract order number into the database table and receive an error message. Determine that the expiration time of the lock request object is earlier than the current time. You can update the expiration time according to the current time to lock the request object.

[0123] exist Figure 6 In the embodiment, the request object is locked by inserting a key-value pair into the database table. In addition, the expiration time can be updated in time to control the progress of processing the order.

[0124] See also Figure 7 , Figure 7 The present invention is a schematic diagram of an unlocking process of an Oracle data lock according to an embodiment of the present invention, which specifically includes:

[0125] S701. Determine whether there is a key-value pair in the database table.

[0126] The database table is searched based on the key-value pair to determine whether the key-value pair exists in the database table. If the searched key-value pair does not exist in the database table, it means that the request object of the key-value pair is not locked, and the process ends; if the searched key-value pair exists in the database table, it means that the request object of the key-value pair is locked, and S702 is executed.

[0127] S702: Determine whether the global tracking number in the key-value pair is the same as the current global tracking number.

[0128] The current global tracking number is the global tracking number in the search key-value pair. Determine whether the global tracking number in the key-value pair in the database table is the same as the global tracking number in the search key-value pair. If they are the same, the request object can be unlocked; if they are not the same, the process ends.

[0129] exist Figure 7 In an embodiment, the request object can be unlocked through a key-value pair.

[0130] S203: Verify the amount, payee and payee in the memory model. After the memory model is verified, persist the order information to the database.

[0131] In the embodiment of the present invention, the purpose of the check is to verify the rationality of the data in the order request message. If the data in the order request message is unreasonable, no further processing is required; if the data in the order request message is reasonable, the processing is continued.

[0132] Specifically, the amount, payee, and payee in the memory model can be verified. Only after the memory model is verified can the order information be persisted to the database.

[0133] In one embodiment of the present invention, the order request message includes a main-sub-order order request message, that is, the main-sub-order order request message includes main order information and sub-location information.

[0134] Then, you need to verify the amount in the main order information, the amount in the sub-order information, the payee in the main order information, the payee in the sub-order information, the payee in the main order information, and the payee in the sub-order information.

[0135] Specifically, it is necessary to verify whether the amount in the main order information is equal to the total amount in all sub-order information; the payee in the main order information includes the payee in the sub-order information; and the payee in the main order information includes the payee in the sub-order information.

[0136] In one embodiment of the present invention, repeated verification and / or timeout verification may be used to verify the amount, payee, and payee in the memory model.

[0137] Specifically, repeated verification means that multiple verifications are performed within a period of time. If multiple verifications are successful, the repeated verification is passed.

[0138] Timeout verification means that the time spent on verification needs to be less than the preset time threshold. If the time spent on verification needs to be less than or equal to the preset time threshold, the timeout verification is passed; if the time spent on verification needs to be greater than the preset time threshold, the timeout verification is not passed.

[0139] In the above embodiment, the order request message is parsed to obtain the order information; the order information is converted into a memory model and stored in the memory, and the memory model includes an order management class and a payment refund management class; the amount, the payee and the payee in the memory model are verified, and after the memory model is verified, the order information is persisted to the database. By converting the order information into a memory model, different hardware and operating systems can access the memory model without rewriting code, achieving consistency in memory access, thereby improving the efficiency of verifying orders.

[0140] In addition, by locking the request object, the processing of orders can be guaranteed and the efficiency of order processing can be improved when there is high concurrency of order request messages.

[0141] See also Figure 8 , Figure 8 is a schematic diagram of the main structure of an order processing device according to an embodiment of the present invention. The order processing device can implement a method for processing an order, such as Figure 8 As shown, the device for processing orders specifically includes:

[0142] The parsing module 801 is used to parse the order request message to obtain order information.

[0143] The conversion module 802 is used to convert the order information into a memory model and store it in the memory. The memory model includes an order management class and a payment refund management class.

[0144] The storage module 803 is used to verify the amount, payee and payee in the memory model. After the memory model is verified, the order information is persisted to the database.

[0145] In one embodiment of the present invention, the conversion module 802 is further used to lock the request object, where the request object includes one or more types of the order request message, including order placement, payment, and refund.

[0146] In one embodiment of the present invention, the order request message is an order request message;

[0147] The conversion module 802 is specifically used to convert the order information into a memory model and store it in the memory;

[0148] Generate contract order number using database sequence.

[0149] In one embodiment of the present invention, the order request message includes a main-sub-order order request message, and the main-sub-order order request message includes main order information and sub-location information;

[0150] Storage module 803 is specifically used to verify the amount in the main order information, the amount in the sub-order information, the payee in the main order information, the payee in the sub-order information, the payee in the main order information and the payee in the sub-order information.

[0151] In one embodiment of the present invention, the order request message is a payment request message or a refund request message;

[0152] The conversion module 802 is further used to lock the request object, wherein the request object includes the contract order number of the order request message;

[0153] The order information is converted into a memory model and stored in the memory.

[0154] In one embodiment of the present invention, the conversion module 802 is also used to add the key-value pair in the redis database lock to the redis database to lock the request object, and the primary key in the key-value pair is generated based on the contract order number in the order information.

[0155] In one embodiment of the present invention, the conversion module 802 is also used to insert the key-value pair corresponding to the contract order number into the database table to lock the request object, and the database table belongs to the Oracle database.

[0156] In one embodiment of the present invention, the conversion module 802 is specifically used to insert the key-value pair corresponding to the contract order number into the database table, and no error message is received to lock the request object.

[0157] In one embodiment of the present invention, the conversion module 802 is specifically used to insert the key-value pair corresponding to the contract order number into the database table, receive an error message, and determine that the expiration time of the lock request object is earlier than the current time;

[0158] The expiration time is updated according to the current time to lock the requested object.

[0159] In one embodiment of the present invention, the order request message is a payment request message or a refund request message;

[0160] The storage module 803 is specifically used to verify the amount, payee and payer in the memory model, and the verification includes repeated verification and / or timeout verification.

[0161] In one embodiment of the present invention, the order request message includes a payment request message, and the payment request message includes the entire payment request or a portion of the payment request.

[0162] In one embodiment of the present invention, the order request message includes a refund request message, and the refund request message includes a full refund request or a partial refund request.

[0163] Fig. 9 An exemplary system architecture 900 is shown to which the method for processing an order or the apparatus for processing an order according to the embodiments of the present invention can be applied.

[0164] like Fig. 9 As shown, system architecture 900 may include terminal devices 901, 902, 903, network 904 and server 905. Network 904 is used to provide a medium for communication links between terminal devices 901, 902, 903 and server 905. Network 904 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0165] Users can use terminal devices 901, 902, 903 to interact with server 905 through network 904 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 901, 902, 903, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0166] The terminal devices 901 , 902 , and 903 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0167] The server 905 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 901, 902, and 903. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0168] It should be noted that the method for processing an order provided in the embodiment of the present invention is generally executed by the server 905 , and accordingly, the device for processing an order is generally set in the server 905 .

[0169] It should be understood that Fig. 9 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0170] Reference below Fig.10 , which shows a schematic diagram of the structure of a computer system 1000 of a terminal device suitable for implementing an embodiment of the present invention. Fig.10 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0171] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0172] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.

[0173] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-mentioned functions defined in the system of the present invention are executed.

[0174] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0175] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0176] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be provided in a processor. For example, they may be described as follows: a processor includes a sending unit, an acquisition unit, a determination unit, and a first processing unit. The names of these units do not, in some cases, constitute limitations on the units themselves. For example, the sending unit may also be described as a "unit that sends a request for obtaining an image to a connected server."

[0177] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0178] Parse the order request message to obtain order information;

[0179] Convert the order information into a memory model and store it in the memory, wherein the memory model includes an order management class and a payment refund management class;

[0180] The amount, payee and payee in the memory model are verified. After the memory model is verified, the order information is persisted to the database.

[0181] According to the technical solution of the embodiment of the present invention, the order request message is parsed to obtain the order information; the order information is converted into a memory model and stored in the memory, and the memory model includes an order management class and a payment refund management class; the amount, the payee and the payee in the memory model are verified, and after the memory model is verified, the order information is persisted to the database. By converting the order information into a memory model, different hardware and operating systems can access the memory model without rewriting code, achieving consistency in memory access, thereby improving the efficiency of verifying orders.

[0182] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for processing an order, characterized in that: include: Parse the order request message to obtain order information; Convert the order information into a memory model and store it in the memory, wherein the memory model includes an order management class and a payment refund management class; Verify the amount, payee and payee in the memory model. After the memory model is verified, persist the order information to the database; The order request message is an order request message; The converting the order information into a memory model and storing the model in the memory includes: Convert the order information into a memory model and store it in the memory; Generate contract order number using database sequence; The converting the order information into a memory model and storing it in the memory before the order information is converted into a memory model also includes: Locking a request object, wherein the request object includes one or more types of the order request message, including order placement, payment, and refund; The lock request object includes: Insert the key-value pair corresponding to the contract order number into the database table to lock the request object. The database table belongs to the Oracle database.

2. The method for processing an order according to claim 1, characterized in that: The order request message includes a main-sub-order order request message, and the main-sub-order order request message includes main order information and sub-order information; The verifying the amount, payee and payee in the memory model includes: Verify the amount in the main order information, the amount in the sub-order information, the payee in the main order information, the payee in the sub-order information, the payee in the main order information and the payee in the sub-order information.

3. The method for processing an order according to claim 1, characterized in that: The order request message is a payment request message or a refund request message; The converting the order information into a memory model and storing the model in the memory includes: A lock request object, wherein the request object includes the contract order number of the order request message; The order information is converted into a memory model and stored in the memory.

4. The method for processing an order according to claim 1 or 3, characterized in that: The lock request object includes: The key-value pair in the redis database lock is added to the redis database to lock the request object, wherein the primary key in the key-value pair is generated based on the contract order number in the order information.

5. The method for processing an order according to claim 1, characterized in that: The key-value pair corresponding to the contract order number is inserted into the database table to lock the request object, including: Insert the key-value pair corresponding to the contract order number into the database table. No error message is received to lock the request object.

6. The method for processing an order according to claim 1, characterized in that: The key-value pair corresponding to the contract order number is inserted into the database table to lock the request object, including: Insert the key-value pair corresponding to the contract order number into the database table, receive an error message, and determine that the expiration time of the lock request object is earlier than the current time; The expiration time is updated according to the current time to lock the requested object.

7. The method for processing an order according to claim 1, characterized in that: The order request message is a payment request message or a refund request message; The verifying the amount, payee and payee in the memory model includes: The amount, payee and payee in the memory model are verified, wherein the verification includes a repeat verification and / or a timeout verification.

8. The method for processing an order according to claim 1, characterized in that: The order request message includes a payment request message, and the payment request message includes the entire payment request or a portion of the payment request.

9. The method for processing an order according to claim 1, characterized in that: The order request message includes a refund request message, and the refund request message includes a full refund request or a partial refund request.

10. A device for processing orders, characterized in that: include: A parsing module, used to parse the order request message to obtain order information; A conversion module, used to convert the order information into a memory model and store it in the memory, wherein the memory model includes an order management class and a payment refund management class; and, the order request message is an order request message, and the order information is converted into a memory model and stored in the memory; Generate contract order number using database sequence; and locking a request object, the request object including one or more types of the order request message, the types including order, payment and refund; and inserting a key-value pair corresponding to the contract order number into a database table to lock the request object, the database table belonging to an Oracle database; The storage module is used to verify the amount, payee and payee in the memory model. After the memory model is verified, the order information is persisted to the database.

11. An electronic device for processing an order, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.

12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.