ECR mode electronic cash register simulation system and simulation method
Through the ECR mode electronic cash register simulation system, the preset communication protocol and communication interaction middleware connection are used to realize the business function simulation test of the electronic cash register system, solving the insufficient testing convenience and high customization cost in the existing technology The problem of improving testing efficiency and cost-effectiveness.
Patent Information
- Application Number
- CN202410583500.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-05-11
AI Technical Summary
The existing electronic cash register system has limited convenience when testing different business transaction scenarios, and when adding business scenarios, it requires customized application program interfaces (APIs), which increases the cost of the enterprise.
Using the ECR mode electronic cash register simulation system, the preset communication protocol and communication interaction middleware connection between the cash register simulation terminal and the merchant cash register terminal are generated and executed, and the operation instructions of business function are generated and executed, and the unique communication identification confirmation information is used for Interaction, simulate business function testing, and reduce customization costs.
It improves the testing convenience of the electronic cash register system, reduces the testing and customization costs when increasing business scenarios, and realizes efficient simulation testing of business functions between the electronic cash register and the merchant cash register terminal.
Smart Images

Figure CN118470869B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic cash register simulation, and in particular to an ECR mode electronic cash register simulation system and a simulation method thereof. Background Art
[0002] Electronic cash register is referred to as ECR (Electronic Cash Register). It is an auxiliary tool commonly used in shopping malls, gas stations, chain stores, restaurants and other consumer industries. The various payment systems of electronic cash registers used in the market are widely used, but these cash register systems are not free to use, but need to be purchased before they can be used.
[0003] In the related art, when it is necessary to test different business transaction scenarios of the electronic cash register system, the testing convenience of the existing brands of electronic cash register systems is also limited: for example, the Macau Pass terminal (the Macau Pass is an electronic currency stored-value card) that is suitable for card transactions used in the Macao Special Administrative Region of my country, the business functions implemented between the Macau Pass terminal and the electronic cash register have not been verified; at the same time, if it is necessary to increase business scenarios, it is necessary to customize different application programming interfaces (Application Programming Interface, referred to as API) in the electronic cash register system, which also increases the customization costs of the enterprise and urgently needs to be improved. Summary of the invention
[0004] In order to solve the problem of limited convenience in testing electronic cash register systems and reduce the enterprise customization cost of electronic cash register systems when adding business scenarios, the present application provides an ECR mode electronic cash register simulation system and a simulation method thereof.
[0005] In the first aspect, the invention objective of the present application is achieved by adopting the following technical solutions:
[0006] ECR mode electronic cash register simulation system, the system includes: cash register simulation terminal and merchant payment terminal;
[0007] The cash register simulation terminal and the merchant cash register terminal are connected in communication via a preset communication protocol and a preset communication interaction middleware;
[0008] The cash register simulation terminal generates corresponding business function operation instructions based on the collected business function requests and sends them to the communication interaction middleware; the communication interaction middleware distributes the business function operation instructions to the corresponding merchant cash register terminal, and the business function operation instructions include first confirmation information with a unique communication identifier;
[0009] The merchant payment terminal performs the corresponding business operation based on the received business function operation instruction, and generates execution confirmation information based on the first confirmation information and sends it to the communication interaction middleware; the communication interaction middleware sends the execution confirmation information to the cash register simulation terminal based on the unique communication identifier;
[0010] The cash register simulation terminal obtains the corresponding business execution result based on the execution confirmation information, and performs business interaction simulation display based on the business execution result.
[0011] By adopting the above technical solution, the merchant payment terminal is an electronic payment terminal used by merchants, such as the Macau Pass terminal; the cash register simulation terminal can simulate the business execution results of the payment interaction; the tester can use the electronic currency stored value card (such as the Macau Pass) to make payments through card transactions or online payment methods such as code scanning payment; the present application provides a cash register simulation terminal and a merchant payment terminal that can communicate and interact, and the connection between the cash register simulation terminal and the merchant payment terminal is established through a predefined communication protocol and a predefined communication interaction middleware, that is, through a specified communication protocol and the communication interaction middleware of the upper-level communication tool, the communication connection method between the cash register simulation terminal and the merchant payment terminal is defined in advance; thereby helping to solve the problem of limited convenience in testing the electronic cash register system and reduce the testing cost and enterprise customization cost of the electronic cash register system when adding business scenarios.
[0012] Specifically, the tester simulates the business function (including new business function or customized business function) of the electronic cash register to be tested by inputting the business function request in the merchant payment terminal, and calls the communication interaction middleware through the merchant payment terminal to send the corresponding business function operation instruction to the corresponding merchant payment terminal. In order to distinguish each business function operation instruction and different business functions, the business function operation instruction includes a first confirmation information with a unique communication identifier, so as to confirm whether the merchant payment terminal has received the business function operation instruction through the first confirmation information. The merchant payment terminal performs the corresponding business operation based on the received business function operation instruction. After completing the corresponding business operation, the merchant's cash register terminal regenerates the execution confirmation information of the corresponding unique communication identifier and sends it to the cash register simulation terminal for confirmation. Then the cash register simulation terminal obtains the business execution result of the business function test based on the execution confirmation information. The execution test status of the business function can be known through the business execution result, thereby achieving the functional testing effect of the business function between the electronic cash register and the merchant's cash register terminal through the cash register simulation terminal, thereby solving the problem of limited convenience in testing the electronic cash register system. The cash register simulation terminal can reduce the testing cost and enterprise customization cost of the electronic cash register system when adding business scenarios during business function testing.
[0013] In a preferred example of the present application: the communication interaction middleware is connected to a data transmission serial port and a serial communication line adapted to the data transmission serial port; the cash register simulation terminal and the merchant payment terminal maintain the same communication baud rate based on the data transmission serial port and the serial communication line.
[0014] By adopting the above technical solution, the communication interaction middleware establishes the connection between the cash register simulation terminal and the merchant's cash register terminal through the data transmission serial port and the serial communication line; by keeping the cash register simulation terminal and the merchant's cash register terminal at the same communication baud rate, serial communication data interaction between the two is facilitated.
[0015] In a preferred example of the present application: the cash register simulation terminal is provided with a plurality of operation buttons for inputting different business test function instructions; the cash register simulation terminal obtains corresponding business function test instructions based on different pressing operations on the plurality of operation buttons; the file type of the communication interaction middleware is a dynamic link library file; the merchant payment terminal includes a Macau Pass terminal.
[0016] By adopting the above technical solution, multiple operation buttons are used to correspond to different business function test instructions, so as to meet the test requirements of various business functions of the ECR mode electronic cash register simulation system; in actual application, the tester can input the actual business function test instructions to be tested by pressing multiple operation buttons on the cash register simulation terminal, and the operation is more convenient; further, the dynamic link library file (also known as the DLL file) is easy to be set up and written when the program is running, which is conducive to saving the memory and system resources of the entire ECR mode electronic cash register simulation system.
[0017] In the second aspect, the invention objective of the present application is achieved by adopting the following technical solutions:
[0018] The ECR mode electronic cash register simulation method is applied to the ECR mode electronic cash register simulation system as described above, and the method comprises:
[0019] Using a preset communication protocol and a preset communication interaction middleware to open up the connection between the cash register simulation terminal and the merchant payment terminal;
[0020] The cash register simulation terminal generates corresponding business function operation instructions based on the collected business function requests and distributes them to the corresponding merchant cash register terminal, wherein the business function operation instructions include first confirmation information with a unique communication identifier;
[0021] The merchant payment terminal performs the corresponding business operation based on the received business function operation instruction, generates execution confirmation information based on the first confirmation information, and sends the execution confirmation information to the cash register simulation terminal according to the unique communication identifier;
[0022] The cash register simulation terminal obtains the corresponding business execution result based on the execution confirmation information, and performs business interaction simulation display based on the business execution result.
[0023] By adopting the above technical solution, the tester simulates the business function (including new business function or customized business function) of the electronic cash register to be tested by inputting the business function request in the merchant payment terminal, and calls the communication interaction middleware through the merchant payment terminal to send the corresponding business function operation instruction to the corresponding merchant payment terminal. In order to distinguish each business function operation instruction and different business functions, the business function operation instruction includes the first confirmation information with a unique communication identifier, so as to confirm whether the merchant payment terminal has received the business function operation instruction through the first confirmation information. The merchant payment terminal performs the corresponding business operation based on the received business function operation instruction. After completing the corresponding business operation, the merchant's cash register terminal regenerates the execution confirmation information of the corresponding unique communication identifier and sends it to the cash register simulation terminal for confirmation. Then the cash register simulation terminal obtains the business execution result of the business function test based on the execution confirmation information. The execution test status of the business function can be known through the business execution result, thereby achieving the functional testing effect of the business function between the electronic cash register and the merchant's cash register terminal through the cash register simulation terminal, thereby solving the problem of limited convenience in testing the electronic cash register system. The cash register simulation terminal can reduce the testing cost and enterprise customization cost of the electronic cash register system when adding business scenarios during business function testing.
[0024] In a preferred example of the present application, the cash register simulation terminal generates corresponding business function operation instructions based on the collected business function requests and distributes them to the corresponding merchant cash register terminal. The business function operation instructions include the first confirmation information with a unique communication identifier, and include:
[0025] The corresponding merchant payment terminal sends first receiving status information for determining the receiving status of the first confirmation information to the cash register simulation terminal within a preset first confirmation time period according to the received first confirmation information;
[0026] The cash register simulation terminal determines whether the first receiving status information is received within a preset second confirmation time period;
[0027] If the cash register simulation terminal does not receive the first receiving status information within a preset second confirmation time period, the cash register simulation terminal resends the first confirmation information according to a preset first information resending condition; the first information resending condition satisfies that the number of resending times of the first confirmation information does not exceed a preset first resending number threshold, and that the information receiving waiting time of the cash register simulation terminal does not exceed a preset first timeout time;
[0028] If the cash register simulation terminal receives the first receiving status information within a preset second confirmation time period, the receiving status of the merchant cash register terminal based on the first confirmation information is successful reception.
[0029] By adopting the above technical scheme, the data interaction process and the sending status of each data transmission in the ECR mode electronic cash register simulation system are recorded in detail; specifically, after the cash register simulation terminal of the present application generates the corresponding business function operation instruction and sends the first confirmation information, the merchant cash register terminal must feedback the first receiving status information to the cash register simulation terminal within the specified first confirmation time period after receiving the first confirmation information. At this time, the cash register simulation terminal judges whether the merchant cash register terminal has received the corresponding first confirmation information based on whether the first receiving status information is received, so as to judge whether the merchant cash register terminal has received the first confirmation information, that is, when the cash register simulation terminal receives the first receiving status information, it judges that the merchant cash register terminal has received the corresponding first confirmation information, otherwise it judges that the merchant cash register terminal has not received the first Confirmation information; at this time, the cash register simulation terminal re-sends (for the second time) the first confirmation information according to the preset first information retransmission condition. If the cash register simulation terminal still has not received the first receiving status information of the first confirmation information sent for the second time, then on the basis of satisfying the first information retransmission condition (the first retransmission number threshold at this time is not less than 3), the first confirmation information is sent for the third time, and so on. In order to effectively prevent the resources of the cash register simulation terminal from being affected by the retransmission of the first confirmation information, the present application sets the first retransmission number threshold and the constraint condition that the total waiting time for information reception of the cash register simulation terminal does not exceed the preset first timeout time. Therefore, while realizing the data interaction simulation of the ECR mode electronic cash register simulation system, it also sets the retransmission requirement of the interactive data, which is beneficial to improve the interactive data processing quality of the simulation system.
[0030] In a preferred example of the present application, the merchant payment terminal performs the corresponding business operation based on the received business function operation instruction, generates execution confirmation information based on the first confirmation information, and sends the execution confirmation information to the cash register simulation terminal according to the unique communication identifier, including:
[0031] The merchant payment terminal sends the execution confirmation information to the cash register simulation terminal according to the unique communication identifier within the preset execution time period;
[0032] The cash register simulation terminal sends, based on the received execution confirmation information, second reception status information for determining the reception status of the execution confirmation information to the merchant payment terminal within a preset third confirmation time period;
[0033] The merchant payment terminal determines whether the second receiving status information is received within the preset second confirmation time period;
[0034] If the merchant payment terminal does not receive the second reception status information within the preset second confirmation time period, the merchant payment terminal resends the execution confirmation information according to the preset second information resending condition; the second information resending condition satisfies that the number of resending times of the execution confirmation information does not exceed the preset second resending number threshold, and satisfies that the information receiving waiting time of the merchant payment terminal does not exceed the preset second timeout time.
[0035] By adopting the above technical solution, after the merchant's cash register terminal completes the business operation corresponding to the business function operation instruction, in order to obtain the business function operation status of the merchant's cash register terminal, the merchant's cash register terminal needs to send execution confirmation information used to represent the business operation result information to the cash register simulation terminal. The cash register simulation terminal sends second receiving status information to the merchant's cash register terminal based on the received execution confirmation information. At this time, the merchant's cash register terminal determines whether the cash register simulation terminal has received the execution confirmation information based on the received second receiving status information. Specifically, when the merchant's cash register terminal receives the second receiving status information, it determines that the cash register simulation terminal has received the execution confirmation information; otherwise, it determines that the cash register simulation terminal has not received the execution confirmation information. When the merchant's payment terminal determines that the cash register simulation terminal has not received the execution confirmation information sent for the first time, the merchant's payment terminal re-sends (for the second time) the execution confirmation information based on the preset second information retransmission condition. If the merchant's payment terminal still does not receive the second reception status information, then on the basis of satisfying the second information retransmission condition, it sends the first confirmation information for the third time (the second retransmission number threshold at this time is not less than 3), and so on. This application sets the second retransmission number threshold and the constraint condition that the total waiting time for information reception of the merchant's payment terminal does not exceed the preset first timeout time. It can not only monitor the business operation execution status of the merchant's payment total segment, but also minimize the memory resource usage of the data interaction simulation of the ECR mode electronic cash register simulation system.
[0036] In a preferred example of the present application, the method includes:
[0037] The cash register simulation terminal records the corresponding first confirmation information, first receiving status information, second confirmation information and time data of the second receiving status information and the corresponding sending output status information into a preset record list based on the business function request;
[0038] If the merchant payment terminal retransmits the execution confirmation information based on the number of times equal to the second retransmission threshold, and the cash register simulation terminal does not receive the execution confirmation information within the preset second confirmation time period; the cash register simulation terminal outputs abnormal prompt information based on the business function request.
[0039] By adopting the above technical solution, the record list of the cash register simulation terminal is a log file of the data interaction process and the corresponding time data of the entire ECR mode electronic cash register simulation system. The business function test process of the entire simulation system is recorded through the record list, so that the simulation system can be traced and the business function test data is recorded; further, when the cash register simulation terminal still does not receive the execution confirmation information after the merchant's payment terminal resends the execution confirmation information for the last time, it means that there is a fault in the business function test of this matter. The abnormal prompt information is helpful to prompt the relevant testers to take corresponding fault handling measures or adjustment measures in time.
[0040] In a preferred example, the present application also includes:
[0041] After the merchant payment terminal executes the corresponding business operation based on the received business function operation instruction, the business operation is suspended according to the preset execution suspension time; and the business operation is resumed after the preset execution suspension time is reached.
[0042] By adopting the above technical solution, after the merchant's payment terminal completes the current number of business operations, it cannot perform business operation functions within the execution suspension time, thereby effectively avoiding the influence of the ECR mode electronic cash register simulation system collection network environment or the delay of information transmission of the merchant's payment terminal, resulting in multiple deductions or additions to electronic currency stored value cards. For example: in the case of multiple deductions or additions to the Macau Pass terminal, by setting the Macau Pass terminal to be unable to accept transactions within 5 seconds (that is, the execution suspension time is 5 seconds at this time, and the specific duration can be defined by yourself) after completing a business operation (deduction or addition), it is beneficial to improve the accuracy of business operations of the merchant's payment terminal.
[0043] In a preferred example of the present application, after the connection between the cash register simulation terminal and the merchant payment terminal is established by using a preset communication protocol and a preset communication interaction middleware, the method includes:
[0044] The cash register simulation terminal and the merchant cash register terminal exchange data in the form of data messages through communication data packets;
[0045] The communication data packet includes a business data frame, a flow identification frame and a data check frame; the business data frame is used to represent the data interaction information between the cash register simulation terminal and the merchant cash register terminal; the flow identification frame is used to represent the unique processing identification frame of the communication data packet; the cash register simulation terminal calculates the frame code integrity of the corresponding business data frame and flow identification frame based on the data check frame.
[0046] By adopting the above technical solution, the cash register simulation terminal and the merchant cash register terminal will interact with the corresponding data to be interacted (such as the first confirmation information, the second confirmation information, the execution confirmation information, the first receiving status information, the second receiving status information) in the form of data packets of communication data packets; at the same time, the data structure of the communication data packet includes a business data frame, a flow identification frame and a data verification frame; specifically, the data interaction of communication data (including business function test data) is carried out through the business data frame, the flow identification frame is used to effectively distinguish multiple communication data, and the data verification frame is used to verify the integrity and correctness of each communication data, so that the ECR mode electronic cash register simulation system can efficiently and accurately perform business function test operations.
[0047] In summary, the present application includes at least one of the following beneficial technical effects:
[0048] 1. The tester simulates the business function (including new business function or customized business function) of the electronic cash register to be tested by inputting the business function request in the merchant payment terminal, and calls the communication interaction middleware through the merchant payment terminal to send the corresponding business function operation instruction to the corresponding merchant payment terminal. In order to distinguish each business function operation instruction and different business functions, the business function operation instruction includes the first confirmation information with a unique communication identifier, so as to confirm whether the merchant payment terminal has received the business function operation instruction through the first confirmation information. The merchant payment terminal performs the corresponding business operation based on the received business function operation instruction. After completing the corresponding After the corresponding business operation, the merchant's cash register terminal generates execution confirmation information corresponding to the unique communication identifier and sends it to the cash register simulation terminal for confirmation. Then the cash register simulation terminal obtains the business execution result of the business function test based on the execution confirmation information. The execution test status of the business function can be known through the business execution result, thereby achieving the functional test effect of simulating the business function between the electronic cash register and the merchant's cash register terminal through the cash register simulation terminal, thereby solving the problem of limited convenience in testing the electronic cash register system. The cash register simulation terminal can reduce the testing cost of the electronic cash register system when adding business scenarios and the enterprise customization cost during business function testing;
[0049] 2. After the merchant's cashier terminal completes the business operation corresponding to the business function operation instruction, in order to obtain the business function operation status of the merchant's cashier terminal, the merchant's cashier terminal needs to send execution confirmation information used to represent the business operation result information to the cashier simulation terminal. The cashier simulation terminal sends second reception status information to the merchant's cashier terminal based on the received execution confirmation information. At this time, the merchant's cashier terminal determines whether the cashier simulation terminal has received the execution confirmation information based on the received second reception status information. Specifically, when the merchant's cashier terminal receives the second reception status information, it determines that the cashier simulation terminal has received the execution confirmation information. Otherwise, it determines that the cashier simulation terminal has not received the execution confirmation information. When the end determines that the cash register simulation terminal has not received the execution confirmation information sent for the first time, the merchant payment terminal re-sends (for the second time) the execution confirmation information according to the preset second information resending condition. If the merchant payment terminal still does not receive the second receiving status information, then on the basis of satisfying the second information resending condition, the first confirmation information is sent for the third time (the second resending number threshold at this time is not less than 3), and so on. This application sets the second resending number threshold and the constraint condition that the total waiting time for information reception of the merchant payment terminal does not exceed the preset first timeout time, which can not only monitor the business operation execution status of the merchant payment total segment, but also minimize the memory resource occupation of the data interaction simulation of the ECR mode electronic cash register simulation system;
[0050] 3. The cash register simulation terminal and the merchant cash register terminal exchange the corresponding data to be exchanged (such as the first confirmation information, the second confirmation information, the execution confirmation information, the first receiving status information, the second receiving status information) in the form of data packets of communication data packets; at the same time, the data structure of the communication data packet includes a business data frame, a flow identification frame and a data verification frame; specifically, the communication data (including business function test data) is exchanged through the business data frame, the flow identification frame is used to effectively distinguish multiple communication data, and the data verification frame is used to verify the integrity and correctness of each communication data, so that the ECR mode electronic cash register simulation system can efficiently and accurately perform business function test operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a principle block diagram of an ECR mode electronic cash register simulation system in one embodiment of the present application;
[0052] Figure 2 is a flow chart of an ECR mode electronic cash register simulation method in an embodiment of the present application;
[0053] Figure 3 It is a flow chart after step S2 in the ECR mode electronic cash register simulation method in one embodiment of the present application;
[0054] Figure 4 It is a flowchart of step S3 in the ECR mode electronic cash register simulation method in one embodiment of the present application. DETAILED DESCRIPTION
[0055] The present application is further described in detail below in conjunction with the accompanying drawings.
[0056] In one embodiment, if Figure 1 As shown, the present application discloses an ECR mode electronic cash register simulation system, which includes a cash register simulation terminal and a merchant cash register terminal; the cash register simulation terminal is provided with a plurality of operation buttons for inputting different business test function instructions; the cash register simulation terminal obtains corresponding business function test instructions based on different pressing operations on the plurality of operation buttons; the plurality of operation buttons are used to correspond to different business function test instructions, so as to meet the testing requirements of various business functions of the ECR mode electronic cash register simulation system; the cash register simulation terminal and the merchant cash register terminal realize communication connection through a preset communication protocol and a preset communication interaction middleware; in this embodiment, the file type of the communication interaction middleware is a dynamic link library file; the dynamic link library file (also known as a DLL file) is easy to be mounted and written when the program is running, which is conducive to saving the memory and system resources of the entire ECR mode electronic cash register simulation system.
[0057] In this embodiment, the merchant's payment terminal includes a Macau Pass terminal, which can perform card-tap transactions with the Macau Pass card and can also scan the payment code presented by the tester for scanning transactions.
[0058] The communication interaction middleware is connected with a data transmission serial port and a serial communication line adapted to the data transmission serial port; the data transmission serial port is consistent with the COM port, and the cash register simulation terminal and the merchant payment terminal maintain the same communication baud rate based on the data transmission serial port and the serial communication line; in actual application, the communication baud rate is 115200bps; so as to facilitate serial communication data interaction between the cash register simulation terminal and the merchant payment terminal.
[0059] The cash register simulation terminal generates corresponding business function operation instructions based on the collected business function requests and sends them to the communication interaction middleware; the communication interaction middleware distributes the business function operation instructions to the corresponding merchant cash register terminal, and the business function operation instructions include first confirmation information with a unique communication identifier; the merchant cash register terminal performs the corresponding business operation based on the received business function operation instructions, and generates execution confirmation information based on the first confirmation information and sends it to the communication interaction middleware; the communication interaction middleware sends the execution confirmation information to the cash register simulation terminal based on the unique communication identifier; the cash register simulation terminal obtains the corresponding business execution result based on the execution confirmation information, and performs business interaction simulation display based on the business execution result; in actual application, the cash register simulation terminal is provided with a display screen for displaying the business interaction simulation result.
[0060] The implementation principle of an ECR mode electronic cash register simulation system of the present application embodiment is as follows: the tester simulates the business function (including new business function or customized business function) of the electronic cash register to be tested by inputting a business function request in the merchant cash register terminal, and calls the communication interaction middleware through the merchant cash register terminal to send the corresponding business function operation instruction to the corresponding merchant cash register terminal. In order to facilitate the identification of each business function operation instruction and different business functions, the business function operation instruction includes a first confirmation information with a unique communication identifier, so as to confirm whether the merchant cash register terminal has received the business function operation instruction through the first confirmation information. The merchant cash register terminal executes the corresponding business function operation instruction based on the received business function operation instruction. Business operation, after completing the corresponding business operation, the merchant's payment terminal regenerates the execution confirmation information of the corresponding unique communication identifier and sends it to the cash register simulation terminal for confirmation. Then the cash register simulation terminal obtains the business execution result of the business function test based on the execution confirmation information. The execution test status of the business function can be known through the business execution result, thereby achieving the functional testing effect of the business function between the electronic cash register and the merchant's payment terminal through the cash register simulation terminal, thereby solving the problem of limited convenience in testing the electronic cash register system. The cash register simulation terminal can reduce the testing cost and enterprise customization cost of the electronic cash register system when adding business scenarios during business function testing.
[0061] In one embodiment, an ECR mode electronic cash register simulation method is provided, and the ECR mode electronic cash register simulation method is applied to the ECR mode electronic cash register simulation system as described above.
[0062] like Figure 2 As shown, the ECR mode electronic cash register simulation method specifically includes the following steps:
[0063] S1: Use a preset communication protocol and a preset communication interaction middleware to establish a connection between the cash register simulation terminal and the merchant's payment terminal.
[0064] In this embodiment, the merchant payment terminal is an electronic payment terminal used by the merchant, such as a Macau Pass terminal; the cash register simulation terminal can simulate the business execution results of the payment interaction.
[0065] Specifically, by means of a specified communication protocol and the communication interaction middleware of an upper-level communication tool, the communication connection method between the cash register simulation terminal and the merchant's cash register terminal is defined in advance; thereby helping to solve the problem of limited convenience in testing the electronic cash register system and reduce the testing cost and enterprise customization cost of the electronic cash register system when adding business scenarios.
[0066] S2: The cash register simulation terminal generates corresponding business function operation instructions based on the collected business function requests and distributes them to the corresponding merchant cash register terminal. The business function operation instructions include first confirmation information with a unique communication identifier.
[0067] In this embodiment, the unique communication identifier is a unique information serial number of the first confirmation information.
[0068] Specifically, the tester simulates the business functions of the electronic cash register that need to be tested (including new business functions or customized business functions) by inputting business function requests on the merchant payment terminal, and calls the communication interaction middleware through the merchant payment terminal to send the corresponding business function operation instructions to the corresponding merchant payment terminal, in order to facilitate the identification of various business function operation instructions and different business functions.
[0069] S3: The merchant payment terminal executes the corresponding business operation based on the received business function operation instruction, generates execution confirmation information based on the first confirmation information, and sends the execution confirmation information to the cash register simulation terminal according to the unique communication identifier.
[0070] Specifically, the first confirmation information is used to confirm whether the merchant's payment terminal has received the business function operation instruction. The merchant's payment terminal performs the corresponding business operation based on the received business function operation instruction. After completing the corresponding business operation, the merchant's payment terminal generates execution confirmation information corresponding to the unique communication identifier and sends it to the cash register simulation terminal for confirmation.
[0071] S4: The cash register simulation terminal obtains the corresponding business execution result based on the execution confirmation information, and performs business interaction simulation display based on the business execution result.
[0072] In this embodiment, the cash register simulation terminal obtains the business execution result of the business function test based on the execution confirmation information. The execution test status of the business function can be known through the business execution result, thereby achieving the functional testing effect of the business function between the electronic cash register and the merchant's payment terminal through the cash register simulation terminal, thereby solving the problem of limited convenience in testing the electronic cash register system. The cash register simulation terminal can reduce the testing cost and enterprise customization cost of the electronic cash register system when adding business scenarios during business function testing.
[0073] In one embodiment, if Figure 3 As shown, after step S2, the ECR mode electronic cash register simulation method includes:
[0074] S21: The corresponding merchant payment terminal sends first receiving status information for determining the receiving status of the first confirmation information to the cash register simulation terminal within a preset first confirmation time period according to the received first confirmation information.
[0075] In this embodiment, the data interaction process and the sending status of each data transmission in the ECR mode electronic cash register simulation system are recorded in detail; after the cash register simulation terminal of the embodiment of the present application generates the corresponding business function operation instruction and sends the first confirmation information, the merchant payment terminal must feedback the first receiving status information to the cash register simulation terminal within the specified first confirmation time period after receiving the first confirmation information.
[0076] Exemplarily, the first confirmation time period is 500 milliseconds.
[0077] S22: The cash register simulation terminal determines whether the first receiving status information is received within a preset second confirmation time period.
[0078] Specifically, the cash register simulation terminal judges whether the merchant payment terminal has received the corresponding first confirmation information based on whether the first receiving status information is received, so as to judge whether the merchant payment terminal has received the first confirmation information, that is, when the cash register simulation terminal receives the first receiving status information, it judges that the merchant payment terminal has received the corresponding first confirmation information, otherwise it judges that the merchant payment terminal has not received the first confirmation information; exemplarily, the second confirmation time period is 1000 milliseconds, that is, after outputting the first confirmation information, the cash register simulation terminal waits for 1000 milliseconds to receive the first receiving status information of the merchant payment terminal.
[0079] S23: If the cash register simulation terminal does not receive the first receiving status information within the preset second confirmation time period, the cash register simulation terminal resends the first confirmation information according to the preset first information retransmission condition; the first information retransmission condition satisfies that the number of retransmissions of the first confirmation information does not exceed the preset first retransmission number threshold, and that the information reception waiting time of the cash register simulation terminal does not exceed the preset first timeout time.
[0080] In this embodiment, the first retransmission number threshold and the first timeout period can be defined by oneself, for example, the first retransmission number threshold is 3 times, and the first timeout period is 3500 milliseconds.
[0081] Specifically, after the cash register simulation terminal collects the service function request, the cash register simulation terminal starts waiting for the first timeout period from the time point when the first confirmation information is sent for the first time, and the timing of the first timeout period starts at the same time.
[0082] When the cash register simulation terminal does not receive the first reception status information corresponding to the first confirmation information sent for the first time within the second confirmation time of 1000 milliseconds, the cash register simulation terminal re-sends the first confirmation information (for the second time) based on the preset first information retransmission condition. If the cash register simulation terminal still does not receive the first reception status information of the first confirmation information sent for the second time, the first confirmation information is sent for the third time on the basis of satisfying the first information retransmission condition, and so on, in order to effectively avoid the resources of the cash register simulation terminal being affected by the retransmission of the first confirmation information.
[0083] S24: If the cash register simulation terminal receives the first receiving status information within the preset second confirmation time period, the merchant cash register terminal determines that the receiving status based on the first confirmation information is successfully received.
[0084] In this embodiment, the cash register simulation terminal resends the first confirmation information multiple times according to the first information resending condition. As long as the cash register simulation terminal receives the first receiving status information of the merchant's payment terminal once, it is determined that the first confirmation information of the cash register simulation terminal is successfully sent, and the merchant's payment terminal is considered to have successfully received the first confirmation information based on its receiving status.
[0085] Specifically, the present application sets a first retransmission number threshold and a constraint condition that the information reception waiting time of the cash register simulation terminal does not exceed a preset first timeout time, thereby realizing the data interaction simulation of the ECR mode electronic cash register simulation system while also setting a retransmission requirement for the interactive data, which is beneficial to improving the interactive data processing quality of the simulation system.
[0086] In one embodiment, if Figure 4As shown, in step S3, the merchant payment terminal performs the corresponding business operation based on the received business function operation instruction, generates execution confirmation information based on the first confirmation information, and sends the execution confirmation information to the cash register simulation terminal according to the unique communication identifier, including:
[0087] S31: The merchant's payment terminal sends execution confirmation information to the cash register simulation terminal according to the unique communication identifier within the preset execution time period.
[0088] Specifically, the duration of the execution time period can be defined by oneself, such as 30 seconds.
[0089] S32: Based on the received execution confirmation information, the cash register simulation terminal sends second reception status information for determining the reception status of the execution confirmation information to the merchant payment terminal within a preset third confirmation time period.
[0090] In this embodiment, the duration of the third confirmation time period can be defined by oneself, and the third confirmation time period is 1000 milliseconds, that is, after the merchant payment terminal outputs the execution confirmation information, it waits for 1000 milliseconds to receive the second receiving status information of the cash register simulation terminal.
[0091] Specifically, after the merchant's payment terminal completes the business operation corresponding to the business function operation instruction, in order to obtain the business function operation status of the merchant's payment terminal, the merchant's payment terminal needs to send execution confirmation information used to represent the business operation result information to the cash register simulation terminal. Based on the received execution confirmation information, the cash register simulation terminal then sends a second receiving status information to the merchant's payment terminal.
[0092] S33: The merchant payment terminal determines whether the second receiving status information is received within a preset second confirmation time period.
[0093] In this embodiment, the merchant payment terminal determines whether the cash register simulation terminal has received the execution confirmation information based on the received second receiving status information.
[0094] Specifically, when the merchant's payment terminal receives the second receiving status information, it is determined that the cash register simulation terminal has received the execution confirmation information; otherwise, it is determined that the cash register simulation terminal has not received the execution confirmation information.
[0095] S34: If the merchant's payment terminal does not receive the second receiving status information within the preset second confirmation time period, the merchant's payment terminal resends the execution confirmation information according to the preset second information resending condition; the second information resending condition satisfies that the number of resending times of the execution confirmation information does not exceed the preset second resending number threshold, and that the information receiving waiting time of the merchant's payment terminal does not exceed the preset second timeout time.
[0096] In this embodiment, the second retransmission number threshold and the second timeout period can be defined by oneself, the second retransmission number threshold is 3 times, and the second timeout period is 3500 milliseconds.
[0097] Specifically, when the merchant's payment terminal determines that the cash register simulation terminal has not received the execution confirmation information sent for the first time, the merchant's payment terminal re-sends (for the second time) the execution confirmation information based on the preset second information retransmission condition. If the merchant's payment terminal still does not receive the second receiving status information, then on the basis of meeting the second information retransmission condition, it sends the first confirmation information for the third time (the second retransmission number threshold at this time is not less than 3), and so on. The merchant's payment terminal re-sends the execution confirmation information on the basis of meeting the second information retransmission condition.
[0098] The embodiment of the present application sets a second retransmission number threshold and a constraint condition that the total waiting time for information reception at the merchant's payment terminal does not exceed a preset first timeout time. This can not only monitor the business operation execution status of the merchant's total payment segment, but also minimize the memory resource occupancy of the data interaction simulation of the ECR mode electronic cash register simulation system.
[0099] In one embodiment, the ECR mode electronic cash register simulation method further includes:
[0100] S10: Based on the business function request, the cash register simulation terminal records the time data of the corresponding first confirmation information, the first receiving status information, the second confirmation information and the second receiving status information and the corresponding sending output status information into a preset record list.
[0101] In this embodiment, the record list of the cash register simulation terminal is a log file of the data interaction process and corresponding time data of the entire ECR mode electronic cash register simulation system. The record list records the business function test process of the entire simulation system, so that the simulation system can be documented and the business function test data can be recorded.
[0102] Specifically, if the cash register simulation terminal does not receive the execution confirmation information from the merchant's cash register terminal, the last successfully sent business function operation instruction or the first confirmation information can be queried through the record list, thereby facilitating the tester to query the results and test status of the business function test of the cash register simulation terminal in real time.
[0103] S20: If the merchant's cash register terminal retransmits the execution confirmation information based on the number of retransmissions equal to the second retransmission threshold, and the cash register simulation terminal does not receive the execution confirmation information within the preset second confirmation time period; the cash register simulation terminal outputs an abnormal prompt message based on the business function request.
[0104] Specifically, when the cash register simulation terminal still does not receive the execution confirmation information after the merchant's payment terminal resends the execution confirmation information for the last time, it means that there is a fault in the business function test. The abnormal prompt information is helpful to prompt the relevant testers to take corresponding fault handling measures or adjustment measures in time.
[0105] In one embodiment, after step S1, the ECR mode electronic cash register simulation method includes:
[0106] S11: The cash register simulation terminal and the merchant's cash register terminal exchange data in the form of data messages through communication data packets.
[0107] In this embodiment, the cash register simulation terminal and the merchant payment terminal exchange corresponding data to be exchanged (such as first confirmation information, second confirmation information, execution confirmation information, first receiving status information, second receiving status information) in the form of data packets of communication data packets.
[0108] S12: The communication data packet includes a business data frame, a flow identification frame and a data check frame; the business data frame is used to represent the data exchange information between the cash register simulation terminal and the merchant's cash register terminal; the flow identification frame is used to represent the unique processing identification frame of the communication data packet; the cash register simulation terminal calculates the frame code integrity of the corresponding business data frame and flow identification frame based on the data check frame.
[0109] In this embodiment, the data packet also includes a packet header and a packet tail; the packet header is represented by " <start>" indicates the beginning of a data packet; the end of a packet is marked with " <end>" indicates the end of a data packet.
[0110] Specifically, the business data frame represents the data segment in the data structure of the ECR mode electronic cash register simulation system; the serial number identification frame represents the serial number of the ECR mode electronic cash register simulation system; the data verification frame represents the verification segment of the ECR mode electronic cash register simulation system, which mainly verifies the integrity and correctness of the data.
[0111] For example, the communication data mainly includes data packets, and the format must be in the "application field = value" style. For example, "CMD = SALE", "VALUE = 1", "FIELD2 = VALUE2"; in the serial identification frame: TXNNO = value, used as the unique processing number for confirmation information and return information; the value of TXNNO of the cash register simulation terminal application information is an independent number generated by the cash register simulation terminal.
[0112] The format of the checksum segment in the data packet is such as "XOR=xx", "LEN=xx"; where XOR is the exclusive OR value (decimal), and the calculation fields include the data segment and the serial number (including,); LEN is the data length (decimal), and the calculation fields include the data segment, the serial number and the XOR segment (including,): such as: " <start>”,”CMD=SALE”,”AMT=1.00”,”AMTTYPE=MOP”,”DATA
[0113] IL=Y”,”TXNNO=000002”,”XOR=00”,”LEN=63”,” <end>"; where XOR is from" <start>"," after the "," and before the XOR tag. LEN is from " <start>From the "," after the " to the "," before the LEN label.
[0114] Specifically, communication data (including business function test data) is interacted through business data frames, multiple communication data are effectively distinguished through flow identification frames, and the integrity and correctness of each communication data are verified through data verification frames, so that the ECR mode electronic cash register simulation system can efficiently and accurately perform business function test operations.
[0115] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0116] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments may still be modified, or some of the features thereof may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.< / start> < / start> < / end> < / start> < / end> < / start>
Claims
1. ECR mode electronic cash register simulation system, characterized by: The system includes: Cash register simulation terminal and merchant payment terminal; The cash register simulation terminal and the merchant cash register terminal are connected in communication via a preset communication protocol and a preset communication interaction middleware; The cash register simulation terminal generates corresponding business function operation instructions based on the collected business function requests and sends them to the communication interaction middleware; the communication interaction middleware distributes the business function operation instructions to the corresponding merchant cash register terminal, and the business function operation instructions include first confirmation information with a unique communication identifier; The merchant payment terminal performs the corresponding business operation based on the received business function operation instruction, and generates execution confirmation information based on the first confirmation information and sends it to the communication interaction middleware; the communication interaction middleware sends the execution confirmation information to the cash register simulation terminal based on the unique communication identifier; The cash register simulation terminal obtains the corresponding business execution result based on the execution confirmation information, and performs business interaction simulation display based on the business execution result; The corresponding merchant payment terminal receives the first confirmation information based on the received first confirmation information. sending first reception status information for determining the reception status of the first confirmation information to the cash register simulation terminal in a preset first confirmation time period; the cash register simulation terminal determining whether the first reception status information is received in a preset second confirmation time period; if the cash register simulation terminal does not receive the first reception status information in the preset second confirmation time period, the cash register simulation terminal resends the first confirmation information according to a preset first information retransmission condition; The first information retransmission condition satisfies that the number of retransmissions of the first confirmation information does not exceed a preset first retransmission threshold, and that the information reception waiting time of the cash register simulation terminal does not exceed a preset first timeout time; if the cash register simulation terminal receives the first reception status information within a preset second confirmation time period, the merchant payment terminal is a successful reception based on the reception status of the first confirmation information.
2. The ECR mode electronic cash register simulation system according to claim 1, characterized in that: The communication interaction middleware is connected with a data transmission serial port and a serial communication line adapted to the data transmission serial port; the cash register simulation terminal and the merchant payment terminal maintain the same communication baud rate based on the data transmission serial port and the serial communication line.
3. The ECR mode electronic cash register simulation system according to claim 1, characterized in that: The cash register simulation terminal is provided with a plurality of operation buttons for inputting different business test function instructions; the cash register simulation terminal obtains corresponding business function test instructions based on different pressing operations of the plurality of operation buttons; the file type of the communication interaction middleware is a dynamic link library file; the merchant payment terminal includes a Macau Pass terminal.
4. ECR mode electronic cash register simulation method, characterized in that: Applied to the ECR mode electronic cash register simulation system as described in any one of claims 1 to 3, the method comprises: Using a preset communication protocol and a preset communication interaction middleware to open up the connection between the cash register simulation terminal and the merchant payment terminal; The cash register simulation terminal generates corresponding business function operation instructions based on the collected business function requests and distributes them to the corresponding merchant cash register terminal, wherein the business function operation instructions include first confirmation information with a unique communication identifier; The merchant payment terminal performs the corresponding business operation based on the received business function operation instruction, generates execution confirmation information based on the first confirmation information, and sends the execution confirmation information to the cash register simulation terminal according to the unique communication identifier; The cash register simulation terminal obtains the corresponding business execution result based on the execution confirmation information, and performs business interaction simulation display based on the business execution result; The corresponding merchant payment terminal receives the first confirmation information based on the received first confirmation information. During a preset first confirmation time period, first reception status information for determining a reception status of the first confirmation information is sent to the cash register simulation terminal; the cash register simulation terminal determines whether the first reception status information is received within a preset second confirmation time period; if the cash register simulation terminal does not receive the first reception status information within the preset second confirmation time period, the cash register simulation terminal resends the first confirmation information based on a preset first information retransmission condition; the first information retransmission condition satisfies that the number of retransmissions of the first confirmation information does not exceed a preset first retransmission number threshold, and that the information reception waiting time of the cash register simulation terminal does not exceed a preset first timeout time; if the cash register simulation terminal receives the first reception status information within the preset second confirmation time period, the merchant payment terminal determines that the reception status based on the first confirmation information is successful.
5. The ECR mode electronic cash register simulation method according to claim 4, characterized in that: The merchant payment terminal performs a corresponding business operation based on the received business function operation instruction, generates execution confirmation information based on the first confirmation information, and sends the execution confirmation information to the cash register simulation terminal according to the unique communication identifier, including: The merchant payment terminal sends the execution confirmation information to the cash register simulation terminal according to the unique communication identifier within a preset execution time period; The cash register simulation terminal sends, based on the received execution confirmation information, second reception status information for determining the reception status of the execution confirmation information to the merchant payment terminal within a preset third confirmation time period; The merchant payment terminal determines whether the second receiving status information is received within the preset second confirmation time period; If the merchant payment terminal does not receive the second reception status information within the preset second confirmation time period, the merchant payment terminal resends the execution confirmation information according to the preset second information resending condition; the second information resending condition satisfies that the number of resending times of the execution confirmation information does not exceed the preset second resending number threshold, and satisfies that the information receiving waiting time of the merchant payment terminal does not exceed the preset second timeout time.
6. The ECR mode electronic cash register simulation method according to claim 5, characterized in that: Methods include: The cash register simulation terminal records the corresponding first confirmation information, first receiving status information, second confirmation information and time data of the second receiving status information and the corresponding sending output status information into a preset record list based on the business function request; If the merchant payment terminal retransmits the execution confirmation information based on the number of times equal to the second retransmission threshold, and the cash register simulation terminal does not receive the execution confirmation information within the preset second confirmation time period; the cash register simulation terminal outputs abnormal prompt information based on the business function request.
7. The ECR mode electronic cash register simulation method according to claim 4, characterized in that: Also includes: After the merchant payment terminal executes the corresponding business operation based on the received business function operation instruction, the business operation is suspended according to the preset execution suspension time; And resume executing business operations after reaching the preset execution suspension time.
8. The ECR mode electronic cash register simulation method according to claim 4, characterized in that: After the preset communication protocol and the preset communication interaction middleware are used to open the connection between the cash register simulation terminal and the merchant payment terminal, it includes: The cash register simulation terminal and the merchant cash register terminal exchange data in the form of data messages through communication data packets; The communication data packet includes a business data frame, a flow identification frame and a data check frame; the business data frame is used to represent the data interaction information between the cash register simulation terminal and the merchant cash register terminal; the flow identification frame is used to represent the unique processing identification frame of the communication data packet; the cash register simulation terminal calculates the frame code integrity of the corresponding business data frame and flow identification frame based on the data check frame.
Citation Information
Patent Citations
POS terminal ISO8583 message test method and simulation background baffle system
CN110930608A
POS machine test method and device, test terminal and storage medium
CN112540927A