Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Example one
An embodiment of the present invention provides a method flow for processing a payment service, and referring to fig. 1, the method includessteps 101 to 104.
Instep 101, a heartbeat request is sent to a service server, so that the service server detects the state of the payment service according to the heartbeat request, and marks values of N required identification bits in a message of a heartbeat feedback packet according to a detection result, where N is a positive integer.
In a possible embodiment, the heartbeat interval between two adjacent heartbeat requests is a fixed time value, which can be preset according to the requirement. As the amount of payment transactions increases, smaller time values may be preset, allowing for shorter response times for the transactions. In other embodiments, the method further comprises sending a heartbeat request to the service server after receiving the request.
Instep 102, a heartbeat feedback packet sent by a service server is received.
N demand identification bits are returned through the heartbeat packet to determine whether related services need to be initiated or not, and network consumption is reduced.
Instep 103, values of N demand identification bits are obtained from the message of the heartbeat feedback packet.
Specifically, the heartbeat protocol messages contain type, arbitrary payload and padding. Type refers to a message type such as a heartbeat request or a heartbeat response. The payload contains arbitrary contents. Filling: padding is a random number that will be ignored by the recipient and not processed.Step 103 may specifically be to extract the load in the heartbeat feedback packet; and obtaining the values of the N demand identification bits according to the load.
Instep 104, a payment service data processing request is initiated according to the values of the N requirement identification bits.
And setting the N demand identification bits matched with the preset value as target service identifications, and initiating a payment service data processing request according to the target service identifications. The preset value may be 1.
In a specific implementation,step 101 may further include step 99 and step 100.
In step 99, a handshake request is sent to the service server at preset intervals, so that the service returns a digital certificate according to the handshake request.
In step 100, determining whether the digital certificate is a preset digital certificate;
if the digital certificate is determined to be the preset digital certificate,step 101 is executed.
After step 100, a key exchange message is sent, changing the encryption specification protocol message, indicating that the handshake message exchange has been completed. The role of sending the change encryption specification protocol message is to allow the use of the already negotiated encryption algorithm and encryption key.
After the handshake is completed, the application encrypted data can be transmitted with the service server.
Example two
Referring to fig. 2, fig. 2 is another schematic flow chart of a method for processing a payment service according to an embodiment of the present invention. The method of payment transaction processing as shown in fig. 2 may comprise the steps of:
instep 201, a heartbeat request is sent to a service server, so that the service server detects the state of the payment service according to the heartbeat request, and marks values of N required identification bits in a message of a heartbeat feedback packet according to a detection result, wherein N is a positive integer;
instep 202, receiving a heartbeat feedback packet sent by a service server;
instep 203, obtaining a value of a two-dimensional code requirement identification bit from a message of the heartbeat feedback packet; the value of the two-dimension code requirement identification bit is used for determining whether one or more two-dimension codes for payment need to be uploaded to a service server.
In one possible implementation, the value of the two-dimensional code requirement identification bit is 1 or 0. And when the value of the two-dimension code requirement identification bit is 1, uploading one or more two-dimension codes for payment to a service server. The types of two-dimensional codes used for payment include, but are not limited to: aggregation code, union pay code. When the value of the two-dimension code requirement identification bit is 0, the two-dimension code requirement identification bit indicates that one or more two-dimension codes for payment are not required to be uploaded to a service server. And the value of the two-dimension code requirement identification bit is determined by the service server after the state of the payment service is detected. Specifically, the business server detects the stock of one or more two-dimensional codes in current stock, and judges whether the business server needs to add a two-dimensional code for payment newly according to the stock of the one or more two-dimensional codes and a configured two-dimensional code increment rule. When the service server needs to add a two-dimensional code newly, marking the value of a two-dimensional code demand identification bit in the message of the heartbeat feedback packet to be 1; and when the service server does not need to add a two-dimensional code newly, marking the value of the two-dimensional code demand identification bit in the message of the heartbeat feedback packet to be 0. In a possible implementation mode, the two-dimension code increment rule comprises a threshold value for judging the stock, when the stock is lower than the threshold value, the service server needs to newly add the two-dimension code for payment, otherwise, the service server does not need to add the two-dimension code for payment.
Instep 204, when one or more two-dimensional codes for payment are required to be uploaded to the service server, a thread is taken from the thread pool to initiate a two-dimensional code requirement query request to the service server, where the two-dimensional code requirement query request is used to determine the type and number of the two-dimensional codes required by the service server.
In a possible implementation manner, after receiving the two-dimension code requirement inquiry request, the service server determines the type of the required two-dimension codes and calculates the number of each two-dimension code. And the service server returns the type and the number of the required two-dimensional codes to the payment service processing server.
EXAMPLE III
Referring to fig. 3, fig. 3 is another schematic flow chart of a method for processing a payment service according to an embodiment of the present invention. The method of payment transaction processing as shown in fig. 3 may comprise the steps of:
instep 301, a heartbeat request is sent to a service server, so that the service server detects the state of the payment service according to the heartbeat request, and marks values of N demand identification bits in a message of a heartbeat feedback packet according to a detection result, wherein N is a positive integer;
instep 302, receiving a heartbeat feedback packet sent by a service server;
instep 303, obtaining a value of a refund requirement identification bit from a message of the heartbeat feedback packet; the value of the refund requirement identification bit is used to determine whether any order requires refund.
In one possible embodiment, the refund requirement identification bit has a value of 1 or 0. When the value of the refund requirement identification bit is 1, indicating that an order needing refund exists currently; when the value of the refund requirement identification bit is 0, the refund requirement identification bit indicates that no order needing refund exists currently. The value of the refund requirement identification bit is determined by the service server after the state of the payment service is detected. Specifically, the service server detects whether an order needing to be refunded exists in the current payment order, and if the order needing to be refunded exists in the current payment order, the service server marks the value of a refunded demand identification bit in a message of the heartbeat feedback packet as 1. And if the current payment order does not have an order needing refund, the service server marks the value of the refund requirement identification position in the message of the heartbeat feedback packet as 0.
Instep 304, when there is an order requiring refund, the thread is taken from the thread pool to initiate a request for requesting refund to the service server, and the request for requesting refund is used for inquiring the order requiring refund currently from the service server.
In a possible implementation manner, the service server inquires the order which needs to be refunded after receiving the refund requirement inquiry request, and returns the inquired order which needs to be refunded to the payment service processing server.
Example four
Referring to fig. 4, fig. 4 is another schematic flow chart of a method for processing a payment service according to an embodiment of the present invention. The method of payment transaction processing as shown in fig. 4 may comprise the steps of:
instep 401, a heartbeat request is sent to a service server, so that the service server detects the state of the payment service according to the heartbeat request, and marks values of N required identification bits in a message of a heartbeat feedback packet according to a detection result, wherein N is a positive integer;
instep 402, receiving a heartbeat feedback packet sent by a service server;
instep 403, obtaining the value of the bill identification bit from the message of the heartbeat feedback packet; the value of the bill identification bit is used to determine whether the bill needs to be sent.
In one possible embodiment, the bill identification bit has a value of 1 or 0. When the value of the bill identification bit is 1, the condition of triggering the bill sending is satisfied. When the value of the bill identification bit is 0, it indicates that the condition for triggering the bill sending is not satisfied. The service server checks after the heartbeat request whether a bill generated within a time period has been received, for example yesterday. And if the bill is not received, continuously judging whether the condition that the payment service processing server is triggered to send the bill through the heartbeat feedback packet is met. And if the condition that the payment service processing server is triggered to send the bill through the heartbeat feedback packet is met, marking the value of the bill identification bit as 1, otherwise, marking the value of the bill identification bit as 1.
Instep 404, when the bill needs to be sent, the thread is taken from the thread pool to detect the date of the last account checking completion; and sending a bill message to the payment service processing server, wherein the bill message comprises a bill and a date of account checking completion.
It should be noted that, in some specific embodiments, the service server may mark values of a plurality of requirement identification bits. For example, the value of the two-dimensional code requirement identification bit, the value of the refund requirement identification bit and the value of the bill identification bit are marked at a time. In other embodiments of the present application, other requirement flag bits may also be set. The payment service processing server may obtain values of a plurality of requirement identification bits from a message of the heartbeat feedback packet, for example, obtain a value of the two-dimensional code requirement identification bit, a value of the refund requirement identification bit, and a value of the bill identification bit. The payment service processing server can initiate a payment service data processing request according to the value of the two-dimensional code demand identification bit, the value of the refund demand identification bit and the value of the bill identification bit once or one by one according to network conditions and computing power.
EXAMPLE five
Corresponding to the method for processing payment services provided in the first embodiment, the present invention further provides adevice 50 for processing payment services, as shown in fig. 5, including a heartbeatrequest sending module 510, a heartbeat feedbackpacket receiving module 520, avalue obtaining module 530, and a requirementflag responding module 540.
A heartbeatrequest sending module 510, configured to send a heartbeat request to a service server, so that the service server detects a state of a payment service according to the heartbeat request, and marks values of N demand identification bits in a message of a heartbeat feedback packet according to a detection result, where N is a positive integer;
a heartbeat feedbackpacket receiving module 520, configured to receive a heartbeat feedback packet sent by a service server;
avalue obtaining module 530, configured to obtain values of the N demand identification bits from a message of the heartbeat feedback packet;
the requirement identificationbit response module 540 initiates a payment service data processing request according to the values of the N requirement identification bits.
As shown in fig. 6, thevalue obtaining module 530 includes a two-dimensional code requirementflag obtaining module 531, a refund requirementflag obtaining module 532, and a billflag obtaining module 533.
A two-dimension code requirement identificationbit obtaining module 531, configured to obtain a value of a two-dimension code requirement identification bit from a packet of the heartbeat feedback packet; the value of the two-dimension code requirement identification bit is used for determining whether one or more two-dimension codes for payment need to be uploaded to a service server.
A refund requirement identificationbit obtaining module 532, configured to obtain a value of the refund requirement identification bit from a message of the heartbeat feedback packet; the value of the refund requirement identification bit is used to determine whether any order requires refund.
A bill identificationbit obtaining module 533, configured to obtain a value of the bill identification bit from the message of the heartbeat feedback packet; the value of the bill identification bit is used to determine whether the bill needs to be sent.
As shown in fig. 7, the requirementidentifier response module 540 includes a two-dimensional code requirement queryrequest initiation module 541, a refund requirement queryrequest initiation module 542, and a billmessage sending module 543.
The two-dimensional code requirement inquiryrequest initiating module 541 is configured to, when one or more two-dimensional codes for payment need to be uploaded to the service server, retrieve a thread from the thread pool and initiate a two-dimensional code requirement inquiry request to the service server, where the two-dimensional code requirement inquiry request is used to determine the type and number of the two-dimensional codes required by the service server.
The refund requirement inquiryrequest initiating module 542 is configured to, when there is an order to be refunded, retrieve a thread from the thread pool and initiate a refund requirement inquiry request to the service server, where the refund requirement inquiry request is used to query the service server for the order currently requiring refund.
The billmessage sending module 543 is used for taking the thread from the thread pool to detect the date of the latest account checking completion when the bill needs to be sent; and sending a bill message to the payment service processing server, wherein the bill message comprises a bill and a date of account checking completion.
EXAMPLE six
Theservice server 80 according to the sixth embodiment is provided, as shown in fig. 8, and includes a heartbeatrequest receiving module 810, a requirementflag marking module 820, and a heartbeat feedbackpacket sending module 830.
A heartbeatrequest receiving module 810, configured to receive a heartbeat request sent by the payment service processing server.
A requirement identificationbit marking module 820, configured to detect the state of the payment service according to the heartbeat request, and mark values of N requirement identification bits in a packet of the heartbeat feedback packet according to a detection result, where N is a positive integer. .
And a heartbeat feedbackpacket sending module 830, configured to send a heartbeat feedback packet to the payment service processing server.
As shown in fig. 9, the requirement identificationbit marking module 820 includes a two-dimensional code requirement identificationbit marking module 821, a refund requirement identification bit marking 822, and a bill identification bit marking 823.
The two-dimension code requirement identificationbit marking module 821 is configured to judge whether the number of the stored two-dimension codes is greater than a preset number, and mark a value of the two-dimension code requirement identification bit in a message of the heartbeat feedback packet according to a judgment result.
And the refund demandidentification position mark 822 is used for judging whether the current payment order is a refund order or not and marking the refund demand identification position in the message of the heartbeat feedback packet according to the judgment result.
And the billidentification bit mark 823 is used for judging whether yesterday statement is not received and whether the current time is longer than the preset time, and marking a bill identification bit in the message of the heartbeat feedback packet according to the judgment result.
EXAMPLE seven
The present invention further provides a system 100 for processing payment services, as shown in fig. 10, including at least one payment service processing server and at least one service server, where the payment service processing server and the service server are connected in a communication manner; the payment service processing server sends a heartbeat request to the service server so that the service server detects the state of the payment service according to the heartbeat request and marks the values of N required identification bits in the message of the heartbeat feedback packet according to the detection result, wherein N is a positive integer; the payment service processing server receives a heartbeat feedback packet sent by the service server; the payment service processing server acquires the values of N demand identification bits from the message of the heartbeat feedback packet; and the payment service processing server initiates a payment service data processing request according to the values of the N demand identification bits.
The service server is used for receiving the heartbeat request sent by the payment service processing server; detecting the state of the payment service according to the heartbeat request, and marking the values of N demand identification bits in the message of the heartbeat feedback packet according to the detection result, wherein N is a positive integer; and sending the heartbeat feedback packet to a payment service processing server.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. The first to seventh embodiments may be implemented separately or in one embodiment.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 11 is a schematic diagram of an electronic device for processing payment services according to an embodiment of the present invention. As shown in fig. 11, anelectronic device 11 for payment transaction processing of this embodiment includes: aprocessor 110, amemory 111, and acomputer program 112, such as a program for payment transaction processing, stored in thememory 111 and operable on theprocessor 110. The steps in the various payment transaction processing method embodiments described above, such assteps 101 to 105 shown in fig. 1, are implemented when theprocessor 110 executes thecomputer program 112. Alternatively, theprocessor 110, when executing thecomputer program 112, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 410 to 450 shown in fig. 4.
Illustratively, thecomputer program 112 may be divided into one or more modules/units, which are stored in thememory 111 and executed by theprocessor 110 to implement the present invention. One or more of the modules/units may be a series of computer program instruction segments capable of performing specific functions for describing the execution of thecomputer program 112 in thedevice 11 for payment transaction processing. For example, thecomputer program 112 may be divided into a heartbeatrequest sending module 510, a heartbeat feedbackpacket receiving module 520, avalue obtaining module 530, and a requirement identification position responding module 540 (a module in a virtual device), where the specific functions of the modules are as follows:
a heartbeatrequest sending module 510, configured to send a heartbeat request to a service server, so that the service server detects a state of a payment service according to the heartbeat request, and marks values of N demand identification bits in a message of a heartbeat feedback packet according to a detection result, where N is a positive integer;
a heartbeat feedbackpacket receiving module 520, configured to receive the heartbeat feedback packet sent by the service server;
avalue obtaining module 530, configured to obtain values of the N requirement identification bits from the message of the heartbeat feedback packet;
the requirement identificationbit response module 540 initiates a payment service data processing request according to the values of the N requirement identification bits.
Theelectronic device 11 of the payment transaction processing may be a drone management server. The electronic device for payment transaction processing may include, but is not limited to, aprocessor 110, amemory 111. It will be understood by those skilled in the art that fig. 11 is merely an example of theelectronic device 11 for payment transaction processing and does not constitute a limitation of theelectronic device 11 for payment transaction processing, and may include more or less components than those shown, or some components in combination, or different components, for example, the apparatus for payment transaction processing may further include an input-output device, a network access device, a bus, etc.
TheProcessor 110 may be a Central Processing Unit (CPU), other general purpose Processor, a DigiTal Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Thememory 111 may be an internal storage unit of theelectronic device 11 for payment transaction processing, such as a hard disk or a memory of theelectronic device 11 for payment transaction processing. Thememory 111 may also be an external storage device of theelectronic device 11 for payment transaction processing, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure DigiTal (SD) Card, a Flash memory Card (Flash Card), and the like, which are equipped on theelectronic device 11 for payment transaction processing. Further, thememory 111 may also include both an internal storage unit and an external storage device of theelectronic device 11 for payment transaction processing. Thememory 111 is used for storing the computer program and other programs and data required by the electronic device of the payment transaction. Thememory 111 may also be used to temporarily store data that has been output or is to be output.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.