CN114386958A - POS terminal-based transaction data processing method, apparatus, device and storage medium - Google Patents

POS terminal-based transaction data processing method, apparatus, device and storage medium Download PDF

Info

Publication number
CN114386958A
CN114386958A CN202210037079.XA CN202210037079A CN114386958A CN 114386958 A CN114386958 A CN 114386958A CN 202210037079 A CN202210037079 A CN 202210037079A CN 114386958 A CN114386958 A CN 114386958A
Authority
CN
China
Prior art keywords
pos
transaction
target
data
terminal
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.)
Pending
Application number
CN202210037079.XA
Other languages
Chinese (zh)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210037079.XA priority Critical patent/CN114386958A/en
Publication of CN114386958A publication Critical patent/CN114386958A/en
Pending legal-status Critical Current

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/08Payment architectures
    • G06Q20/20Point-of-sale [POS] network systems
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The embodiment of the invention provides a pos terminal-based transaction data processing method, which comprises the following steps: receiving and processing the transaction data through the transaction system to obtain a transaction result; storing, by the transaction system, the transaction result and the target subject data into a redis component to cause the redis component to: matching the target pos access end according to the target theme data, and sending the transaction result to the target pos access end; receiving a transaction result returned by the redis component through the target pos access end, and returning the transaction result to a target pos terminal associated with the target pos access end; according to the embodiment of the invention, through the subscription and publishing mechanism between the pos access end and the redis component and the incidence relation between the pos access end and the pos terminal, the transaction result can be quickly and accurately sent to the corresponding pos terminal, and the efficiency and accuracy rate of transaction result return are effectively improved.

Description

POS terminal-based transaction data processing method, apparatus, device and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a pos terminal-based transaction data processing method and device, computer equipment and a computer-readable storage medium.
Background
In the existing pos device-based transaction data processing process, the transaction result return can be realized in the following ways: when a plurality of pos devices send transaction data processing requests to a transaction system at the same time, under the action of synchronous calling, the transaction system returns a processing intermediate state to the plurality of pos devices, transaction results are notified to an upstream system by asynchronous messages, and the results are returned to the pos devices by the upstream system (such as a message middleware MQ). However, the above-mentioned way of returning the transaction result has the following disadvantages: the upstream system may return the transaction result that should be returned to the pos device a to the pos device B, and cannot return each transaction result to the correct pos device, so that the accuracy of returning the transaction result is low, the time for processing the transaction data is long, and the efficiency for processing the transaction data is low.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a pos terminal-based transaction data processing method, an pos terminal-based transaction data processing apparatus, a computer device, and a computer-readable storage medium, which are used to solve the problems that the existing method of returning a transaction result through a message middleware is easy to cause low transaction result return accuracy and low efficiency.
One aspect of an embodiment of the present invention provides a pos terminal-based transaction data processing method, including:
the method comprises the steps that transaction data are sent to a transaction system through a target pos access end, the transaction data carry target subject data, and the target subject data comprise target pos access end identification and transaction number data;
receiving and processing the transaction data through the transaction system to obtain a transaction result;
storing, by the transaction system, the transaction result and the target subject data into a redis component to cause the redis component to: matching the target pos access end according to the target theme data, and sending the transaction result to the target pos access end; and
and receiving the transaction result returned by the redis component through the target pos access end, and returning the transaction result to a target pos terminal associated with the target pos access end.
Optionally, the method further includes pre-establishing a communication connection between the pos terminal and the pos access terminal, where the step of establishing the communication connection includes:
sending a synchronous sequence number data packet to the pos access end through the pos terminal to request connection; wherein, the synchronization sequence number data packet is used for requesting connection to the pos access terminal; the synchronization sequence number data packet carries the pos terminal identification;
receiving the synchronous sequence number data packet through the pos access end, and generating and returning a handshake confirmation packet to the pos terminal based on the synchronous sequence number data packet; wherein, the handshake confirmation packet indicates that the pos access terminal confirms to establish connection with the pos terminal;
receiving the handshake confirmation packet through the pos terminal, and generating and returning a confirmation character packet to the pos access terminal based on the handshake confirmation packet so as to establish communication connection between the pos terminal and the pos access terminal; wherein the confirmation character package indicates: and the pos terminal receives a connection confirmation request of the pos access terminal, and confirms that communication connection is established with the pos access terminal.
Optionally, after the pos terminal confirms that the communication connection is established with the pos access terminal, the method further includes:
and if the pos access end does not receive any data sent by the corresponding pos terminal within a preset time period, generating and sending a TCP detection packet to the corresponding pos terminal so as to evaluate whether the corresponding pos terminal survives.
Optionally, the matching the target pos access end according to the target theme data further includes:
matching the target pos access end identification in the target theme data with each pos access end identification prestored in a redis component;
and if the matching result has a result of matching consistency, determining a pos access end matched and consistent with the target pos access end identifier in the redis component as a target pos access end.
Optionally, the receiving, by the target pos access terminal, the transaction result returned by the redis component, and returning the transaction result to the target pos terminal associated with the target pos access terminal, further includes:
inquiring whether a target TCP connection associated with the target pos number exists or not through the target pos access end according to the target pos number in the transaction result;
if the target TCP connection associated with the target pos number is determined to exist, acquiring a target pos terminal corresponding to the target pos number;
and returning the transaction result to the target pos terminal through the target TCP connection.
Optionally, the method further comprises:
if the target pos access end does not receive the transaction result within the preset time, returning waiting data to the pos terminal, wherein the waiting data indicates that the transaction is being processed;
and if the pos access terminal does not receive the trading result after the preset times of waiting data are returned to the pos terminal, generating and sending a trading result query request to the trading system through the pos access terminal so that the trading system responds to the trading result query request to generate and return the trading result.
Optionally, the method further comprises:
receiving the transaction data sent by a plurality of pos terminals through the transaction system, wherein target subject data in each transaction data further comprises a corresponding processing level tag;
ordering, by the transaction system, the plurality of transaction data according to each processing level tag;
distributing a corresponding calculation server for each transaction data through the transaction system according to a preset load balancing rule and a processing level label corresponding to each transaction data; the computing power server is used for processing the received transaction data;
and calling the computing server through the transaction system to process the received transaction data and generate a corresponding transaction result.
One aspect of an embodiment of the present invention further provides a pos terminal-based transaction data processing apparatus, including:
the data sending module is used for sending transaction data to a transaction system through a target pos access end, wherein the transaction data carries target subject data, and the target subject data comprises a target pos access end identifier and transaction number data;
the transaction processing module is used for receiving and processing the transaction data through the transaction system to obtain a transaction result;
a matching module, configured to store the transaction result and the target topic data in a redis component through the transaction system, so that the redis component: matching the target pos access end according to the target theme data, and sending the transaction result to the target pos access end; and
and the trading result returning module is used for receiving the trading result returned by the redis component through the target pos access end and returning the trading result to the target pos terminal associated with the target pos access end.
An aspect of an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the steps of the pos terminal-based transaction data processing method as described above when executing the computer program.
An aspect of an embodiment of the present invention further provides a computer-readable storage medium having stored therein a computer program, the computer program being executable by at least one processor to cause the at least one processor to perform the steps of the pos terminal-based transaction data processing method as described above.
The pos terminal-based transaction data processing method, the pos terminal-based transaction data processing device, the computer equipment and the computer-readable storage medium provided by the embodiment of the invention transmit transaction data to a transaction system through a target pos access end, wherein the transaction data carries target subject data, and the target subject data comprises a target pos access end identifier and transaction number data; receiving and processing the transaction data through the transaction system to obtain a transaction result; storing, by the transaction system, the transaction result and the target subject data into a redis component to cause the redis component to: matching the target pos access end according to the target theme data, and sending the transaction result to the target pos access end; receiving a transaction result returned by the redis component through the target pos access end, and returning the transaction result to a target pos terminal associated with the target pos access end; according to the embodiment of the invention, through the subscription and publishing mechanism between the pos access end and the redis component and the incidence relation between the pos access end and the pos terminal, the transaction result can be quickly and accurately sent to the corresponding pos terminal, and the efficiency and accuracy rate of transaction result return are effectively improved.
The invention is described in detail below with reference to the drawings and specific examples, but the invention is not limited thereto.
Drawings
FIG. 1 schematically illustrates an environmental application diagram of a pos terminal-based transaction data processing method according to an embodiment of the invention;
FIG. 2 schematically illustrates an example flow chart of the present invention implementing a pos terminal-based transaction data processing method;
FIG. 3 is a flow chart that schematically illustrates the steps of a method for implementing pos terminal-based transaction data processing in accordance with the present invention;
FIG. 4 is a flow chart that schematically illustrates the steps of a method for implementing pos terminal-based transaction data processing in accordance with the present invention;
FIG. 5 is a flow chart schematically illustrating the steps of implementing a pos terminal-based transaction data processing method in accordance with the present invention;
FIG. 6 is a flow chart that schematically illustrates the steps of a method for implementing pos terminal-based transaction data processing in accordance with the present invention;
FIG. 7 schematically shows a block diagram of a pos terminal based transaction data processing apparatus according to a second embodiment of the invention;
fig. 8 is a schematic diagram showing a hardware configuration of a computer device adapted to implement the pos terminal-based transaction data processing method according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the descriptions relating to "first", "second", etc. in the embodiments of the present invention are only for descriptive purposes and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
In the description of the present invention, it should be understood that the numerical references before the steps do not identify the order of performing the steps, but merely serve to facilitate the description of the present invention and to distinguish each step, and thus should not be construed as limiting the present invention.
Example one
Referring to fig. 1, a flow chart of steps of a pos terminal-based transaction data processing method according to an embodiment of the invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is given by taking a computer device as an execution subject, specifically as follows:
as shown in fig. 1, the pos terminal-based transaction data processing method may include steps S100 to S106, in which:
step S100, transaction data are sent to a transaction system through a target pos access end, the transaction data carry target theme data, and the target theme data comprise target pos access end identification and transaction number data.
In an exemplary embodiment, to improve the efficiency of transaction data processing, pos access ports are typically configured in clusters; including pos access A, pos access B, pos accesses C, …, pos access N. Different pos access terminals can establish TCP connections with different pos terminals. After the TCP connection is established, each time transaction is carried out at the pos terminal, the pos terminal sends corresponding transaction data to the corresponding pos access terminal for transaction. Wherein, TCP: namely Transmission Control Protocol; before a TLS connection or an SSL (Secure Sockets Layer) connection is made in a TCP-based HTTPS request, there is a three-way handshake of TCP to establish the connection.
Referring to fig. 2, the method further includes pre-establishing a communication connection between the pos terminal and the pos access terminal, wherein the step of establishing the communication connection further includes steps S200 to S204, wherein: step S200, sending a synchronous sequence number data packet to the pos access end through the pos terminal to request connection; wherein, the synchronization sequence number data packet is used for requesting connection to the pos access terminal; the synchronization sequence number data packet carries the pos terminal identification; step S202, receiving the synchronous sequence number data packet through the pos access end, and generating and returning a handshake confirmation packet to the pos terminal based on the synchronous sequence number data packet; wherein, the handshake confirmation packet indicates that the pos access terminal confirms to establish connection with the pos terminal; step S204, the pos terminal receives the handshake confirmation packet, and generates and returns a confirmation character packet to the pos access terminal based on the handshake confirmation packet, so that the pos terminal and the pos access terminal establish communication connection; wherein the confirmation character package indicates: and the pos terminal receives a connection confirmation request of the pos access terminal, and confirms that communication connection is established with the pos access terminal. In this embodiment, the pos terminal identifier may be a pos number of a pos terminal, where the pos number represents a physical pos device. By way of example, topic data (topic) includes: pos access identification (e.g., pos access IP) and transaction number data (e.g., pos number and transaction order number). Illustratively, the subject data is [ pos access end IP: pos number: transaction order number ].
After the pos terminal confirms that the communication connection is established with the pos access terminal, the method further includes: and if the pos access end does not receive any data sent by the corresponding pos terminal within a preset time period, generating and sending a TCP detection packet to the corresponding pos terminal so as to evaluate whether the corresponding pos terminal survives.
And step S102, receiving and processing the transaction data through the transaction system to obtain a transaction result.
In an exemplary embodiment, the transaction system analyzes and calculates the transaction data according to a preset calculation rule in the transaction system, and obtains a transaction result.
Step S104, storing the transaction result and the target subject data into a redis component through the transaction system, so that the redis component: and matching the target pos access end according to the target theme data, and sending the transaction result to the target pos access end.
In order to ensure fast communication between pos access and a redis component, the method comprises: and long connections are pre-established between the pos access terminals and the redis components. Wherein, each pos access terminal is used as a subscriber and subscribes topic data (topic) to the redis component. And after the transaction system acquires the transaction result, storing the transaction result in a database of the transaction system, and issuing the transaction result and the target subject data to the redis component. And after receiving the target theme data, the Redis component matches a pos access end, and sends the transaction result to the corresponding target pos access end through long connection between the pos access end and the Redis component.
In this embodiment of the present invention, the wildcard of the redis component matches a rule, and the actual subscription of the pos access terminal to the redis component is [ pos access terminal IP: pos number: wherein "-" is a wildcard; the wildcard matching rule is that pos access terminals (such as pos access terminal a) related to the pos access terminal IP are matched according to the actually subscribed theme data.
Referring to fig. 3, the matching of the target pos access terminal according to the target topic data can be further implemented by: step S300, matching the target pos access end identification in the target theme data with each pos access end identification prestored in a redis component; and step S302, if the matching result has a matching result, determining a pos access end matched and consistent with the target pos access end identifier in the redis component as a target pos access end. In the embodiment, each subsystem needing communication is decoupled through the pos access end, the transaction system and the redis component, and each system can be independently managed without influencing the management of the whole system. And the decoupling of each subsystem enables the application program of each system to pay more attention to the core function of each system, and effectively improves the development efficiency and quality of each subsystem. And step S106, receiving the transaction result returned by the redis component through the target pos access terminal, and returning the transaction result to the target pos terminal associated with the target pos access terminal.
In an exemplary embodiment, the transaction result includes a target pos number; with reference to fig. 4, the step S106 of receiving the transaction result returned by the redis component through the target pos access end and returning the transaction result to the target pos terminal associated with the target pos access end may further include steps S400 to S404, where: step S400, inquiring whether a target TCP connection associated with the target pos number exists or not through the target pos access end according to the target pos number in the transaction result; step S402, if the existence of the target TCP connection associated with the target pos number is determined, acquiring a target pos terminal corresponding to the target pos number; and step S404, returning the transaction result to the target pos terminal through the target TCP connection. In this embodiment, if there is no TCP connection associated with the target pos number, the transaction result is stored in a database of the target pos access end, and it is repeatedly queried whether there is a TCP connection associated with the target pos number within a preset time period, and if there is no TCP connection associated with the target pos number after querying for a preset number of times, an abnormal result is generated and stored in the database.
To enhance the user experience with pos devices, please refer to fig. 5, the method further comprises: step S500, if the target pos access terminal does not receive the transaction result within the preset time, returning waiting data to the pos terminal, wherein the waiting data indicates that the transaction is being processed; and step S502, if the pos access terminal does not receive the transaction result after the preset times of waiting data are returned to the pos terminal, generating and sending a transaction result query request to the transaction system through the pos access terminal so that the transaction system responds to the transaction result query request to generate and return the transaction result. Wherein, the preset times can be 3 times. Through a data processing feedback mechanism of the pos access end, when the trading result cannot be inquired for three times continuously, the pos access end initiates the trading result inquiry, and does not need to inquire the trading result repeatedly in the process of waiting for the trading result; the inquiry of the pos access end is reduced, the time for a user to wait for a transaction result is effectively shortened, and the use experience of the user on pos equipment is further improved; resource consumption of a pos access system and a transaction system is saved.
The grades of different pos terminals determine the speed of message return; referring to fig. 6, the method further includes: step S600, the transaction data sent by a plurality of pos terminals are received through the transaction system, and target subject data in each transaction data further comprises a corresponding processing level label; step S602, the transaction system sequences the transaction data according to each processing level label; step S604, distributing a corresponding calculation force server for each transaction data through the transaction system according to a preset load balancing rule and a processing level label corresponding to each transaction data; the computing power server is used for processing the received transaction data; and step S606, the calculation server is called by the transaction system to process the received transaction data and generate a corresponding transaction result. In the embodiment, different transaction data are processed according to the priorities of different information, so that the use experience of the user on the pos device can be improved to a certain extent.
Example two
With continued reference to FIG. 7, a block diagram of a pos terminal-based transaction data processing apparatus 70 of the present invention is schematically illustrated. In this embodiment, the pos terminal-based transaction data processing apparatus 70 may include or be divided into one or more program modules, which are stored in a storage medium and executed by one or more processors, to implement the present invention and realize the pos terminal-based transaction data processing method described above. The program modules referred to in the embodiments of the present invention refer to a series of computer program instruction segments capable of performing specific functions, and are more suitable than the program itself for describing the execution process of the pos terminal-based transaction data processing device 70 in the storage medium. The following description will specifically describe the functions of the program modules of the present embodiment.
As shown in fig. 7, the pos terminal-based transaction data processing apparatus 70 may include a data sending module 700, a transaction processing module 702, a matching module 704, and a transaction result returning module 706, wherein:
a data sending module 700, configured to send transaction data to a transaction system through a target pos access end, where the transaction data carries target subject data, and the target subject data includes a target pos access end identifier and transaction number data;
a transaction processing module 702, configured to receive and process the transaction data through the transaction system to obtain a transaction result;
a matching module 704, configured to store the transaction result and the target subject data into a redis component through the transaction system, so that the redis component: matching the target pos access end according to the target theme data, and sending the transaction result to the target pos access end; and
a transaction result returning module 706, configured to receive, through the target pos access end, a transaction result returned by the redis component, and return the transaction result to a target pos terminal associated with the target pos access end.
In an exemplary embodiment, the pos terminal-based transaction data processing arrangement 70 further includes a connection module (not identified). The connection module is further configured to: sending a synchronous sequence number data packet to the pos access end through the pos terminal to request connection; wherein, the synchronization sequence number data packet is used for requesting connection to the pos access terminal; the synchronization sequence number data packet carries the pos terminal identification; receiving the synchronous sequence number data packet through the pos access end, and generating and returning a handshake confirmation packet to the pos terminal based on the synchronous sequence number data packet; wherein, the handshake confirmation packet indicates that the pos access terminal confirms to establish connection with the pos terminal; receiving the handshake confirmation packet through the pos terminal, and generating and returning a confirmation character packet to the pos access terminal based on the handshake confirmation packet so as to establish communication connection between the pos terminal and the pos access terminal; wherein the confirmation character package indicates: and the pos terminal receives a connection confirmation request of the pos access terminal, and confirms that communication connection is established with the pos access terminal.
In an exemplary embodiment, the connection module is further configured to: and if the pos access end does not receive any data sent by the corresponding pos terminal within a preset time period, generating and sending a TCP detection packet to the corresponding pos terminal so as to evaluate whether the corresponding pos terminal survives.
In an exemplary embodiment, the matching module 704 is further configured to: matching the target pos access end identification in the target theme data with each pos access end identification prestored in a redis component; and if the matching result has a result of matching consistency, determining a pos access end matched and consistent with the target pos access end identifier in the redis component as a target pos access end.
In an exemplary embodiment, the transaction result returning module 706 is further configured to: inquiring whether a target TCP connection associated with the target pos number exists or not through the target pos access end according to the target pos number in the transaction result; if the target TCP connection associated with the target pos number is determined to exist, acquiring a target pos terminal corresponding to the target pos number; and returning the transaction result to the target pos terminal through the target TCP connection.
In an exemplary embodiment, the pos terminal-based transaction data processing apparatus 70 further includes a query module (not identified) further configured to: if the target pos access end does not receive the transaction result within the preset time, returning waiting data to the pos terminal, wherein the waiting data indicates that the transaction is being processed; and if the pos access terminal does not receive the trading result after the preset times of waiting data are returned to the pos terminal, generating and sending a trading result query request to the trading system through the pos access terminal so that the trading system responds to the trading result query request to generate and return the trading result.
In an exemplary embodiment, the pos terminal-based transaction data processing further includes a ranking module (not identified) further configured to: receiving the transaction data sent by a plurality of pos terminals through the transaction system, wherein target subject data in each transaction data further comprises a corresponding processing level tag; ordering, by the transaction system, the plurality of transaction data according to each processing level tag; distributing a corresponding calculation server for each transaction data through the transaction system according to a preset load balancing rule and a processing level label corresponding to each transaction data; the computing power server is used for processing the received transaction data; and calling the computing server through the transaction system to process the received transaction data and generate a corresponding transaction result.
EXAMPLE III
Fig. 8 is a schematic diagram of a hardware architecture of a computer device 10000 suitable for implementing a pos terminal-based transaction data processing method according to a third embodiment of the present invention. In this embodiment, the computer device 10000 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction. The computer device 10000 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including an independent server or a server cluster composed of a plurality of servers), a gateway, and the like. As shown in fig. 8, the computer device 10000 includes, but is not limited to, at least a memory 10010, a processor 10020, and a network interface 10030, which are communicatively connected to each other through a system bus. Wherein:
in this embodiment, the memory 10010 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 10010 may be an internal storage unit of the computer device 10000, such as a hard disk or a memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 10000. Of course, the memory 10010 may also include both internal and external storage devices of the computer device 10000. In this embodiment, the memory 10010 is generally used for storing an operating system installed on the computer device 10000 and various application software, such as the program codes of the pos terminal-based transaction data processing apparatus 70 of the above-mentioned embodiment. In addition, the memory 10010 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 10020, in some embodiments, can be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip. The processor 10020 is generally configured to control overall operations of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is configured to execute the program codes stored in the memory 10010 or process data, for example, execute the pos terminal-based transaction data processing apparatus 70, so as to implement the pos terminal-based transaction data processing method according to the above-mentioned embodiment.
The network interface 10030 may comprise a wireless network interface or a wired network interface, and the network interface 10030 is generally used for establishing a communication connection between the computer apparatus 10000 and other electronic devices. For example, the network interface 10030 is configured to connect the computer device 10000 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 10000 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM for short), Wideband Code Division Multiple Access (WCDMA for short), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 8 only shows computer device 10000 having components 10010-10030, but it is to be understood that not all of the shown components are required and that more or less components may be implemented instead.
In this embodiment, the pos terminal-based transaction data processing device 70 stored in the memory 10010 can be further divided into one or more program modules, and the one or more program modules are stored in the memory 10010 and executed by one or more processors (in this embodiment, the processor 10020) to complete the present invention.
For example, fig. 7 is a schematic diagram of program modules of a second embodiment of the pos terminal-based transaction data processing apparatus 70, in which the pos terminal-based transaction data processing apparatus 70 can be divided into a data sending module 700, a transaction processing module 702, a matching module 704, and a transaction result returning module 706. The program module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than a program for describing the execution process of the pos terminal based transaction data processing apparatus 70 in the computer device 10000. The specific functions of the program modules 700 and 706 are described in detail in the second embodiment, and are not described herein again.
Example four
The present embodiments also provide a computer-readable storage medium having stored thereon a computer program that, when executed by at least one processor, implements the steps of the pos terminal-based transaction data processing method of the embodiments.
In the present embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device. Of course, the computer-readable storage medium may also include both internal and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is generally used for storing an operating system and various types of application software installed in the computer device, for example, the program code of the katon detection method in the embodiment, and the like. Further, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A transaction data processing method based on pos terminal is characterized by comprising the following steps:
the method comprises the steps that transaction data are sent to a transaction system through a target pos access end, the transaction data carry target subject data, and the target subject data comprise target pos access end identification and transaction number data;
receiving and processing the transaction data through the transaction system to obtain a transaction result;
storing, by the transaction system, the transaction result and the target subject data into a redis component to cause the redis component to: matching the target pos access end according to the target theme data, and sending the transaction result to the target pos access end; and
and receiving the transaction result returned by the redis component through the target pos access end, and returning the transaction result to a target pos terminal associated with the target pos access end.
2. The pos terminal-based transaction data processing method of claim 1, further comprising pre-establishing a communication connection between the pos terminal and a pos access, wherein the establishing the communication connection comprises:
sending a synchronous sequence number data packet to the pos access end through the pos terminal to request connection; wherein, the synchronization sequence number data packet is used for requesting connection to the pos access terminal; the synchronization sequence number data packet carries the pos terminal identification;
receiving the synchronous sequence number data packet through the pos access end, and generating and returning a handshake confirmation packet to the pos terminal based on the synchronous sequence number data packet; wherein, the handshake confirmation packet indicates that the pos access terminal confirms to establish connection with the pos terminal;
receiving the handshake confirmation packet through the pos terminal, and generating and returning a confirmation character packet to the pos access terminal based on the handshake confirmation packet so as to establish communication connection between the pos terminal and the pos access terminal; wherein the confirmation character package indicates: and the pos terminal receives a connection confirmation request of the pos access terminal, and confirms that communication connection is established with the pos access terminal.
3. The pos terminal-based transaction data processing method of claim 2, wherein after the pos terminal confirms establishment of a communication connection with the pos access, the method further comprises:
and if the pos access end does not receive any data sent by the corresponding pos terminal within a preset time period, generating and sending a TCP detection packet to the corresponding pos terminal so as to evaluate whether the corresponding pos terminal survives.
4. The pos terminal-based transaction data processing method of claim 3, wherein the matching the target pos access according to the target subject data further comprises:
matching the target pos access end identification in the target theme data with each pos access end identification prestored in a redis component;
and if the matching result has a result of matching consistency, determining a pos access end matched and consistent with the target pos access end identifier in the redis component as a target pos access end.
5. The pos terminal-based transaction data processing method of claim 4, wherein the receiving, by the target pos access, the transaction result returned by the redis component and returning the transaction result to a target pos terminal associated with the target pos access further comprises:
inquiring whether a target TCP connection associated with the target pos number exists or not through the target pos access end according to the target pos number in the transaction result;
if the target TCP connection associated with the target pos number is determined to exist, acquiring a target pos terminal corresponding to the target pos number;
and returning the transaction result to the target pos terminal through the target TCP connection.
6. The pos terminal-based transaction data processing method of claim 1, further comprising:
if the target pos access end does not receive the transaction result within the preset time, returning waiting data to the pos terminal, wherein the waiting data indicates that the transaction is being processed;
and if the pos access terminal does not receive the trading result after the preset times of waiting data are returned to the pos terminal, generating and sending a trading result query request to the trading system through the pos access terminal so that the trading system responds to the trading result query request to generate and return the trading result.
7. The pos terminal-based transaction data processing method of claim 1, further comprising:
receiving the transaction data sent by a plurality of pos terminals through the transaction system, wherein target subject data in each transaction data further comprises a corresponding processing level tag;
ordering, by the transaction system, the plurality of transaction data according to each processing level tag;
distributing a corresponding calculation server for each transaction data through the transaction system according to a preset load balancing rule and a processing level label corresponding to each transaction data; the computing power server is used for processing the received transaction data;
and calling the computing server through the transaction system to process the received transaction data and generate a corresponding transaction result.
8. A pos terminal-based transaction data processing apparatus, comprising:
the data sending module is used for sending transaction data to a transaction system through a target pos access end, wherein the transaction data carries target subject data, and the target subject data comprises a target pos access end identifier and transaction number data;
the transaction processing module is used for receiving and processing the transaction data through the transaction system to obtain a transaction result;
a matching module, configured to store the transaction result and the target topic data in a redis component through the transaction system, so that the redis component: matching the target pos access end according to the target theme data, and sending the transaction result to the target pos access end; and
and the trading result returning module is used for receiving the trading result returned by the redis component through the target pos access end and returning the trading result to the target pos terminal associated with the target pos access end.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the pos terminal based transaction data processing method according to any of claims 1 to 7.
10. A computer-readable storage medium, having stored therein a computer program executable by at least one processor to cause the at least one processor to perform the steps of the pos terminal-based transaction data processing method according to any one of claims 1-7.
CN202210037079.XA 2022-01-13 2022-01-13 POS terminal-based transaction data processing method, apparatus, device and storage medium Pending CN114386958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210037079.XA CN114386958A (en) 2022-01-13 2022-01-13 POS terminal-based transaction data processing method, apparatus, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210037079.XA CN114386958A (en) 2022-01-13 2022-01-13 POS terminal-based transaction data processing method, apparatus, device and storage medium

Publications (1)

Publication Number Publication Date
CN114386958A true CN114386958A (en) 2022-04-22

Family

ID=81201554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210037079.XA Pending CN114386958A (en) 2022-01-13 2022-01-13 POS terminal-based transaction data processing method, apparatus, device and storage medium

Country Status (1)

Country Link
CN (1) CN114386958A (en)

Similar Documents

Publication Publication Date Title
CN109218133B (en) Network speed testing system, method, device and computer readable storage medium
US8380820B1 (en) Sending synchronous responses to requests from frontend applications
CN111756674B (en) Network communication method, system, device and computer readable storage medium
EP3489825A1 (en) Method, apparatus and computer readable storage medium for processing service
CN111368173A (en) File transmission method and device, electronic equipment and readable storage medium
CN109951514B (en) File processing method and system based on cloud storage and computer equipment
CN108377247B (en) Message pushing method and device
CN113364795B (en) Data transmission method and proxy server
CN113190778A (en) Business data pushing method, system, computer equipment and computer storage medium
CN104243610A (en) Distributed file transmission service method
CN112422450A (en) Computer equipment, and flow control method and device for service request
CN105227736A (en) A kind of update method, Apparatus and system of reserved phone number
CN108765083B (en) Routing order configuration and processing method and system
CN109471713B (en) Method and device for inquiring information
CN113965628A (en) Message scheduling method, server and storage medium
CN111897663A (en) Interface calling method and device, computer equipment and storage medium
CN114386958A (en) POS terminal-based transaction data processing method, apparatus, device and storage medium
CN112948138A (en) Method and device for processing message
CN112527669B (en) Self-testing method and system for local service
CN114968822A (en) Interface testing method and device, computer equipment and storage medium
US9313272B2 (en) Information processor and information processing method
CN114006939A (en) Message pushing method and device
CN111338642A (en) Method, device, terminal and storage medium for determining application downloading path
CN113760487A (en) Service processing method and device
CN111833036B (en) Method, apparatus, device and computer readable medium for judging repeat transaction

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