Order processing method and device, electronic equipment, storage medium and program product
By using smart contract services between e-commerce platforms and merchants to sign, verify, and synchronously store order payment information, the problem of inconsistent order information is solved, and reconciliation efficiency and security are improved.
Patent Information
- Application Number
- CN202511133529.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-12-09
AI Technical Summary
In existing technologies, the platform-centric, one-sided accounting model for order records on e-commerce platforms leads to inconsistencies in order information during the reconciliation process, resulting in reduced progress and efficiency.
By using smart contract services for signature verification and information encapsulation between the platform and the merchant, the system ensures that order payment information is stored and synchronized consistently in the ledger modules of both the platform and the merchant. The system also utilizes smart contract services for sorting and storage space allocation, and establishes a secure channel for data transmission.
It achieves consistent storage of order information and efficient reconciliation, improving the progress and efficiency of reconciliation and enhancing the security of data transmission.
Smart Images

Figure CN121094918A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, and in particular to an order processing method and device, electronic equipment, storage medium and program product. BACKGROUND
[0002] With the development of Internet shopping, the number of merchants on the e-commerce platform has increased. In order to facilitate the merchants to reconcile, the e-commerce platform develops a merchant order management function, which manages the orders generated by the merchants on the e-commerce platform, and facilitates user query.
[0003] In the prior art, the merchant queries and downloads order information from the e-commerce platform, and saves it to the local. Then, the merchant reconciles according to the downloaded order information.
[0004] However, in the prior art, the record of the order is a unilateral accounting mode centered on the platform. If there is a problem of inconsistent order information in the reconciliation process, the merchant and the platform need to communicate, which reduces the progress and efficiency of reconciliation. SUMMARY
[0005] The present application provides an order processing method and device, electronic equipment, storage medium and program product to solve the problem of reduced progress and efficiency of reconciliation in the prior art.
[0006] In a first aspect, the present application provides an order processing method applied to a platform side, comprising:
[0007] receiving a payment order request sent by a client;
[0008] performing signature verification on a payment order in the payment order request to generate signature verification information;
[0009] sending the signature verification information to the client, so that the client verifies the signature verification information and generates signed order payment information according to the signature verification information;
[0010] receiving the signed order payment information sent by the client;
[0011] encapsulating the signed order payment information into a ledger module of the platform side through a smart contract service, wherein the ledger module of the platform side is used to store the signed order payment information;
[0012] synchronously sending the signed order payment information to a merchant side through the smart contract service, so that the merchant side encapsulates the signed order payment information into a ledger module of the merchant side, wherein the ledger module of the merchant side is used to store the signed order payment information.
[0013] In a possible implementation, after the signed order payment information is sent to the merchant end by the smart contract service, the method further includes: receiving an order query request sent by the client; verifying the user authority in the order query request by the smart contract service; if the user authority in the order query request is verified, the ledger module of the platform end acquires the corresponding order to be queried according to the order query request; and the order to be queried is sent to the client.
[0014] In a possible implementation, the signing verification of the payment order in the payment order request and the generation of the signature verification information includes: decrypting the payment order request according to the public key of the client to obtain the payment order in the payment order request; running a transaction process corresponding to the payment order in the payment order request according to a chain code function in the smart contract to generate a simulation running result; and performing digital signature on the simulation running result to generate the signature verification information.
[0015] In a possible implementation, before the payment order request sent by the client is received, the method further includes: acquiring a dependency package of the smart contract, and creating a running environment of the smart contract according to the dependency package; creating a chain code structure body and a data structure body of the smart contract in the running environment of the smart contract; creating a start function of the chain code structure body according to the chain code structure body; generating an initialization method according to the business information of the order business; generating a business structure body instance according to the business information of the order business; generating a business logic function according to the business structure body instance, where the business logic function is used to process the process information of the order business; generating a routing method of the chain code structure body according to the business logic function, where the routing method of the chain code structure body is used to call the business logic function; and configuring the start function of the chain code structure body, the initialization method, the routing method of the chain code structure body and the business logic function in the chain code structure body and the data structure body of the smart contract, so as to realize the creation of the smart contract.
[0016] In a possible implementation, the encapsulation of the signed order payment information into the ledger module of the platform end by the smart contract service includes: sorting the signed order payment information by an ordering service in the smart contract service to generate sorting information; dividing the storage space of the ledger module of the platform end according to the sorting information to generate storage division information of the ledger module of the platform end; and encapsulating the signed order payment information into the ledger module of the platform end according to the storage division information of the ledger module of the platform end.
[0017] In a possible implementation, before receiving the payment order request sent by the client, the method further includes: receiving node information and a communication certificate sent by each merchant terminal; determining channel configuration information of a secure channel according to the node information and the communication certificate; generating channel configuration files according to the channel configuration information of the secure channel; verifying validity of the communication certificate through an ordering service; if the communication certificate is valid, generating a channel genesis block according to the channel configuration files; sending the channel genesis block to each merchant terminal, so that each merchant terminal performs signature verification on the channel genesis block, and joins the channel genesis block to generate channel joining information; receiving the channel joining information sent by each merchant terminal; generating a communication anchor node transaction file of each merchant terminal according to the channel joining information, wherein the communication anchor node transaction file includes a session key for communication between the platform terminal and the merchant terminal; and sending the communication anchor node transaction file to each merchant terminal, so as to complete establishment of the secure channel between each merchant terminal and the platform terminal.
[0018] In a second aspect, the application provides an order processing device applied to a platform terminal, including:
[0019] a first receiving module configured to receive a payment order request sent by a client;
[0020] a first verifying module configured to perform signature verification on a payment order in the payment order request, and generate signature verification information;
[0021] a first sending module configured to send the signature verification information to the client, so that the client verifies the signature verification information and generates signed order payment information according to the signature verification information;
[0022] a second receiving module configured to receive the signed order payment information sent by the client;
[0023] an encapsulating module configured to encapsulate, through an intelligent contract service, the signed order payment information to a ledger module of the platform terminal, wherein the ledger module of the platform terminal is configured to store the signed order payment information;
[0024] a synchronizing module configured to synchronously send, through the intelligent contract service, the signed order payment information to a merchant terminal, so that the merchant terminal encapsulates the signed order payment information to a ledger module of the merchant terminal, wherein the ledger module of the merchant terminal is configured to store the signed order payment information.
[0025] In a third aspect, an electronic device is provided, and includes at least one processor and a memory. The memory stores computer-executable instructions. The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the order processing method according to the first aspect and various possible designs of the first aspect.
[0026] In a fourth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the order processing method according to the first aspect and various possible designs of the first aspect is implemented.
[0027] In a fifth aspect, a computer program product is provided, and includes a computer program. When a processor executes the computer program, the order processing method according to the first aspect and various possible designs of the first aspect is implemented.
[0028] The order processing method, device, electronic device, storage medium, and program product provided by the present application can verify the signature of the payment order in the payment order request, generate signature verification information, send the signature verification information to the client, generate signed order payment information by the client, encapsulate the signed order payment information into the ledger module of the platform side through the smart contract service, synchronize the signed order payment information to the merchant side through the smart contract service, encapsulate the signed order payment information into the ledger module of the merchant side, and facilitate the merchant side to query the order payment information. Therefore, the progress and efficiency of the account settlement can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0029] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0030] Figure 1 A scenario diagram of the order processing method provided by the embodiments of the present application is provided.
[0031] Figure 2 A flowchart of the order processing method provided by the present application is provided.
[0032] Figure 3 A system diagram of the containerization deployment scheme provided by the embodiments of the present application is provided.
[0033] Figure 4 A structure diagram of the order processing device provided by the present application is provided.
[0034] Figure 5 A structure diagram of the electronic device provided by the present application is provided.
[0035] The specific embodiments of the present application have been shown and described in the above drawings and text, and will be described in more detail in the following. These drawings and text are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0036] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The same numbers are used in different drawings to represent the same or similar elements. The embodiments described in the following exemplary embodiments are not meant to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.
[0037] In the technical solution of the present application, the collection, storage, use, processing, transmission, provision and disclosure of financial data or user data and other information comply with relevant laws and regulations and do not violate public order and good customs.
[0038] It should be noted that in the embodiments of the present application, some software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0039] First, the terms involved in the present application are explained:
[0040] Endorsement node: The endorsement node is responsible for simulating the execution of the transaction proposal, verifying the correctness, compliance and validity of the transaction logic.
[0041] With the development of Internet shopping, the number of merchants on the e-commerce platform has increased. In order to facilitate the merchants to reconcile, the e-commerce platform develops a merchant order management function, which manages the orders generated by the merchants on the e-commerce platform through the merchant order management function, and facilitates user query. In the prior art, the merchant downloads the order information from the e-commerce platform and saves it to the local according to the downloaded order information for reconciliation. However, in the prior art, the order record is a unilateral accounting mode centered on the platform. If there is a problem of inconsistent order information in the reconciliation process, the merchant and the platform need to communicate, which reduces the progress and efficiency of reconciliation.
[0042] To solve the above technical problems, the present application embodiment proposes the following technical concept: the inventor considers designing a smart contract service, verifying the payment order request sent by the client end through the platform end, generating signature verification information, verifying the signature verification information by the client end, generating signed order payment information, encapsulating the order payment information to the ledger module of the platform end through the smart contract service, and synchronizing the order payment information to the merchant end, and the merchant end encapsulates the order payment information to the ledger module of the merchant end, avoiding the problem of inconsistent order information in the reconciliation process. The following will be described in detail with detailed embodiments.
[0043] Figure 1 The scene schematic diagram of the order processing method provided by the present application embodiment is shown as Figure 1 The application scenario includes: platform end 101, merchant end 102 and client end 103.
[0044] Specifically, the platform end 101 receives the payment order request sent by the client end 103, the platform end 101 performs signature verification on the payment order in the payment order request, generates signature verification information, sends the signature verification information to the client end 103, the client end 103 verifies the signature verification information and generates signed order payment information, sends the order payment information to the platform end 101, the platform end 101 encapsulates the order payment information to the ledger module of the platform end 101 through the smart contract service, and synchronizes the signed order payment information to the merchant end 102 through the smart contract service, and the merchant end 102 encapsulates the signed order payment information to the ledger module of the merchant end 102.
[0045] Figure 2 The flowchart of the order processing method provided by the present application is shown as Figure 2 The method comprises:
[0046] S201: receiving the payment order request sent by the client end.
[0047] In the present embodiment, the client end generates a payment order request, calls the interface of the platform end and the merchant end, and sends a remote message to the platform end and the merchant end node.
[0048] S202: signature verification is performed on the payment order in the payment order request, and signature verification information is generated.
[0049] Specifically, the endorsement node decrypts the payment order request, runs the transaction process corresponding to the payment order according to the chain code function in the smart contract, generates a simulation running result, digitally signs the simulation running result, and generates signature verification information.
[0050] S203: send the signature verification information to the client, so that the client verifies the signature verification information and generates the signed order payment information according to the signature verification information.
[0051] Specifically, the client uses the private key to decrypt the signature verification information, checks the payment result of the simulation run, uses the public key to sign the payment result and sends it to the ordering node of the platform end in a package.
[0052] S204: receiving the signed order payment information sent by the client.
[0053] Specifically, the ordering node of the platform end receives the signed order payment information sent by the client through the interface of the platform end, and encapsulates the order payment information.
[0054] S205: encapsulate the signed order payment information to the ledger module of the platform end through the smart contract service, wherein the ledger module of the platform end is used to store the signed order payment information.
[0055] Specifically, the ordering service in the smart contract service sorts the signed order payment information, generates sorting information, divides the storage space of the ledger module according to the sorting information, generates storage division information of the ledger module, and encapsulates the signed order payment information to the ledger module of the platform end according to the storage division information.
[0056] S206: send the signed order payment information to the merchant end through the smart contract service, so that the merchant end encapsulates the signed order payment information to the ledger module of the merchant end, wherein the ledger module of the merchant end is used to store the signed order payment information.
[0057] Specifically, after the merchant end receives the order payment information broadcast by the platform end, the order payment information is verified, and after the verification is passed, the order payment information is stored in the ledger module of the merchant end through the ordering service of the merchant end.
[0058] In this embodiment, the client, the merchant end and the platform end adopt a cloud container deployment scheme, the platform end and the merchant end and the client establish a secure channel through a container to form a plurality of organizations, and the container is composed of components and services of the Hyperledger project.
[0059] Figure 3 The container deployment scheme provided in the embodiment of the application is shown in the system schematic diagram.
[0060] From the above embodiment, by signing and verifying the payment order in the payment order request, generating signature verification information, sending the signature verification information to the client, the client generates the signed order payment information, encapsulating the signed order payment information to the platform side's account book module through the smart contract service, and synchronizing the signed order payment information to the merchant side through the smart contract service, the merchant side encapsulates the signed order payment information to the account book module of the merchant side, which is convenient for the merchant side to query the order payment information, avoids the problem of inconsistent order information, and improves the reconciliation efficiency.
[0061] In an embodiment of the present application, after step S206, further comprising:
[0062] S207: receiving an order query request sent by the client.
[0063] Specifically, the client sends the order query request to the order query interface of the platform side according to the order query interface address of the platform side.
[0064] S208: verifying the user authority in the order query request through the smart contract service.
[0065] Specifically, the smart contract service obtains the order number in the order query request, and obtains the corresponding user authority of the stored order according to the order number.
[0066] S209: if the user authority in the order query request is verified, the account book module of the platform side obtains the corresponding order to be queried according to the order query request.
[0067] Specifically, if the user authority is verified, the platform obtains the order stored in the account book module according to the corresponding order number, and generates a mirror file of the order to be queried.
[0068] S210: sending the order to be queried to the client.
[0069] Specifically, the mirror file is sent to the client, and the client obtains the query result according to the mirror file.
[0070] From the above embodiment, when the client initiates an order query request, the user authority in the query request is verified through the smart contract service of the platform side, if the user authority is verified, the order to be queried recorded in the account book module is obtained, and the order to be queried is sent to the client, the order query is completed, and the security of the order is improved by verifying the authority.
[0071] In an embodiment of the present application, step S202 comprises:
[0072] S2021: decrypting the payment order request according to the client public key to obtain the payment order in the payment order request.
[0073] Specifically, the endorsing node decrypts the payment order by the public key in the client certificate, verifies the validity of the client signature, and if the verification is valid, it indicates that the payment order in the payment order request is valid, and obtains the payment order.
[0074] Specifically, the endorsing node uses the client public key to decrypt the signature, obtains the hash value of the payment order request and the certificate of the client, and judges whether the hash value is the same as the preset hash value and whether the certificate is in the valid period.
[0075] S2022: According to the chain code function in the smart contract, run the transaction process corresponding to the payment order in the payment order request to generate a simulation running result.
[0076] Specifically, the endorsing node calls the chain code function in the smart contract, runs the chain code function according to the transaction process, and generates a read-write set of the simulation running.
[0077] Specifically, the endorsing node executes the call of the chain code function on the snapshot of the local database, the chain code function reads the key-value pair to generate a read set; according to the business logic in the payment order transaction process, the state to be updated is calculated to generate a write set.
[0078] S2023: Digitally sign the simulation running result to generate signature verification information.
[0079] In this embodiment, the content recorded in the simulation running result includes but is not limited to the state code of the simulation running, the read set of the simulation running, the write set of the simulation running, and the certificate of the endorsing node.
[0080] Specifically, the endorsing node digitally signs the simulation running result using a private key to generate signature verification information.
[0081] From the above embodiment, by decrypting the payment order request using the client public key, obtaining the payment order, running the transaction process in the payment order request according to the chain code function in the smart contract, generating a simulation running result, digitally signing the simulation running result to generate signature verification information, and simulating the transaction process by decrypting the payment order request, the security of the transaction is improved.
[0082] In an embodiment of the present application, before step S201, further comprising:
[0083] S301: Obtain the dependency package of the smart contract, and create a running environment of the smart contract according to the dependency package.
[0084] In this embodiment, the content of the dependency package includes but is not limited to string operation dependency, time processing dependency and type conversion dependency.
[0085] S302: Create a chaincode structure and a data structure of the smart contract in a running environment of the smart contract.
[0086] In the embodiment, the chaincode structure is a carrier of chaincode implementation, and is used to mount necessary methods and custom methods of the chaincode.
[0087] In the embodiment, the content recorded in the data structure includes but is not limited to order number, order name, order time, order location, platform number, merchant number, customer number, commodity number, amount and order status.
[0088] S303: Create a start function of the chaincode structure according to the chaincode structure.
[0089] In the embodiment, the start function is a main function, and the chaincode is started through a calling method in the start function, and an instance of the chaincode structure is passed to the calling method.
[0090] S304: Generate an initialization method according to business information of the order business.
[0091] In the embodiment, the initialization method is used to initialize the state of the chaincode when the chaincode is deployed or upgraded for the first time.
[0092] S305: Generate a business structure instance according to business information of the order business.
[0093] Specifically, the original business information of the order business is obtained, the original business information is cleaned and verified, the business information is type-parsed, missing data is supplemented, supplemented business information is generated, and a structure instance is constructed according to the supplemented business information.
[0094] S306: Generate a business logic function according to the business structure instance, wherein the business logic function is used to process process information of the order business.
[0095] In the embodiment, the functions of the business logic function include but are not limited to creating an order, querying an order, updating an order and composite query.
[0096] S307: Generate a routing method of the chaincode structure according to the business logic function, wherein the routing method of the chaincode structure is used to call the business logic function.
[0097] In the embodiment, the functions of the routing method include but are not limited to generating an order, querying an order and updating order information.
[0098] S308: Configure the start function of the chaincode structure, the initialization method, the routing method of the chaincode structure and the business logic function in the chaincode structure and the data structure of the smart contract, so as to realize creation of the smart contract.
[0099] Specifically, the start function is set in the chaincode structure as the main entrance of chaincode start, the initialization method is configured, the initialization method is set to be executed when the chaincode is deployed or upgraded, and the business logic function is configured as an operation based on the data structure to complete the creation of the smart contract.
[0100] From the above embodiment, it can be seen that by creating a running environment of a smart contract, creating a chaincode structure and a data structure of the smart contract in the running environment, generating a business logic function according to business information of an order business, configuring the business logic function in the chaincode structure and the data structure of the smart contract to create the smart contract, and realizing the recording function of the order through the smart contract, the problem of inconsistent order information is avoided.
[0101] In an embodiment of the present application, step S205 comprises:
[0102] S2051: The signed order payment information is sorted by a sorting service in the smart contract service to generate sorting information.
[0103] Specifically, the sorting node filters invalid transactions according to the transaction format, signature validity and whether the signed order payment information contains metadata, and sorts the filtered order payment data according to the sorting rule to generate sorting information.
[0104] In the embodiment, the sorting rule includes but is not limited to sorting according to a timestamp, sorting according to a transaction priority and sorting according to a hash value.
[0105] S2052: The storage space of the ledger module of the platform side is divided according to the sorting information to generate storage division information of the ledger module of the platform side.
[0106] Specifically, the module storage threshold is set according to the number of order payment data in the sorting information, the storage space of the ledger module is divided according to the module storage threshold, and the storage division information is generated.
[0107] S2053: The signed order payment information is encapsulated into the ledger module of the platform side according to the storage division information of the ledger module of the platform side.
[0108] Specifically, the sorting node stores the order information sorted according to the sorting rule to be stored into the ledger module according to the storage division information, and when the storage block reaches the storage threshold, a hash value corresponding to the block is generated to identify the block by the hash value.
[0109] From the above embodiment, it can be seen that the order payment information is sorted by the sorting service, the storage space of the ledger module is divided according to the sorting information, and the signed order payment information is encapsulated into the ledger module of the platform side according to the storage division information, which facilitates subsequent query of the order.
[0110] In an embodiment of the present application, before step S201, the method further comprises:
[0111] S401: receiving node information and a communication certificate sent by each merchant terminal.
[0112] In the embodiment, the communication certificate can be a certificate issued by the platform terminal or a certificate issued by a third-party security certification agency.
[0113] S402: determining channel configuration information of the secure channel according to the node information and the communication certificate.
[0114] In the embodiment, the channel configuration information includes but is not limited to channel name, node name and access control policy.
[0115] S403: generating a channel configuration file according to the channel configuration information of the secure channel.
[0116] In the embodiment, the channel configuration file is a tradable file.
[0117] S404: verifying the validity of the communication certificate through the ordering service.
[0118] Specifically, the ordering service verifies the hash value of the certificate of the merchant terminal and the platform terminal, and determines whether the certificate is valid according to the hash value.
[0119] S405: if the communication certificate is valid, generating a channel genesis block according to the channel configuration file.
[0120] Specifically, the channel configuration file is submitted to the ordering service through a creation instruction, the ordering service confirms whether the signature in the channel configuration file conforms to the security policy, if it conforms to the security policy, a block structure is created, the channel configuration is written into a field in the block, the block is signed through the private key of the ordering service, and a channel genesis block is generated.
[0121] S406: sending the channel genesis block to each merchant terminal, so that each merchant terminal verifies the signature of the channel genesis block and joins the channel genesis block to generate channel joining information.
[0122] Specifically, each merchant terminal verifies the signature of the channel genesis block according to a joining instruction, and if the signature verification is passed, the channel joining information is generated.
[0123] S407: receiving the channel joining information sent by each merchant terminal.
[0124] Specifically, the channel joining information sent by each merchant terminal is received through wireless communication.
[0125] S408: generating a communication anchor node transaction file of each merchant end according to the channel joining information, wherein the communication anchor node transaction file includes a session key for communication between the platform end and the merchant end.
[0126] Specifically, the platform end creates an anchor node for each merchant end, records the certificate fingerprint and port information of the platform end and the corresponding merchant end in the anchor node, creates a session key according to the certificate fingerprint and the port information, and writes the session key into an anchor node transaction file.
[0127] S409: sending the communication anchor node transaction file to each merchant end to complete the establishment of the secure channel between each merchant end and the platform end.
[0128] In the embodiment, each channel is independent and does not have a secure channel.
[0129] From the above embodiment, it can be seen that by obtaining the node information and the communication certificate of the merchant end, generating channel configuration information, generating a channel configuration file according to the channel configuration information, generating a channel genesis block according to the channel configuration file, and sending the channel genesis block to the merchant end to establish a secure channel, the security of the data transmission between the merchant end and the platform end is improved.
[0130] Figure 4 The structure schematic diagram of the order processing device provided in the present application is shown in FIG. 1. Figure 4 As shown in FIG. 1, the order processing device 40 provided in the embodiment includes a first receiving module 401, a first verification module 402, a first sending module 403, a second receiving module 404, an encapsulation module 405, and a synchronization module 406.
[0131] The first receiving module 401 is configured to receive a payment order request sent by a client.
[0132] The first verification module 402 is configured to perform signature verification on a payment order in the payment order request, and generate signature verification information.
[0133] The first sending module 403 is configured to send the signature verification information to the client, so that the client verifies the signature verification information and generates signed order payment information according to the signature verification information.
[0134] The second receiving module 404 is configured to receive signed order payment information sent by the client.
[0135] The encapsulation module 405 is configured to encapsulate the signed order payment information to a ledger module of a platform end through a smart contract service, wherein the ledger module of the platform end is configured to store the signed order payment information.
[0136] The synchronization module 406 is configured to synchronize the signed order payment information to the merchant end through the smart contract service, so that the merchant end encapsulates the signed order payment information into the ledger module of the merchant end, where the ledger module of the merchant end is configured to store the signed order payment information.
[0137] In an embodiment of the present application, the order processing apparatus 40 further comprises:
[0138] The third receiving module is configured to receive an order query request sent by the client.
[0139] The query module is configured to verify the user authority in the order query request through the smart contract service.
[0140] The first obtaining module is configured to, if the user authority in the order query request is verified, obtain the corresponding order to be queried by the ledger module of the platform end according to the order query request.
[0141] The second sending module is configured to send the order to be queried to the client.
[0142] In an embodiment of the present application, the first verification module 402 comprises:
[0143] The decryption unit is configured to decrypt the payment order request according to the public key of the client to obtain the payment order in the payment order request.
[0144] The running unit is configured to run the transaction process corresponding to the payment order in the payment order request according to the chain code function in the smart contract to generate a simulation running result.
[0145] The signature unit is configured to digitally sign the simulation running result to generate signature verification information.
[0146] In an embodiment of the present application, the order processing apparatus 40 further comprises:
[0147] The second obtaining module is configured to obtain the dependent package of the smart contract and create a running environment of the smart contract according to the dependent package.
[0148] The first creating module is configured to create a chain code structure body and a data structure body of the smart contract in the running environment of the smart contract.
[0149] The second creating module is configured to create a start function of the chain code structure body according to the chain code structure body.
[0150] The first generating module is configured to generate an initialization method according to the business information of the order business.
[0151] The second generating module is configured to generate a business structure body instance according to the business information of the order business.
[0152] The third generating module is configured to generate a business logic function according to the business structure instance, wherein the business logic function is used to process flow information of an order business.
[0153] The fourth generating module is configured to generate a routing method of the chaincode structure according to the business logic function, wherein the routing method of the chaincode structure is used to call the business logic function.
[0154] The configuration module is configured to configure the start function of the chaincode structure, the initialization method, the routing method of the chaincode structure and the business logic function in the chaincode structure and the data structure of the smart contract, so as to realize the creation of the smart contract.
[0155] In an embodiment of the present application, the encapsulation module 405 comprises:
[0156] The sorting unit is configured to sort the signed order payment information through a sorting service in the smart contract service, and generate sorting information.
[0157] The generating unit is configured to divide the storage space of the ledger module of the platform side according to the sorting information, and generate storage division information of the ledger module of the platform side.
[0158] The encapsulation unit is configured to encapsulate the signed order payment information to the ledger module of the platform side according to the storage division information of the ledger module of the platform side.
[0159] In an embodiment of the present application, the order processing device 40 further comprises:
[0160] The fourth receiving module is configured to receive the node information and the communication certificate sent by each merchant side.
[0161] The determining module is configured to determine the channel configuration information of the secure channel according to the node information and the communication certificate.
[0162] The fifth generating module is configured to generate a channel configuration file according to the channel configuration information of the secure channel.
[0163] The second verifying module is configured to verify the validity of the communication certificate through the sorting service.
[0164] The sixth generating module is configured to generate a channel genesis block according to the channel configuration file if the communication certificate is valid.
[0165] The third sending module is configured to send the channel genesis block to each merchant side, so that each merchant side verifies the channel genesis block by signature, and joins the channel genesis block to generate channel joining information.
[0166] The fifth receiving module is configured to receive the channel joining information sent by each merchant side.
[0167] A seventh generating module is configured to generate a communication anchor node transaction file of each merchant end according to the channel joining information, wherein the communication anchor node transaction file comprises a session key for communication between the platform end and the merchant end.
[0168] A fourth sending module is configured to send the communication anchor node transaction file to each merchant end to complete establishment of a secure channel between each merchant end and the platform end.
[0169] The order processing device provided in the embodiment can execute the method provided in the method embodiment, and has similar implementation principles and technical effects, which will not be described here.
[0170] Figure 5 A structural schematic diagram of an electronic device provided in the present application is shown in FIG. 1. Figure 5 As shown in FIG. 1, the electronic device 50 provided in the embodiment comprises at least one processor 501 and a memory 502. Optionally, the electronic device 50 further comprises a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected through a bus 504.
[0171] In the specific implementation process, the at least one processor 501 executes the computer execution instructions stored in the memory 502, so that the at least one processor 501 executes the order processing method described above.
[0172] The specific implementation process of the processor 501 can refer to the method embodiment described above, which has similar implementation principles and technical effects, and will not be described here.
[0173] In the above embodiment, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC) and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The steps of the method disclosed in the present application can be directly embodied as execution completed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0174] The memory can contain a random access memory (RAM), and can also include a non-volatile memory (NVM), for example, at least one disk memory.
[0175] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0176] The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the order processing method described above.
[0177] The present application also provides a computer readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the order processing method described above.
[0178] The above readable storage medium can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0179] An exemplary readable storage medium is coupled to the processor so as to enable the processor to read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an Application Specific Integrated Circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.
[0180] The division of units is only a logical functional division, and in actual implementation, there can be another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0181] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0182] In addition, each functional unit in various embodiments of the application can be integrated into one processing unit, or each unit can exist physically, or two or more units can be integrated into one unit.
[0183] If the function is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiment methods of the application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0184] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The aforementioned program can be stored in a computer readable storage medium. The program executes to perform the steps of the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, and various media that can store program codes.
[0185] Finally, it should be noted that those skilled in the art, after considering the specification and practicing the application disclosed herein, will easily think of other embodiments of the application. The application is intended to cover any variations, uses, or adaptations of the application that follow the general principles of the application and include common knowledge or conventional techniques in the art that are not disclosed by the application, and is not limited to the precise structure described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the application is only limited by the appended claims.
Claims
1. A method for processing orders, characterized in that, Applied to the platform side, including: Receive payment order requests sent by the client; The payment order in the payment order request is signed and verified to generate signature verification information; The signature verification information is sent to the client so that the client can verify the signature verification information and generate signed order payment information based on the signature verification information. Receive the signed order payment information sent by the client; The signed order payment information is encapsulated into the ledger module on the platform through smart contract services, wherein the ledger module on the platform is used to store the signed order payment information. The smart contract service synchronously sends the signed order payment information to the merchant's end, so that the merchant's end can encapsulate the signed order payment information into the merchant's ledger module, wherein the merchant's ledger module is used to store the signed order payment information.
2. The method according to claim 1, characterized in that, After the smart contract service synchronously sends the signed order payment information to the merchant, it also includes: Receive order query requests sent by the client; The user permissions in the order query request are verified through smart contract services. If the user's permissions in the order query request are verified, the ledger module on the platform will obtain the corresponding order to be queried based on the order query request. Send the order to be queried to the client.
3. The method according to claim 1, characterized in that, The step of verifying the signature of the payment order in the payment order request and generating signature verification information includes: The payment order request is decrypted using the client's public key to obtain the payment order from the payment order request; Based on the chaincode function in the smart contract, the transaction process corresponding to the payment order in the payment order request is executed, and the simulation results are generated. The simulation results are digitally signed to generate signature verification information.
4. The method according to claim 1, characterized in that, Before receiving the payment order request sent by the client, the method further includes: Obtain the smart contract's dependency packages and create the smart contract's runtime environment based on the dependency packages; Create the chaincode structure and data structure of the smart contract in the runtime environment of the smart contract; A startup function for the chaincode structure is created based on the chaincode structure; Generate an initialization method based on the business information of the order; Generate a business structure instance based on the business information of the order business; A business logic function is generated based on the business structure instance, wherein the business logic function is used to process the process information of order business; A routing method for generating a chaincode structure based on the business logic function, wherein the routing method for the chaincode structure is used to call the business logic function; The startup function, initialization method, routing method, and business logic function of the chaincode structure are configured in the chaincode structure and data structure of the smart contract to realize the creation of the smart contract.
5. The method according to claim 1, characterized in that, The step of encapsulating the signed order payment information into the platform's ledger module via smart contract service includes: The signed order payment information is sorted using the sorting service in the smart contract service to generate sorting information; The storage space of the ledger module on the platform is divided according to the sorting information, and the storage division information of the ledger module on the platform is generated. The signed order payment information is encapsulated into the ledger module of the platform based on the storage partitioning information of the ledger module.
6. The method according to any one of claims 1 to 5, characterized in that, Before receiving the payment order request sent by the client, the method further includes: Receive node information and communication certificates sent by each merchant; The channel configuration information of the secure channel is determined based on the node information and the communication certificate; Generate a channel configuration file based on the channel configuration information of the secure channel; The validity of the communication certificate is verified using a sorting service; If the communication certificate is valid, then a channel genesis block is generated according to the channel configuration file; The channel genesis block is sent to each merchant terminal so that each merchant terminal can sign and verify the channel genesis block, add the channel genesis block, and generate channel addition information; Receive channel joining information sent by various merchants; Based on the channel joining information, a communication anchor node transaction file is generated for each merchant, wherein the communication anchor node transaction file includes a session key for communication between the platform and the merchant. The transaction file of the communication anchor node is sent to each merchant terminal to complete the establishment of a secure channel between each merchant terminal and the platform terminal.
7. An order processing apparatus, characterized in that, Applied to the platform side, including: The first receiving module is used to receive payment order requests sent by the client; The first verification module is used to perform signature verification on the payment order in the payment order request and generate signature verification information; The first sending module is used to send the signature verification information to the client, so that the client can verify the signature verification information and generate signed order payment information based on the signature verification information; The second receiving module is used to receive the signed order payment information sent by the client; An encapsulation module is used to encapsulate the signed order payment information into the ledger module on the platform side through a smart contract service, wherein the ledger module on the platform side is used to store the signed order payment information; The synchronization module is used to synchronously send the signed order payment information to the merchant terminal through the smart contract service, so that the merchant terminal encapsulates the signed order payment information into the merchant terminal's ledger module, wherein the merchant terminal's ledger module is used to store the signed order payment information.
8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the order processing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the order processing method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the order processing method according to any one of claims 1 to 6.