CN112184211B - Method and device for settling payment and receipt - Google Patents

Method and device for settling payment and receipt Download PDF

Info

Publication number
CN112184211B
CN112184211B CN202010979663.8A CN202010979663A CN112184211B CN 112184211 B CN112184211 B CN 112184211B CN 202010979663 A CN202010979663 A CN 202010979663A CN 112184211 B CN112184211 B CN 112184211B
Authority
CN
China
Prior art keywords
payment
hook function
timing
character
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010979663.8A
Other languages
Chinese (zh)
Other versions
CN112184211A (en
Inventor
范博
吴亚丽
孙国栋
李世健
赵浩博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yarward Electronic Co ltd
Original Assignee
Yarward Electronic Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yarward Electronic Co ltd filed Critical Yarward Electronic Co ltd
Priority to CN202010979663.8A priority Critical patent/CN112184211B/en
Publication of CN112184211A publication Critical patent/CN112184211A/en
Application granted granted Critical
Publication of CN112184211B publication Critical patent/CN112184211B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/34Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • General Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Cash Registers Or Receiving Machines (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application discloses a method and a device for settling the payment and receipt, which are used for solving the problems that the payment mode needs to be known in advance in the payment process, so that the payment process is complex and inflexible. The method comprises the following steps: registering a delegation event related to payment through a HOOK function HOOK based on the triggering of the payment operation, wherein the payment operation comprises a card swiping operation or a code scanning operation, and the delegation event is used for acquiring the content captured by the HOOK function; monitoring content obtained based on the triggering of card swiping or code scanning operation by using a hook function; triggering a timing function when a character is monitored by using a hook function; when the next character is monitored when the timing duration is less than or equal to the first preset duration, clearing the current timing duration through a hook function and timing again; and when the timing duration is monitored to be longer than a first preset duration by using the hook function, returning the monitored content to the entrusted event through the hook function. By the method, the flexibility of payment operation is improved, and the payment efficiency is improved.

Description

Method and device for settling payment and receipt
Technical Field
The application relates to the technical field of intelligent payment, in particular to a method and a device for receiving and paying settlement.
Background
With the rapid development of scientific technology, intelligent payment has already occupied the market. At present, when a code scanning or magnetic stripe card swiping payment mode is processed, a payment mode of a user is generally required to be inquired, and then a payment code of a corresponding third-party payment platform identification client side is selected in a manual selection mode, so that payment operation is completed.
In addition, in the prior art, when a code scanning device reads the contents of a bar code and a two-dimensional code or a card reader swipes a magnetic bar card, an output focus needs to be specified, and the code scanning contents of the code scanning device or the card swiping contents of the card reader are displayed in the output focus. Therefore, the existing payment technology needs to know the way of payment in advance, and the number of characters in the character string for payment, and also needs to display the input content in the output focus. To ensure that the settlement process is performed after the last character is input. In this settlement processing method, the payment procedure is complicated and inflexible, so that the payment process is not efficient.
Disclosure of Invention
The embodiment of the application provides a method and a device for settling the payment and receipt, which are used for solving the technical problems that in the existing card swiping or code scanning process, the payment mode needs to be known in advance, so that the payment process is complex and inflexible.
In one aspect, the present application provides a method for settling a receipt and payment. Registering a delegation event related to payment through a HOOK function HOOK based on the triggering of payment operation, wherein the payment operation comprises a card swiping operation or a code scanning operation, and the delegation event is used for acquiring the content captured by the HOOK function; performing real-time monitoring on content obtained based on the triggering of the card swiping operation or the code scanning operation by using a hook function; triggering a timing function when a character is monitored by using a hook function; when the next character is monitored when the timing duration is less than or equal to the first preset duration, clearing the current timing duration through a hook function to restart timing; and when the hook function is used for monitoring that the timing duration is longer than the first preset duration, returning all monitored contents to the delegation event through the hook function.
According to the method and the device, the content of the character string corresponding to code scanning or card swiping in the payment operation process is monitored in real time by establishing the hook function and registering the entrusting event. And in the monitoring process, the hook function triggers a timing function, and whether the character string for payment is completely input is known by setting the longest timing duration. Therefore, the length of the character string corresponding to code scanning or card swiping does not need to be known in advance in the payment process, and the content of the character string does not need to be displayed in an output focus in order to check whether the character string is input completely. Therefore, steps in the operation process of code scanning or card swiping payment are reduced, and the operation can be directly carried out no matter what payment mode is selected by a customer, and the digit of the character string does not need to be known in advance. Therefore, the flexibility of payment operation is improved, and the payment efficiency is improved.
In an implementation manner of the present application, the captured content is a group of character strings corresponding to a card swiping operation or a code scanning operation.
In one implementation of the present application, after triggering the timing function, the method includes: storing the captured first character to a memory corresponding to the character string array through a hook function; and then, under the condition that the time interval of receiving two adjacent characters is less than and/or equal to a first preset time length, sequentially storing the received characters into a character string array where the first character is located.
According to the method and the device, all the monitored character strings are stored in the same character string array, firstly, good conditions are provided for sequentially storing the character strings, and the storage sequence is easier to guarantee not to be disturbed. And secondly, storing the data into the same character string array, so that the integrity of the character strings cannot be damaged, and the integrity of the character strings returned to the entrusting event is ensured.
In one implementation manner of the application, the first preset duration is longer than a time interval between two adjacent characters monitored by the hook function, wherein the two adjacent characters are characters in a group of character strings corresponding to the same payment operation; and the first preset duration does not exceed the time interval between two continuous card swiping payment processes or the time interval between two continuous code scanning payment processes.
The method and the device set the first preset duration to be larger than the time interval between two adjacent characters monitored by the hook function. The hook function can have sufficient time to wait for the keyboard to input characters, so that the characters cannot be missed in the monitoring process, and the integrity of the received character strings is guaranteed. Meanwhile, the first preset duration is set, and the time interval between two continuous card swiping payment processes or the time interval between two continuous code scanning payment processes is not exceeded. By limiting the maximum value of the first preset time, the hook function can not carry out timing without limitation, so that the payment time can be reasonably shortened, and the payment efficiency is improved.
In one implementation of the present application, the captured content specifically includes any one or more of: swiping a character string corresponding to the magnetic stripe card, scanning a character string corresponding to the two-dimensional code, and scanning a character string corresponding to the bar code; the character strings corresponding to the magnetic swiping bar card, the character strings corresponding to the scanning two-dimensional code and the character strings corresponding to the scanning bar code are different in length and/or different in composition mode.
In one implementation of the present application, after returning all the contents listened to each time to the delegation event through the hook function, the method further includes: and based on the content returned to the entrusting event, sending an interface calling request to a related payment API interface of the operator through a hook function so as to enable the payment and receipt equipment to perform settlement processing.
In one implementation of the present application, the method further comprises: receiving a settlement completion message from the operator device; and unloading the hook function corresponding to the current payment operation, and closing the entrusting event at the same time, so that the hook function corresponding to the current payment operation stops monitoring the contents of the card swiping operation or the code scanning operation.
According to the embodiment of the application, after the payment operation is completed at each time, the hook function corresponding to the current payment is unloaded in time, and the hook function can be prevented from being subjected to resource recovery. And further, the hook function is guaranteed not to be invalid, and the hook function can be normally used in the subsequent payment operation process.
In an implementation manner of the present application, the content obtained by triggering based on the code scanning operation is monitored in real time by using a hook function, which specifically includes: monitoring an input event of a keyboard by using a hook function, and determining the content of card swiping or code scanning; wherein, the keyboard input event comprises a card swiping operation and/or a code scanning operation.
In an implementation manner of the present application, returning all the contents heard each time to the delegation event through the hook function specifically includes: all the stored contents are returned to the delegation event at once by the hook function.
The embodiment of the application adopts a mode of returning the stored content to the entrusting event at one time, so that the entrusting event can receive the complete and orderly arranged content at one time. And further, the length of the character string of the content and the content of the character string do not need to be predicted in advance, and whether the currently received content is complete or not does not need to be calculated. Therefore, the payment operation is more convenient and flexible.
On the other hand, the embodiment of the present application further provides a device for settling payment and receipt, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to: registering a delegation event related to payment through a HOOK function HOOK based on the triggering of payment operation, wherein the payment operation comprises a card swiping operation or a code scanning operation, and the delegation event is used for acquiring the content captured by the HOOK function; performing real-time monitoring on content obtained based on the triggering of the card swiping operation or the code scanning operation by using a hook function; triggering a timing function when a character is monitored by using a hook function; when the next character is monitored when the timing duration is less than or equal to the first preset duration, clearing the current timing duration through a hook function to restart timing; and when the timing duration is monitored to be longer than the first preset duration by using the hook function, returning all monitored contents to the consignation event through the hook function.
According to the method and the device for settlement of the receipt and payment, the character strings corresponding to the code scanning payment or the card swiping payment are monitored by using the hook function, and the content of the character strings corresponding to the payment operation can be obtained. And meanwhile, the hook function can trigger a timing function, and all monitored contents can be returned to the entrusted event at one time under the condition that the timing time exceeds the preset duration. Therefore, the embodiment of the application can not predict the payment mode of the user in advance, and does not need to predict the length of the corresponding character string and the content of the specific character string in advance during payment. Whether the character string is input completely can be judged through the timing function, so that the payment is more flexible and convenient. And the one-time return to the entrusting event also guarantees the integrity and accuracy of the character received by the entrusting event. Therefore, the steps of the payment operation are simplified, and the efficiency of the payment operation is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart of a method for settling a receipt and payment according to an embodiment of the present application;
fig. 2 is a schematic diagram of an internal structure of a receipt and payment settlement apparatus according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The existing code scanning or card swiping payment needs to know the payment mode of a customer in advance, and the length and the characters of character strings for payment corresponding to different payment modes are different. Therefore, the payment operation is required to be executed according to the payment mode of the client, the content of the character string is required to be displayed in an output focus in the conventional code scanning or card swiping payment, and whether the character string is input is ensured under the condition that the digit of the character string for payment is known in advance. The settlement processing mode has complex payment steps and inflexible operation, so that the payment process is not efficient.
In order to solve the above problem, the embodiments of the present application provide a method and an apparatus for settling payment and receipt. And monitoring the content of the character string input by the keyboard by using the hook function, and returning the monitored content to the entrusted event registered by the hook function at one time. All characters can be stored without displaying the content of the character string in an output focus, and the integrity of the received character string is guaranteed. Meanwhile, the timing function can be triggered through the hook function, timing is started after the current character string is successfully received, and timing is stopped when the next character is received. If the timing duration exceeds the set duration, all the characters are input completely. The scheme adopted by the embodiment of the application can ensure that the complete character string is received through the timing function added to the hook function without knowing the character content and the character digit number of the character string. Therefore, the payment operation steps are reduced, and the payment efficiency is improved. Meanwhile, the payment process is more flexible, and the method is suitable for various payment scenes.
The technical solutions proposed in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a method for settling payment and receipt provided in an embodiment of the present application. As shown in fig. 1, the method and apparatus for settlement of payment and receipt includes the following steps:
and S101, loading the page to be paid by the collection and payment device, and waiting for the user to pay.
In an embodiment of the present application, in a case that payment is needed, the payment and receipt device loads a page to be paid in the display, and waits for a user to perform code scanning or card swiping payment.
Step S102, the receiving and paying device registers the entrusting event by using the hook function.
In an embodiment of the present application, each time a payment operation is performed, a hook function carried by the Windows system registers a callback event, that is, a delegation event related to the payment in the embodiment of the present application. And enabling the hook function to monitor the content of code scanning or card swiping in real time through the entrusting event. And the delegation event will also receive the contents of the character string of the swipe or swipe that is heard using the hook function.
It should be noted that the hook function in the embodiment of the present application is a part of the Windows system message processing mechanism, and is essentially a program for processing system messages, and is hung in the system through a system call.
And step S103, the payment and receipt device monitors the content of card swiping or code scanning through a hook function.
In one embodiment of the application, the payment and receipt device monitors input events of a keyboard through a hook function, wherein the input events of the keyboard comprise a card swiping operation and/or a code scanning operation. Whether the user pays by swiping a card or by scanning a code, the hook function monitors the content of the corresponding character string. The process of acquiring the content of the card swiping or code scanning by the payment and receipt device is the process of inputting the keyboard, namely the process of inputting the content of the character string for payment.
In one embodiment of the application, the content captured using the hook function includes any one or more of: swiping a character string corresponding to the magnetic stripe card, scanning a character string corresponding to the two-dimensional code, and scanning a character string corresponding to the bar code. In addition, in the embodiment of the application, the content of the character string corresponding to the magnetic swipe card, the content of the character string corresponding to the two-dimensional code, and the content of the character string corresponding to the barcode are different, that is, the composition modes of the corresponding character strings are different. The character strings corresponding to different payment modes can be combined by any one or more of numbers, letters and symbols.
Specifically, when a user performs code scanning payment, the two-dimensional code or the barcode used for payment can be scanned through the code scanning device, so as to obtain the content of the character string corresponding to the two-dimensional code or the barcode. When a user conducts card swiping payment, the user can operate through the card swiping device to obtain the content of the character string corresponding to the magnetic stripe card.
It should be noted that the code scanning device in the embodiment of the present application needs to be connected to a computer, and may be a code scanning gun, a code scanning box, or other devices. The card reader in the embodiment of the application refers to a magnetic stripe card reader, and is also used by being connected with a computer, and the card for card payment is a magnetic stripe card.
And step S104, starting a timing function through the hook function, and storing the monitored content by using the hook function.
In one embodiment of the application, during the payment process, the hook function is used to listen to the input events of the keyboard. When the hook function monitors the first character input by the keyboard, the hook function starts a timing function to time the time length required by receiving the next character.
Specifically, when the first character is monitored by using the hook function, the timing function is started, and meanwhile, the second character is waited to be received. After the hook function is used for receiving the second character, the current timing time is cleared, and the hook function restarts the timing function and waits for receiving a third character at the same time. According to the mode, the hook function clears the timing time after receiving a new character every time, and starts timing again to input a character to be next. And stopping timing by the hook function until the timing duration of the hook function is greater than a first preset duration, namely the longest duration.
In the embodiment of the application, the timing function is started by using the hook function, and the hook function is packaged. The function encapsulation is a function, which encapsulates one or more functions in a function and class manner and provides only a simple function interface for the outside. The embodiment of the application is obtained by packaging a timing function and a hook function.
According to the embodiment of the application, the timing function is restarted every time a new character is received, and the longest timing duration is set. And under the condition that the longest time length is exceeded and the hook function does not receive new characters, the fact that all the character strings corresponding to the current payment operation are input is shown. According to the method and the device, the payment mode of the user does not need to be inquired before payment, and the content of the input character string does not need to be displayed by an input focus. Whether the character string is input completely can be directly determined by judging whether the timing duration exceeds the longest duration. The payment steps are reduced, so that the payment process is more convenient and faster, the operation is more flexible, and the payment efficiency is improved.
In one embodiment of the present application, after the first character of the keyboard input is detected by using the hook function, the detected first character is temporarily stored in the character string array. When the hook function hears the second character, the second character is stored into the character string array where the first character is located.
According to the rule of the embodiment of the application, the hook function receives a new character each time the time interval for receiving two adjacent characters is less than or equal to the preset time length. The characters are sequentially stored in the character string array stored in the first character according to the sequence of the received characters.
For example, when a first character is received by the hook function, the first character to be monitored is temporarily stored in the character string array, and the hook function is used to start the timing function. When the timing time reaches 20ms, the hook function hears the second character. At this time, the hook function temporarily stores the monitored second character into the character string array where the first character is located in sequence, clears the current timing duration of 20ms, and restarts timing. If the hook function times up to 30ms again, a third character is received. At this time, the hook function puts the third character into the character string array where the first character is located in sequence, and clears the current timing time again, restarts timing, and waits for the arrival of the next character. According to the rule, the timing function is stopped until the timing duration of the hook function exceeds the preset longest duration.
It should be noted that neither 20ms nor 30ms in the embodiment of the present application exceeds the preset maximum time.
In the embodiment of the application, the received character contents are stored into the character string array in sequence through the hook function, so that the correct sequence of the character strings can be ensured. And the character strings corresponding to the current payment operation are stored in the same character string array, so that the management of the character sequences is facilitated, and the omission of the characters is avoided. Ensuring that the entire string contents can be returned to the delegation event at one time later.
And step S105, after the hook function determines that the timing duration exceeds the preset longest duration, returning the captured content to the entrusted event at one time.
In one embodiment of the present application, the hook function is used to restart the timing every time a new character is received. If the timing time exceeds the preset maximum time length, the hook function does not receive new characters. Then the hook function will return all the character content stored in the string array to the commit event at once.
In one embodiment of the present application, the maximum timing duration of the hook function is predetermined to be greater than the time interval between two adjacent characters that the hook function hears. Wherein, two adjacent characters are characters in a group of character strings corresponding to the same payment operation. And the longest timing time is smaller than and/or the time interval between two continuous card swiping payment processes or the time interval between two continuous code scanning payment processes.
Specifically, during the process of scanning a code or paying by swiping a card by a user, the time length of a single operation is about 3s. Therefore, in order to save the payment time, the preset maximum timed duration should be less than the duration of a single operation. For example, if the user adopts a gun-scanning code-scanning payment, the time required from the time when the code-scanning gun starts to scan the code to the time when the payment operation is completely completed is about 3s. Therefore, it is preferable that the preset maximum time period is set not to exceed 3s. Meanwhile, when the code scanning gun acquires the character string corresponding to the bar code, the character string is indirectly input, namely, the character is input one by one. The principle is the same as manual character string input on a keyboard, but faster. Therefore, the longest duration in the embodiment of the present application needs to be longer than the interval duration between two adjacent characters. To ensure that each character has sufficient time to be entered.
In one embodiment of the present application, the maximum timing duration of the hook function is set to 50ms. That is, in the case that the hook function timing length exceeds 50ms and no new character is received again, it indicates that all characters have been input. The hook function stops timing.
It should be noted that the longest timing duration of the hook function set in the embodiment of the present application is preferably 50ms, but is not limited to 50ms.
In one embodiment of the present application, the hook function stops timing when it is determined that the timing duration exceeds the maximum duration. And returns all the characters stored in the string array to the delegate at once.
For example, the hook function reaches 50ms in the current timing duration, and if no new character content is received within the 50ms, the hook function determines that all characters of the current character string have been input. The hook function will stop timing and return all the content currently stored in the string array to the commit event at once.
According to the method and the device, a mode of returning to the entrusting event once is adopted, and after the keyboard input event is finished, all monitored contents are returned to the entrusting event. The digit number of the character string corresponding to the specific payment operation does not need to be known, and the character string input is finished as long as the timing time is up. Returning to the commit event once is the complete string. The problem that the specific number of the bits of the character string corresponding to the card swiping or code scanning needs to be known in indirect return is solved.
And step S106, the hook function sends an interface calling request to a related payment API interface of an operator through the character string content to perform payment settlement processing.
In an embodiment of the application, after the hook function returns the monitored content of the character string to the delegation event, the hook function sends an interface call request to a related payment API interface of an operator (software that can be used for payment, such as wechat, pay pal, and the like) based on the content returned to the delegation event. The payment and receipt device performs settlement processing.
Specifically, if the user adopts code scanning payment, the hook function returns the content of the relevant character string to the entrusted event after the code scanning gun obtains the content of the relevant character string. After the specific content of the character string is written into the entrusting event, the hook function sends an interface calling request to a related payment API interface of the WeChat or Paibao through the content of the character string. After the request is successful, the relevant software of the operator can perform relevant payment operation according to the content of the character string.
In an embodiment of the application, if the user adopts card payment, after the hook function writes the content of the received character string into the delegation event, the hook function applies for settlement processing to the related payment software corresponding to the magnetic stripe card through the content of the character string. The magnetic stripe card in the embodiment of the application can be applied in the following scenes: medical insurance cards and treatment cards which are needed to be used when the hospital pays fees, or supermarket shopping cards, membership cards and other cards which need magnetic stripes for payment.
And S107, finishing monitoring by the hook function, and unloading the hook function corresponding to the current payment operation by the processor through a corresponding program.
In one embodiment of the present application, after the operator performs the settlement process, the result of the settlement is transmitted to the payment receiving device regardless of whether the payment is successful or not. After receiving a settlement completion message of operator equipment, the hook function corresponding to the current payment operation needs to be unloaded, and meanwhile, the entrusting event registered by the current hook function is closed, so that the hook function corresponding to the current payment operation stops monitoring the contents of the card swiping operation or the code scanning operation.
The embodiment of the application adopts a self-contained hook function of the windows system. If the delegated event registered by the hook function is not closed, the hook function risks being used as garbage for resource recovery, and the hook function is invalid, so that the subsequent acquisition of the card swiping or code scanning content fails. Therefore, the problem can be effectively avoided by closing the monitoring event of the hook function in time after settlement processing is carried out each time. Thereby improving the stability of the payment process.
Fig. 2 is a schematic view of an internal structure of a receipt and payment settlement apparatus according to an embodiment of the present application.
The embodiment of the application provides a receipt and payment settlement device, includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the at least one processor to:
registering a delegation event related to payment through a HOOK function HOOK based on the triggering of the payment operation, wherein the payment operation comprises a card swiping operation or a code scanning operation, and the delegation event is used for acquiring the content captured by the HOOK function.
And using a hook function to monitor the content obtained based on the trigger of the card swiping operation or the code scanning operation in real time.
Triggering a timing function when the hook function is used for monitoring the characters; and clearing the current timing time through the hook function to restart timing under the condition that the next character is monitored when the timing time is less than or equal to the first preset time.
And when the hook function is used for monitoring that the timing duration is longer than the first preset duration, returning all monitored contents to the consignation event through the hook function.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art to which the present application pertains. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (8)

1. A method for settling a receipt or payment, the method comprising:
registering a delegation event related to payment through a hook function based on triggering of payment operation, wherein the payment operation comprises card swiping operation or code scanning operation, and the delegation event is used for acquiring content captured by the hook function;
performing real-time monitoring on content obtained based on the triggering of the card swiping operation or the code scanning operation by using a hook function;
triggering a timing function when the hook function is used for monitoring the characters; when the next character is monitored when the timing duration is less than or equal to the first preset duration, clearing the current timing duration through the hook function to restart timing;
and when the hook function is used for monitoring that the timing duration is longer than the first preset duration, returning all stored contents to the consignation event at one time through the hook function.
2. The method of claim 1, wherein the captured content is a set of strings corresponding to a card swiping operation or a code scanning operation.
3. A receipt and payment settlement method as claimed in claim 1, wherein after said triggering of the timing function, said method comprises:
storing the captured first character to a memory corresponding to the character string array through the hook function;
and then, under the condition that the time interval of receiving two adjacent characters is less than or equal to a first preset time length, sequentially storing the received characters into a character string array where the first character is located.
4. The receipt and payment settlement method according to claim 1,
the first preset duration is longer than a time interval between two adjacent characters monitored by the hook function, wherein the two adjacent characters are characters in a group of character strings corresponding to the same payment operation; and is provided with
The first preset duration is not more than the time interval between two continuous card swiping payment processes or the time interval between two continuous code scanning payment processes.
5. The receipt and payment settlement method of claim 1, wherein the captured content specifically comprises any one or more of the following: swiping a character string corresponding to the magnetic stripe card, scanning a character string corresponding to the two-dimensional code, and scanning a character string corresponding to the bar code;
the character strings corresponding to the magnetic swiping bar card, the character strings corresponding to the scanning two-dimensional code and the character strings corresponding to the scanning bar code are different in length and/or different in composition mode.
6. The receipt and payment settlement method according to claim 1, wherein after the step of returning all the stored contents to the delegation event at once by the hook function, the method further comprises:
and based on the content returned to the entrusted event, sending an interface calling request to a related payment API (application program interface) of an operator through the hook function so as to enable the payment and receipt equipment to perform settlement processing.
7. The receipt and payment settlement method of claim 6, further comprising:
receiving a settlement completion message from the operator payment related device;
and unloading the hook function corresponding to the current payment operation, and closing the entrusting event at the same time, so that the hook function corresponding to the current payment operation stops monitoring the contents of the card swiping operation or code scanning operation.
8. An apparatus for settling a receipt or payment, the apparatus comprising:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
registering a delegation event related to payment through a hook function based on triggering of payment operation, wherein the payment operation comprises card swiping operation or code scanning operation, and the delegation event is used for acquiring content captured by the hook function;
performing real-time monitoring on content obtained based on the triggering of the card swiping operation or the code scanning operation by using a hook function;
triggering a timing function when the characters are monitored by using the hook function; when the timing duration is less than or equal to the first preset duration and the next character is monitored, clearing the current timing duration through the hook function to restart timing;
and when the hook function is used for monitoring that the timing duration is longer than the first preset duration, returning all stored contents to the consignation event at one time through the hook function.
CN202010979663.8A 2020-09-17 2020-09-17 Method and device for settling payment and receipt Active CN112184211B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010979663.8A CN112184211B (en) 2020-09-17 2020-09-17 Method and device for settling payment and receipt

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010979663.8A CN112184211B (en) 2020-09-17 2020-09-17 Method and device for settling payment and receipt

Publications (2)

Publication Number Publication Date
CN112184211A CN112184211A (en) 2021-01-05
CN112184211B true CN112184211B (en) 2022-11-11

Family

ID=73921475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010979663.8A Active CN112184211B (en) 2020-09-17 2020-09-17 Method and device for settling payment and receipt

Country Status (1)

Country Link
CN (1) CN112184211B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017117220A (en) * 2015-12-24 2017-06-29 富士通フロンテック株式会社 Self-payment system and self-payment operation method
CN111045529A (en) * 2019-12-13 2020-04-21 金蝶智慧科技(深圳)有限公司 Data input method, system and related equipment
CN111367821A (en) * 2020-05-22 2020-07-03 支付宝(杭州)信息技术有限公司 Software testing method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9811870B2 (en) * 2013-12-24 2017-11-07 Tencent Technology (Shenzhen) Company Limited Information processing method, apparatus and payment system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017117220A (en) * 2015-12-24 2017-06-29 富士通フロンテック株式会社 Self-payment system and self-payment operation method
CN111045529A (en) * 2019-12-13 2020-04-21 金蝶智慧科技(深圳)有限公司 Data input method, system and related equipment
CN111367821A (en) * 2020-05-22 2020-07-03 支付宝(杭州)信息技术有限公司 Software testing method and system

Also Published As

Publication number Publication date
CN112184211A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN107833341B (en) Intelligent queuing method, equipment and computer readable storage medium
CN106934318B (en) Code scanning processing method, device and system
CN112991635B (en) Storage and taking method and device for intelligent cabinet
US20050167512A1 (en) Secure device and information processing apparatus
KR101067326B1 (en) Apparatus and method for providing service based on location in mibile communication system
CN112184211B (en) Method and device for settling payment and receipt
CN108549534B (en) Graphical user interface redrawing method, terminal device and computer-readable storage medium
CN111045529B (en) Data input method, system and related equipment
CN112465497A (en) Payment method, payment device, electronic equipment and medium
CN109829526B (en) Bar code management method and device and electronic equipment
EP3859627A1 (en) Method, system, and apparatus for merging order goods and electronic device
CN107741885B (en) Transaction and service association method and system based on CS framework
CN115061824A (en) Method and device for sending name list and electronic equipment
CN112463348B (en) Timed task processing method and device
CN107728769B (en) Background application management method and device and computer readable storage medium
CN113962646A (en) Intelligent reminding method and system for bank counter business operation
CN113313278A (en) Commemorative coin reservation method based on block chain, user terminal and block chain link point
CN113094305A (en) Asynchronous communication processing method, device and storage medium
CN111598503A (en) Material checking method, mobile terminal and computer readable storage medium
CN111475723A (en) User behavior analysis platform, product service exception processing method and medium
CN110515718A (en) Batch tasks breakpoint is continuous to make method, apparatus, equipment and medium
CN110908866A (en) Software monitoring method and related equipment
CN111475870A (en) Resetting method and device, electronic equipment and computer storage medium
CN110008010A (en) System call method, device, equipment and readable storage medium storing program for executing
CN109191286A (en) The processing method and processing device of one kind of multiple external datas

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant