Data processing method and related device
By configuring the payment terminal keywords, identifying and performing payment tasks in transaction information transmitted by the cash register, the problems of high software development costs and complex operations in the existing technology are solved, and the effect of simplifying transaction processes and improving transaction efficiency is achieved.
Patent Information
- Application Number
- CN202411940021.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, cash register manufacturers need to carry out software development on the cash register side for different transaction scenarios to meet diversified payment needs, but software development is costly and complex.
By configuring the payment terminal, the transaction information transmitted by the cash register is identified using the pre-configured keyword information, the payment keyword is identified to determine the payment task to be completed, and the corresponding transaction task is performed based on the transaction amount and transaction identification in the transaction information.
It simplifies the transaction process, adapts to diversified payment methods, improves transaction processing efficiency, and avoids complex software development on the cash register side.
Smart Images

Figure CN119863237A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data processing method and related devices. Background Art
[0002] Cash registers are devices that process payment transactions. As an important part of modern electronic payment systems, they are widely used in many industries such as retail, catering, transportation, and medical care.
[0003] In the related technology, cash register manufacturers need to develop software on the cash register side for different transaction scenarios to integrate payment functions to meet diverse payment needs.
[0004] However, software development is costly and the actual operation is complex. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a data processing method and related devices, which simplify the transaction process by configuring the payment terminal, adapt to various payment methods, and effectively improve the transaction efficiency.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] In one aspect, the present application provides a data processing method, which is executed by a payment terminal, and includes:
[0008] After the payment terminal establishes a data connection with the cash register through the printer module configured by the payment terminal, a bill printing instruction is obtained from the cash register, where the bill printing instruction includes transaction information;
[0009] Perform keyword recognition on the transaction information according to pre-configured keyword information;
[0010] In response to identifying a payment keyword in the keyword information in the transaction information, identifying that the transaction information corresponds to a first transaction task to be paid;
[0011] Execute the first transaction task according to the transaction amount and transaction identifier involved in the transaction information;
[0012] After the transaction is successful, print a payment completion receipt for the first transaction task.
[0013] In a possible implementation, the keyword information further includes non-payment keywords, and the keyword recognition of the transaction information according to the pre-configured keyword information includes:
[0014] Performing keyword recognition on the transaction information according to the non-payment keyword;
[0015] In response to the transaction information including the non-payment keyword, identifying that the transaction information corresponds to a second transaction task for which payment has been completed, and printing a payment completion receipt for the second transaction task;
[0016] In response to the transaction information not including the non-payment keyword, keyword recognition is performed on the transaction information according to the payment keyword.
[0017] In a possible implementation, the keyword information further includes a refund keyword, and the keyword recognition of the transaction information according to the payment keyword includes:
[0018] According to the payment keyword and the refund keyword, respectively, the transaction information is subjected to keyword recognition;
[0019] In response to identifying the refund keyword in the transaction information, identifying that the transaction information corresponds to a third transaction task for a transaction refund;
[0020] Executing the third transaction task according to the transaction amount and transaction identifier involved in the transaction information;
[0021] After the refund is successful, print a refund completion receipt for the third transaction task.
[0022] In a possible implementation, the transaction information includes multiple lines of text, and after identifying that the transaction information corresponds to a first transaction task to be paid, the method further includes:
[0023] Determine a target row where the payment keyword in the transaction information is located;
[0024] According to the position of the payment keyword in the target line, the transaction amount is identified from the text included in the target line, and according to the order number keyword in the keyword information, the transaction identifier is identified from the transaction information.
[0025] In a possible implementation, the step of identifying the transaction amount from text included in the target line according to the position of the payment keyword in the target line includes:
[0026] Extracting target content from the text included in the target line according to the position of the payment keyword in the target line;
[0027] Determine the relationship between the character string type of the target content and the specified type;
[0028] If the string type is the specified type, identifying the target content as the transaction amount;
[0029] If the character string type is not the specified type, it is determined that the recognition has failed and a prompt is given.
[0030] In a possible implementation manner, before performing keyword recognition on the transaction information according to the pre-configured keyword information, the method further includes:
[0031] Determine the printing mode corresponding to the bill printing instruction;
[0032] When the printing mode is image printing, performing text recognition on the image carried by the bill printing instruction to obtain the transaction information;
[0033] When the printing mode is text printing, the text content carried by the bill printing instruction is determined as the transaction information.
[0034] In a possible implementation, the method further includes:
[0035] Acquire target configuration information provided by a merchant using the payment terminal through a configuration page, wherein the target configuration information includes the keyword information;
[0036] The configuration page includes a cash register model option. When the cash register model option is selected as the target model, the configuration page displays a default keyword option corresponding to the target model. The keyword content in the default keyword option is editable. When the completion configuration option of the configuration page is triggered, the target configuration information is generated.
[0037] In another aspect, the present application provides a data processing device, the device comprising an acquisition unit, an identification unit, an execution unit, and a printing unit:
[0038] The acquiring unit is used to acquire a bill printing instruction from the cash register after the payment terminal establishes a data connection with the cash register through the printer module configured by the payment terminal, wherein the bill printing instruction includes transaction information;
[0039] The identification unit is used to perform keyword identification on the transaction information according to pre-configured keyword information;
[0040] The identification unit is further configured to identify, in response to identifying a payment keyword in the keyword information in the transaction information, that the transaction information corresponds to a first transaction task to be paid;
[0041] The execution unit is used to execute the first transaction task according to the transaction amount and transaction identifier involved in the transaction information;
[0042] The printing unit is used to print a payment completion receipt for the first transaction task after the transaction is successful.
[0043] In a possible implementation manner, the identification unit is further configured to:
[0044] Performing keyword recognition on the transaction information according to the non-payment keyword;
[0045] In response to the transaction information including the non-payment keyword, identifying that the transaction information corresponds to a second transaction task for which payment has been completed, and printing a payment completion receipt for the second transaction task;
[0046] In response to the transaction information not including the non-payment keyword, keyword recognition is performed on the transaction information according to the payment keyword.
[0047] In a possible implementation manner, the identification unit is further configured to:
[0048] According to the payment keyword and the refund keyword, respectively, the transaction information is subjected to keyword recognition;
[0049] In response to identifying the refund keyword in the transaction information, identifying that the transaction information corresponds to a third transaction task for a transaction refund;
[0050] Executing the third transaction task according to the transaction amount and transaction identifier involved in the transaction information;
[0051] After the refund is successful, print a refund completion receipt for the third transaction task.
[0052] In a possible implementation manner, the device further includes a determining unit:
[0053] The determining unit is used to determine the target row where the payment keyword is located in the transaction information;
[0054] The identification unit is also used to identify the transaction amount from the text included in the target line according to the position of the payment keyword in the target line, and to identify the transaction identifier from the transaction information according to the order number keyword in the keyword information.
[0055] In a possible implementation manner, the identification unit is further configured to:
[0056] Extracting target content from the text included in the target line according to the position of the payment keyword in the target line;
[0057] Determine the relationship between the character string type of the target content and the specified type;
[0058] If the string type is the specified type, identifying the target content as the transaction amount;
[0059] If the character string type is not the specified type, it is determined that the recognition has failed and a prompt is given.
[0060] In a possible implementation manner, the identification unit is further configured to:
[0061] Determine the printing mode corresponding to the bill printing instruction;
[0062] When the printing mode is image printing, performing text recognition on the image carried by the bill printing instruction to obtain the transaction information;
[0063] When the printing mode is text printing, the text content carried by the bill printing instruction is determined as the transaction information.
[0064] In a possible implementation manner, the acquiring unit is further configured to:
[0065] Acquire target configuration information provided by a merchant using the payment terminal through a configuration page, wherein the target configuration information includes the keyword information;
[0066] The configuration page includes a cash register model option. When the cash register model option is selected as the target model, the configuration page displays a default keyword option corresponding to the target model. The keyword content in the default keyword option is editable. When the completion configuration option of the configuration page is triggered, the target configuration information is generated.
[0067] In another aspect, the present application provides a computer device, the computer device comprising a processor and a memory:
[0068] The memory is used to store computer programs;
[0069] The processor is configured to execute the method according to the computer program.
[0070] On the other hand, the present application provides a computer-readable medium, wherein the computer-readable medium is used to store a computer program, and when the computer program is executed by a computer device, the method is implemented.
[0071] It can be seen from the above technical solution that after the payment terminal establishes a data connection with the cash register through the printer module configured by itself, the transaction information contained in the bill printing instruction transmitted by the cash register can be directly identified through the pre-configured keyword information, and the transaction keywords can be accurately and quickly obtained. If the transaction information contains payment keywords in the keyword information, the first transaction task to be paid can be identified according to the keywords, and then the first transaction task can be executed according to the transaction amount and transaction identifier in the transaction information. As a result, a variety of transaction methods can be adapted through the payment terminal without the need for software development on the cash register side, which simplifies the transaction process and effectively improves the efficiency of transaction processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0073] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;
[0074] Figure 2 A schematic diagram of configuring a payment terminal through a business system provided in an embodiment of the present application;
[0075] Figure 3 A schematic diagram of a payment terminal provided in an embodiment of the present application for printing a receipt when it is turned on;
[0076] Figure 4 A schematic diagram of a configuration page of a payment terminal provided in an embodiment of the present application;
[0077] Figure 5 A flowchart of another data processing method provided in an embodiment of the present application;
[0078] Figure 6 A flowchart of a method for identifying keywords provided in an embodiment of the present application;
[0079] Figure 7 A schematic diagram of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0080] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0081] As described in the background art, due to the diversity of transaction scenarios, it is necessary to develop software on the cash register side for different transaction scenarios to meet diverse payment needs. However, the cost of software development is high and the operation during transactions is relatively complicated.
[0082] The present application provides a data processing method, which can identify whether a payment keyword exists in the transaction information transmitted by the cash register by pre-configuring keyword information on the payment terminal, thereby determining the transaction task to be paid, and can directly perform the corresponding transaction based on the transaction amount and transaction identifier in the transaction information without the need for software development on the cash register side, thereby simplifying the transaction process, adapting to a variety of payment methods, and effectively improving transaction efficiency.
[0083] A data processing method provided in an embodiment of the present application can be implemented through a payment terminal. The payment terminal has transaction functions and printing functions and can be used in various places such as catering, retail, supermarkets, hospitals, etc.
[0084] See also Figure 1 FIG. 1 is a flow chart of a data processing method provided in an embodiment of the present application. The method is executed by a payment terminal.
[0085] S101: After the payment terminal establishes a data connection with the cash register through the printer module configured by the payment terminal, it obtains a bill printing instruction from the cash register.
[0086] The payment terminal has a printing function, can provide a bill printing function through its own printer module, and has an electronic payment function. For example, the payment terminal can perform scanning payment, card payment, etc. to support multiple payment methods.
[0087] The bill printing instruction includes transaction information, including various types of information related to the transaction task, such as order number, product information, transaction amount, order time, etc., which are used to indicate which bill printing instructions are for printing only and which bill printing instructions are bills to be paid.
[0088] The cash register provides merchants with a variety of functions such as product price calculation and transaction entry, and establishes a data connection with the payment terminal through wired connection, wireless connection or software docking. After the payment terminal receives the bill printing instruction sent by the cash register, the payment terminal parses the bill printing instruction and prints the transaction information.
[0089] Take a restaurant business as an example. After the customer places an order, the merchant selects the corresponding dish information on the cash register and selects to collect payment. The cash register automatically settles the total amount of the dish and sends a bill printing instruction to the printer, instructing the printer to print the bill. The bill printing instruction includes dish information, payment information, remarks, etc. For example, dish information includes dish name, quantity, and dish unit price, and payment information includes order number, amount receivable, etc.
[0090] S102: Perform keyword recognition on the transaction information according to pre-configured keyword information.
[0091] Keyword information is used to indicate transaction tasks. It can be pre-configured by the provider of the payment terminal according to the merchant's needs, or it can be manually configured by the merchant according to the default configuration options of the payment terminal. For example, keywords may include checkout keywords, non-checkout keywords, refund keywords, custom keywords, etc.
[0092] Among them, the invoice keywords indicate the payment task, which can be "receivable", "order number" and "amount". Non-invoice keywords can be used to confirm whether the order content is correct for the customer, such as "customer viewing order", "product details" and other keywords that indicate that the product information is printed, or after the customer pays in cash, the keywords that indicate that the payment terminal does not need to continue the payment operation. Refund keywords indicate a refund transaction, which can be "refund product", "refund amount" and "return reason". Custom keywords can include the merchant's remarks.
[0093] Based on the pre-configured keyword information, the payment terminal can match the transaction information contained in the bill printing instruction transmitted by the cash register with the keyword to determine the transaction task.
[0094] S103: In response to identifying a payment keyword in the keyword information in the transaction information, identifying that the transaction information corresponds to a first transaction task to be paid.
[0095] The payment keyword is used to indicate a payment transaction. The first transaction task is used to indicate a task to be paid. For example, when the payment terminal matches a keyword such as "receivable" in the transaction information, the first transaction task to be paid is determined based on the identified keywords such as "receivable".
[0096] S104: Execute the first transaction task according to the transaction amount and transaction identifier involved in the transaction information.
[0097] The transaction identifier is an order number used to identify the first transaction task. When it is determined that a payment transaction is required, the payment terminal requests the payment system to conduct the transaction based on the transaction amount and the transaction identifier in the transaction information, deducts the transaction amount from the payee's account, and transfers the amount to the payee to complete the first transaction task. The payee's account may include a bank account or a non-bank payment account.
[0098] S105: After the transaction is successful, print the payment completion receipt for the first transaction task.
[0099] Whether the transaction is successful can be determined in the following ways: the payer can make the transaction by cash payment. At this time, the payee can select the user's settled bill at the cash register and send a transaction success instruction to the payment terminal, or after the payee receives the transaction amount from the payer, the payment system sends a transaction success instruction to the payment terminal.
[0100] After the transaction is successful, the payment terminal prints a payment completion receipt for the payment task. The payment completion receipt may include the payment keywords, such as receivables, order number, amount, etc., as well as actual amount received, settlement method, transaction time, etc.
[0101] Therefore, after the payment terminal establishes a data connection with the cash register through its own configured printer module, the transaction information can be directly identified based on the transaction information contained in the bill printing instruction transmitted by the cash register through the pre-configured keyword information, and the transaction keywords can be accurately and quickly obtained. If the transaction information contains payment keywords in the keyword information, the first transaction task to be paid can be identified based on the keywords, and then the first transaction task can be executed based on the transaction amount and transaction identifier in the transaction information, without the need for complex software development for the cash register, which simplifies the transaction process and adapts to multiple payment methods, thereby effectively improving the efficiency of transaction processing.
[0102] In a possible implementation, the keyword information also includes non-payment keywords, and keyword recognition is performed on the transaction information according to the pre-configured keyword information, including:
[0103] S1021: Perform keyword recognition on transaction information based on non-payment keywords.
[0104] The non-payment keyword is a keyword used to indicate that the payment terminal does not need to continue the payment operation, such as "cash received", "transaction settled", "actually received", etc.
[0105] S1022: In response to the transaction information including a non-payment keyword, identifying that the transaction information corresponds to a second transaction task for which payment has been completed, and printing a payment completion receipt for the second transaction task.
[0106] If there are non-payment keywords in the transaction information, it means that the transaction has been successfully completed through other means. The payment terminal can identify the second transaction task based on the transaction information transmitted by the cash register, such as the transaction has been completed through cash payment, etc., and print the payment completion receipt for the second transaction task based on the keywords such as order, receivables, actual collection, amount, etc. contained in the transaction information.
[0107] S1023: In response to the transaction information not including non-payment keywords, keyword recognition is performed on the transaction information according to the payment keywords.
[0108] If the transaction information does not include non-payment keywords, it means that the transaction has not been settled. In this case, the transaction information will continue to be identified based on the payment keywords, and subsequent payment tasks will be performed.
[0109] Therefore, the setting of non-payment keywords can enable the payment terminal to support not only payment methods such as scanning or swiping cards, but also other transaction methods that do not require payment terminals, thereby adapting to a variety of transaction scenarios. In addition, in this way, payment keywords can be identified after excluding keywords unrelated to payment, which improves recognition efficiency and avoids misidentification of transaction information.
[0110] In a possible implementation, the keyword information also includes a refund keyword, and keyword recognition is performed on the transaction information based on the payment keyword, including:
[0111] S10231: Based on the payment keyword and the refund keyword, keyword recognition is performed on the transaction information respectively.
[0112] The refund keyword indicates a refund transaction, and may be "refundable goods", "refund amount" and "return reason", etc. The payment terminal may identify corresponding keywords in the transaction information based on the payment keyword and the refund keyword.
[0113] S10232: In response to identifying a refund keyword in the transaction information, identifying that the transaction information corresponds to a third transaction task of transaction refund.
[0114] If the transaction information contains refund keywords such as "refund product", "refund amount" and "return reason", the third transaction task involving the transaction refund is determined based on the transaction information.
[0115] S10233: Execute the third transaction task according to the transaction amount and transaction identifier involved in the transaction information.
[0116] When it is determined that a refund transaction is required, the payment terminal requests the payment system to conduct the transaction based on the transaction amount and order number in the transaction information, deducts the transaction amount from the payer's account, and transfers the amount to the payee, completing the third transaction task.
[0117] S10234: After the refund is successful, print the refund completion receipt for the third transaction task.
[0118] After the transaction is successful, the payment terminal prints a payment completion receipt for the refund task. The payment completion receipt may include the above refund keywords, such as the refunded goods, refund amount, reason for return, and transaction time.
[0119] Therefore, by identifying whether the transaction information includes the refund keyword, the recipient or payee of this task can be identified, so that the corresponding transaction task can be executed through the payment terminal. In addition, the parallel identification method can simultaneously identify whether the transaction task belongs to a payment task or a refund task, thereby greatly improving the flexibility and efficiency of transaction processing.
[0120] In a possible implementation, the transaction information includes multiple lines of text. After identifying that the transaction information corresponds to a first transaction task to be paid, the method further includes:
[0121] Determine the target row where the payment keyword is located in the transaction information;
[0122] According to the position of the payment keyword in the target line, the transaction amount is identified from the text included in the target line, and according to the order number keyword in the keyword information, the transaction identifier is identified from the transaction information.
[0123] Since the transaction information includes multiple lines of text, each line contains different transaction details, by identifying the line containing the keyword, it can be ensured that the transaction information corresponding to the keyword is extracted. For example, the keyword "receivable" and the transaction amount are usually in the same line, and the "order number" and the specific order number are usually in the same line. The payment terminal can identify the keywords line by line, and when the payment keywords such as "receivable" and "order number" are identified, the line number of the keyword is determined, and then the transaction amount is identified from the text of the line according to the position of the keyword "receivable" in the corresponding line, and the corresponding order number is identified from the transaction information according to the keyword "order number".
[0124] Therefore, by identifying the position of the keyword in the text, the specific transaction information corresponding to the keyword can be quickly determined, reducing the misidentification of key information, thereby further improving the efficiency of recognition.
[0125] In a possible implementation, after the keywords are identified line by line, the transaction amount is identified from the text included in the target line according to the position of the payment keyword in the target line, including:
[0126] According to the position of the payment keyword in the target line, extract the target content from the text included in the target line;
[0127] Determine the relationship between the string type of the target content and the specified type;
[0128] If the string type is the specified type, the target content is identified as the transaction amount;
[0129] If the string type is not the specified type, it is determined that the recognition has failed and a prompt is given.
[0130] The instruction type is the string type corresponding to the keyword pre-configured in the payment terminal. The payment terminal intercepts the text content after the word "receivable" in the line according to the payment keyword, such as the line where "receivable" is located, and processes the text content, such as removing irrelevant special characters and leading and trailing spaces, to obtain the target content. Then, the string type of the target content is determined and compared with the type corresponding to the pre-configured keyword "receivable". If the type comparison results are consistent, the target content is used as the transaction amount. If the type comparison results are inconsistent, it is determined that the recognition has failed, and the payment terminal prompts.
[0131] As an example, the string type corresponding to the keyword "receivable" is pre-configured in the payment terminal, that is, the content corresponding to the keyword "receivable" should be a basic amount string type. After determining that the keyword "receivable" is in the fourth line, the content after "receivable" in the fourth line is intercepted. If the content is ":¥20.00", remove ":", "¥" and the spaces at the beginning and end of the content to obtain the target content "20.00". The string type of "20.00" is a basic amount string, and "20.00" is recognized as the transaction amount. If the content after "receivable" in the fourth line is ":abc", remove ":" and the spaces at the beginning and end of the content to obtain the target content "abc". At this time, the string type of "abc" is not a basic amount string, then the recognition fails and a prompt is given through voice broadcast.
[0132] Therefore, string type verification can improve the recognition success rate of keyword corresponding information, thereby effectively improving the recognition efficiency of payment keywords in transaction information.
[0133] In a possible implementation, before performing keyword recognition on the transaction information according to the pre-configured keyword information, the method further includes:
[0134] Determine the printing mode corresponding to the bill printing instruction;
[0135] When the printing mode is image printing, the image carried by the bill printing instruction is recognized by text to obtain transaction information;
[0136] When the printing mode is text printing, the text content carried by the bill printing instruction is determined as transaction information.
[0137] The printing mode of the payment terminal may include image printing or text printing. The printing mode of the payment terminal is determined according to the bill printing instruction sent by the cash register. If the printing mode is image printing, the text in the image can be extracted through optical character recognition (OCR) technology to obtain transaction information. If the printer mode is text printing, the text content in the bill printing instruction is directly determined as the transaction information.
[0138] Therefore, by converting the image data into text data, the transaction information can be unified into a text format, so that the transaction information can be processed by keyword recognition.
[0139] In a possible implementation, the method further includes:
[0140] Obtain target configuration information provided by a merchant using a payment terminal through a configuration page, the target configuration information including keyword information;
[0141] The configuration page includes a cash register model option. When the cash register model option is selected as the target model, the configuration page displays the default keyword option corresponding to the target model. The keyword content in the default keyword option is editable. When the completion configuration option of the configuration page is triggered, the target configuration information is generated.
[0142] Due to the influence of factors such as specific business types and merchant budgets, there are different models of cash registers. For example, in hospitals, the types of cash registers include Type A, Type B, etc., which are mainly used to handle registration, payment and other services. In restaurants, the types of cash registers include Type C, etc., which are used to handle various services such as ordering, cashiering, and printing of kitchen dishes.
[0143] The payment terminal can establish data connection with cash registers of different models. Different cash register models can have different configuration information related to transactions, printing, etc. This configuration information can be pre-configured by the remote business system, or manually configured by the merchant after scanning the parameter configuration code of the payment terminal through a mobile terminal. Figure 2 , is a schematic diagram of configuring a payment terminal through a business system, where the printing terminal represents the payment terminal in this application. First, the transaction, printing and other information are configured through the business system, and then the configuration information is transmitted to the printing terminal through the push server. After the printing terminal receives the configuration information, it completes the automatic configuration and broadcasts a voice prompt to prompt that the configuration is completed.
[0144] The manual configuration method is as follows: the configuration page of the payment terminal includes a cash register model option. After the merchant selects the target model of the cash register, the configuration page of the payment terminal displays the target configuration information corresponding to the target model. For the default keywords in the target configuration information, the merchant can manually edit the content corresponding to the keywords according to actual needs. After the merchant submits the completed configuration, the corresponding target configuration information is generated, and the payment terminal performs printing based on the target configuration information.
[0145] As an example, when the payment terminal is turned on, a ticket is automatically printed, and the ticket contains the parameter configuration code of the payment terminal, see Figure 3 , which is a schematic diagram of a payment terminal provided in an embodiment of the present application for printing a receipt when it is turned on. After the merchant scans the parameter configuration code printed by the payment terminal through a mobile terminal and selects the cash register type, the configuration page of the payment terminal can be displayed, see Figure 4 , which is a schematic diagram of a configuration page of a payment terminal provided in an embodiment of the present application. The payment terminal supports pre-configuration and manual configuration. After the merchant chooses manual configuration, the configuration page displays configuration options such as whether to enable the payment function, whether to print a refund code, and configuration information such as amount keywords, order number keywords, and ignore payment keywords. Merchants can check or edit the corresponding content according to actual needs, such as checking to enable the payment function, editing the content corresponding to the amount keyword to "receivable", and editing the content corresponding to the order number keyword to "order number", etc. After the configuration is completed, the payment terminal can make payments and identify according to the configured keyword information.
[0146] Therefore, merchants can adjust the keyword configuration information according to actual needs to adapt to the personalized business needs of different merchants.
[0147] For a clearer description of this data processing method, see Figure 5 , which is a flowchart of another data processing method provided in an embodiment of the present application.
[0148] The payment terminal first receives the print data sent by the cash register, which includes transaction information such as order number, product information, amount, order time, etc., and then determines whether payment is supported based on the configuration information of the payment terminal, that is, whether the payment terminal supports the transaction. If not, the cash register receipt is directly printed, which may include keywords such as order number, product information, order time, amount, etc.
[0149] If the payment terminal supports transactions, the printing mode is determined according to the bill printing instruction sent by the cash register. If it is an image printing mode, the print data is converted into text data through OCR technology to obtain the print text data including the above transaction information. If it is a text printing mode, the print text data is directly obtained.
[0150] Then determine whether there are non-payment keywords in the text data. For example, after completing a cash transaction, the cash register transmits keywords such as "transaction completed" and "actually collected". If the non-payment keyword exists, the cash register receipt is printed.
[0151] If there are no non-payment keywords in the text data, determine whether there are payment keywords in the text data. If there are no payment keywords such as "receivable", print the cash register receipt.
[0152] If the text data contains payment keywords such as "receivable", the amount, order number and other custom transaction information are extracted, and then it is determined whether the text data contains refund keywords. If there are refund keywords such as "returned goods" and "return amount", the payment terminal will initiate a return process to the payment system for a refund. If the text data does not contain refund keywords, the transaction process is initiated based on keywords such as the amount in the text data, and the results are sent to the payment terminal.
[0153] The payment terminal will make a voice announcement of the transaction result based on the result, and judge whether the transaction is successful based on the announcement voice, such as "refund successful", "payment successful", "refund failed" or "payment failed". If the transaction is successful, a payment receipt will be printed, which includes keywords such as refund amount or transaction amount. If the transaction fails, a cash register receipt will be printed.
[0154] Among them, whether there are non-payment keywords, payment keywords and refund keywords in the text data, keywords can be identified based on the configuration information, see Figure 6 , which is a flow chart of a method for identifying keywords provided by the present application, wherein the keywords include non-payment keywords, payment keywords, and refund keywords. First, text data including transaction information, as well as pre-configured keywords and rule information are input into the data processing module of the payment terminal. The text data includes transaction information such as order number, product information, amount, order time, etc., and the payment keyword "receivable" corresponds to the target string corresponding to "receivable", that is, the configuration type of the string type of the amount is the basic amount string type.
[0155] Then the keyword position, line number, and index are identified line by line from the text data. If the recognition fails, that is, the text data does not include the "receivable" keyword, the recognition fails.
[0156] If the recognition is successful, that is, the text data includes the keyword "receivable", the target character string corresponding to the keyword is extracted, such as intercepting the line where the keyword is located, the character string after the keyword, and ignoring special characters following the keyword, such as ":", and removing the spaces at the beginning and end of the intercepted character string to obtain the target character string corresponding to the keyword "receivable", such as "20.00" or "abc", etc.
[0157] Afterwards, determine whether the target string is consistent with the configuration type. If the target string is "20.00", it is consistent with the basic amount string type, the recognition is successful, and the target string is output. If the target string is "abc", it is inconsistent with the basic amount string type, and the recognition fails.
[0158] Based on the data processing method provided in the above embodiments, the embodiment of the present application further provides a data processing device, which is described in detail below in conjunction with the accompanying drawings.
[0159] See also Figure 7 , is a schematic diagram of a data processing device provided in an embodiment of the present application, the device includes an acquisition unit 701, an identification unit 702, an execution unit 703 and a printing unit 704:
[0160] The acquiring unit is used to acquire a bill printing instruction from the cash register after the payment terminal establishes a data connection with the cash register through the printer module configured by the payment terminal, wherein the bill printing instruction includes transaction information;
[0161] The identification unit is used to perform keyword identification on the transaction information according to pre-configured keyword information;
[0162] The identification unit is further configured to identify, in response to identifying a payment keyword in the keyword information in the transaction information, that the transaction information corresponds to a first transaction task to be paid;
[0163] The execution unit is used to execute the first transaction task according to the transaction amount and transaction identifier involved in the transaction information;
[0164] The printing unit is used to print a payment completion receipt for the first transaction task after the transaction is successful.
[0165] In this way, transaction keywords can be accurately and quickly obtained based on the transaction information contained in the bill printing instructions transmitted by the cash register, so as to execute the corresponding transaction without the need for complex software development for the cash register, simplifying the transaction process and adapting to multiple payment methods, thereby effectively improving the efficiency of transaction processing.
[0166] In a possible implementation manner, the identification unit is further configured to:
[0167] Performing keyword recognition on the transaction information according to the non-payment keyword;
[0168] In response to the transaction information including the non-payment keyword, identifying that the transaction information corresponds to a second transaction task for which payment has been completed, and printing a payment completion receipt for the second transaction task;
[0169] In response to the transaction information not including the non-payment keyword, keyword recognition is performed on the transaction information according to the payment keyword.
[0170] Therefore, the setting of non-payment keywords can enable the payment terminal to support not only payment methods such as scanning codes or swiping cards, but also other transaction methods that do not require payment terminals, thereby adapting to a variety of transaction scenarios. In addition, in this way, payment keywords can be identified after excluding keywords unrelated to payment, which improves recognition efficiency and avoids misidentification of transaction information.
[0171] In a possible implementation manner, the identification unit is further configured to:
[0172] According to the payment keyword and the refund keyword, respectively, the transaction information is subjected to keyword recognition;
[0173] In response to identifying the refund keyword in the transaction information, identifying that the transaction information corresponds to a third transaction task for a transaction refund;
[0174] Executing the third transaction task according to the transaction amount and transaction identifier involved in the transaction information;
[0175] After the refund is successful, print a refund completion receipt for the third transaction task.
[0176] Therefore, by identifying whether the transaction information includes the refund keyword, the recipient or payer of this task can be identified, so that the corresponding transaction task can be executed through the payment terminal, and the parallel identification method effectively improves the recognition speed of the payment terminal.
[0177] In a possible implementation manner, the device further includes a determining unit:
[0178] The determining unit is used to determine the target row where the payment keyword is located in the transaction information;
[0179] The identification unit is also used to identify the transaction amount from the text included in the target line according to the position of the payment keyword in the target line, and to identify the transaction identifier from the transaction information according to the order number keyword in the keyword information.
[0180] Therefore, by identifying the position of the keyword in the text, the specific transaction information corresponding to the keyword can be quickly determined, thereby further improving the efficiency of recognition.
[0181] In a possible implementation manner, the identification unit is further configured to:
[0182] Extracting target content from the text included in the target line according to the position of the payment keyword in the target line;
[0183] Determine the relationship between the character string type of the target content and the specified type;
[0184] If the string type is the specified type, identifying the target content as the transaction amount;
[0185] If the character string type is not the specified type, it is determined that the recognition has failed and a prompt is given.
[0186] Therefore, string type verification can improve the recognition success rate of keyword corresponding information, thereby effectively improving the recognition efficiency of payment keywords in transaction information.
[0187] In a possible implementation manner, the identification unit is further configured to:
[0188] Determine the printing mode corresponding to the bill printing instruction;
[0189] When the printing mode is image printing, performing text recognition on the image carried by the bill printing instruction to obtain the transaction information;
[0190] When the printing mode is text printing, the text content carried by the bill printing instruction is determined as the transaction information.
[0191] Therefore, by converting the image data into text data, the transaction information can be unified into a text format, so that the transaction information can be processed by keyword recognition.
[0192] In a possible implementation manner, the acquiring unit is further configured to:
[0193] Acquire target configuration information provided by a merchant using the payment terminal through a configuration page, wherein the target configuration information includes the keyword information;
[0194] The configuration page includes a cash register model option. When the cash register model option is selected as the target model, the configuration page displays a default keyword option corresponding to the target model. The keyword content in the default keyword option is editable. When the completion configuration option of the configuration page is triggered, the target configuration information is generated.
[0195] Therefore, merchants can adjust the keyword configuration information according to actual needs to adapt to the personalized business needs of different merchants.
[0196] Based on the above embodiments, the present application also provides a computer device, which includes a processor and a memory:
[0197] The memory is used to store computer programs;
[0198] The processor is configured to execute the data processing method according to the computer program.
[0199] On the basis of the above embodiments, an embodiment of the present application further provides a computer-readable medium, wherein the computer-readable medium is used to store a computer program, and the computer program implements the data processing method when executed by a computer device.
[0200] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0201] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0202] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Moreover, based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: The method is executed by a payment terminal, and comprises: After the payment terminal establishes a data connection with the cash register through the printer module configured by the payment terminal, a bill printing instruction is obtained from the cash register, where the bill printing instruction includes transaction information; Perform keyword recognition on the transaction information according to pre-configured keyword information; In response to identifying a payment keyword in the keyword information in the transaction information, identifying that the transaction information corresponds to a first transaction task to be paid; Execute the first transaction task according to the transaction amount and transaction identifier involved in the transaction information; After the transaction is successful, print a payment completion receipt for the first transaction task.
2. The method according to claim 1, characterized in that The keyword information also includes non-payment keywords. The keyword recognition of the transaction information according to the pre-configured keyword information includes: Performing keyword recognition on the transaction information according to the non-payment keyword; In response to the transaction information including the non-payment keyword, identifying that the transaction information corresponds to a second transaction task for which payment has been completed, and printing a payment completion receipt for the second transaction task; In response to the transaction information not including the non-payment keyword, keyword recognition is performed on the transaction information according to the payment keyword.
3. The method according to claim 2, characterized in that The keyword information also includes a refund keyword, and the keyword recognition of the transaction information according to the payment keyword includes: According to the payment keyword and the refund keyword, respectively, the transaction information is subjected to keyword recognition; In response to identifying the refund keyword in the transaction information, identifying that the transaction information corresponds to a third transaction task for a transaction refund; Executing the third transaction task according to the transaction amount and transaction identifier involved in the transaction information; After the refund is successful, print a refund completion receipt for the third transaction task.
4. The method according to claim 1, characterized in that: The transaction information includes multiple lines of text. After identifying that the transaction information corresponds to a first transaction task to be paid, the method further includes: Determine a target row where the payment keyword in the transaction information is located; According to the position of the payment keyword in the target line, the transaction amount is identified from the text included in the target line, and according to the order number keyword in the keyword information, the transaction identifier is identified from the transaction information.
5. The method according to claim 4, characterized in that The step of identifying the transaction amount from the text included in the target line according to the position of the payment keyword in the target line includes: Extracting target content from the text included in the target line according to the position of the payment keyword in the target line; Determine the relationship between the character string type of the target content and the specified type; If the string type is the specified type, identifying the target content as the transaction amount; If the character string type is not the specified type, it is determined that the recognition has failed and a prompt is given.
6. The method according to claim 1, characterized in that Before performing keyword recognition on the transaction information according to the pre-configured keyword information, the method further includes: Determine the printing mode corresponding to the bill printing instruction; When the printing mode is image printing, performing text recognition on the image carried by the bill printing instruction to obtain the transaction information; When the printing mode is text printing, the text content carried by the bill printing instruction is determined as the transaction information.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Acquire target configuration information provided by a merchant using the payment terminal through a configuration page, wherein the target configuration information includes the keyword information; The configuration page includes a cash register model option. When the cash register model option is selected as the target model, the configuration page displays a default keyword option corresponding to the target model. The keyword content in the default keyword option is editable. When the completion configuration option of the configuration page is triggered, the target configuration information is generated.
8. A data processing device, characterized in that: The device comprises an acquisition unit, an identification unit, an execution unit and a printing unit: The acquiring unit is used to acquire a bill printing instruction from the cash register after the payment terminal establishes a data connection with the cash register through the printer module configured by the payment terminal, wherein the bill printing instruction includes transaction information; The identification unit is used to perform keyword identification on the transaction information according to pre-configured keyword information; The identification unit is further configured to identify, in response to identifying a payment keyword in the keyword information in the transaction information, that the transaction information corresponds to a first transaction task to be paid; The execution unit is used to execute the first transaction task according to the transaction amount and transaction identifier involved in the transaction information; The printing unit is used to print a payment completion receipt for the first transaction task after the transaction is successful.
9. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 7 according to the computer program.
10. A computer-readable medium, characterized in that The computer-readable medium is used to store a computer program, and when the computer program is executed by a computer device, the method according to any one of claims 1 to 7 is implemented.