Aop-based pos settlement method and device, computer device and medium
By introducing practice mode switch state data into the POS settlement method and using AOP principles for logical isolation, the training needs of new cashiers were met, the application scenarios of the POS settlement method were expanded, and the reusability and development efficiency of the program were improved.
Patent Information
- Application Number
- CN202111487003.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2041-12-07
AI Technical Summary
Traditional POS settlement methods are not effective for training new cashiers, limiting their application scenarios.
Using the Aspect-Oriented Programming (AOP) approach, the system obtains the practice mode switch status data from the settlement information to determine whether it is in practice mode. If it is in practice mode, it skips saving and uploading settlement data, generates virtual payment instructions, and realizes virtual settlement.
Without affecting system data, it meets the training needs of new cashiers, expands the application scenarios of POS settlement methods, reduces the coupling between business logic parts, and improves the reusability and secondary development efficiency of the program.
Smart Images

Figure CN114219471B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer application, in particular to a POS settlement method and device based on AOP, computer equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] POS, full name Point of sale, also known as point of sale information system, refers to a system that reads product sales information (such as product name, unit price, sales quantity, sales time, sales store, and purchasing customer) directly through automatic reading equipment (such as cash register) when selling products, and transmits it to relevant departments through communication network and computer system for analysis and processing to improve operating efficiency.
[0003] The traditional POS settlement method registers, settles and uploads each settlement data in the settlement process, which can ensure the consistency of the product inventory in the system and the actual inventory, and facilitate the user to count and analyze the sales situation. Therefore, the traditional POS settlement method cannot be used for training new cashiers, and has the disadvantage of limited application scenarios. SUMMARY
[0004] Therefore, it is necessary to provide a POS settlement method and device based on AOP, computer equipment, computer readable storage medium and computer program product to expand the application scenarios of the POS settlement method in view of the problem of limited application scenarios of the traditional POS settlement method.
[0005] In a first aspect, the present application provides a POS settlement method based on AOP. The method comprises:
[0006] obtaining settlement information required for settlement; the settlement information includes settlement data and exercise mode switch state data;
[0007] extracting the exercise mode switch state data in the settlement information, and determining whether the current is in the exercise mode according to the exercise mode switch state data;
[0008] If the current is not in the exercise mode, execute the steps of saving and uploading the settlement data, and generate a payment instruction according to the settlement data;
[0009] If the current is in the exercise mode, skip the step of saving and uploading the settlement data, and generate a virtual payment instruction according to the settlement data.
[0010] In one of the embodiments, the obtaining of the settlement information required for settlement comprises:
[0011] acquire a key-value pair in the xml file for identifying the exercise mode switch state, and determine exercise mode switch state data according to the key-value pair;
[0012] acquire settlement data, and generate settlement information required by a settlement acquirer based on the settlement data and the exercise mode switch state data.
[0013] In one embodiment, before the acquiring a key-value pair in the xml file for identifying the exercise mode switch state, and determining exercise mode switch state data according to the key-value pair, it includes:
[0014] acquire an exercise mode opening instruction, and update the key-value pair in the xml file for identifying the exercise mode switch state according to the exercise mode opening instruction.
[0015] In one embodiment, the extracting exercise mode switch state data in the settlement information includes:
[0016] extracting a base class in the settlement information for storing exercise mode switch state data, and determining exercise mode switch state data according to the base class.
[0017] In one embodiment, if the current is in the exercise mode, the step of saving and uploading the settlement data is skipped, and after the virtual payment instruction is generated according to the settlement data, it further includes:
[0018] receive virtual payment feedback information, and output prompt information according to the virtual payment feedback information.
[0019] In one embodiment, the prompt information includes payment completion information; after the receiving virtual payment feedback information, and outputting prompt information according to the virtual payment feedback information, it further includes:
[0020] generating a business invoice printing instruction according to the prompt information, instructing the printer to print the business invoice.
[0021] In a second aspect, the application provides a POS settlement device based on AOP. The device includes:
[0022] an acquisition module for acquiring settlement information required by a settlement acquirer; the settlement information includes settlement data and exercise mode switch state data;
[0023] a judgment module for extracting exercise mode switch state data in the settlement information, and judging whether the current is in the exercise mode according to the exercise mode switch state data;
[0024] The settlement module is configured to, if the result of the judgment of the judgment module is that the current is not in the practice module, execute the step of saving and uploading the settlement data, and generate a payment instruction according to the settlement data.
[0025] The practice module is configured to, if the result of the judgment of the judgment module is that the current is in the practice module, skip the step of saving and uploading the settlement data, and generate a virtual payment instruction according to the settlement data.
[0026] In one of the embodiments, the obtaining module comprises:
[0027] The obtaining unit is configured to obtain a key-value pair in the xml file for identifying the practice mode switch state, and determine the practice mode switch state data according to the key-value pair; and further configured to obtain the settlement data.
[0028] The generating unit is configured to generate the settlement information required by the settlement based on the settlement data and the practice mode switch state data.
[0029] In one of the embodiments, the obtaining module further comprises:
[0030] The updating unit is configured to obtain a practice mode opening instruction, and update the key-value pair in the xml file for identifying the practice mode switch state according to the practice mode opening instruction.
[0031] In one of the embodiments, the judgment module is specifically configured to extract a base class in the settlement information for storing the practice mode switch state data, and determine the practice mode switch state data according to the base class.
[0032] In one of the embodiments, the AOP-based POS settlement device further comprises:
[0033] The prompt information receiving module is configured to receive virtual payment feedback information, and output prompt information according to the virtual payment feedback information.
[0034] In one of the embodiments, the prompt information comprises payment completion information; and the AOP-based POS settlement device further comprises:
[0035] The printing module is configured to generate a business document printing instruction according to the prompt information, and instruct the printer to print the business document.
[0036] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, the computer program is programmed based on the design idea of AOP; the processor executes the computer program to realize the following steps:
[0037] acquire settlement information required by the acquirer settlement; the settlement information includes settlement data and exercise mode switch state data;
[0038] extract the exercise mode switch state data in the settlement information, and determine whether the current is in the exercise mode according to the exercise mode switch state data;
[0039] if the current is not in the exercise mode, execute the step of saving and uploading the settlement data, and generate a payment instruction according to the settlement data;
[0040] if the current is in the exercise mode, skip the step of saving and uploading the settlement data, and generate a virtual payment instruction according to the settlement data.
[0041] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium has a computer program stored thereon, the computer program being programmed based on the design idea of AOP; and the computer program, when executed by a processor, implements the following steps:
[0042] acquire settlement information required by the acquirer settlement; the settlement information includes settlement data and exercise mode switch state data;
[0043] extract the exercise mode switch state data in the settlement information, and determine whether the current is in the exercise mode according to the exercise mode switch state data;
[0044] if the current is not in the exercise mode, execute the step of saving and uploading the settlement data, and generate a payment instruction according to the settlement data;
[0045] if the current is in the exercise mode, skip the step of saving and uploading the settlement data, and generate a virtual payment instruction according to the settlement data.
[0046] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, the computer program being programmed based on the design idea of AOP; and the computer program, when executed by a processor, implements the following steps:
[0047] acquire settlement information required by the acquirer settlement; the settlement information includes settlement data and exercise mode switch state data;
[0048] extract the exercise mode switch state data in the settlement information, and determine whether the current is in the exercise mode according to the exercise mode switch state data;
[0049] if the current is not in the exercise mode, execute the step of saving and uploading the settlement data, and generate a payment instruction according to the settlement data;
[0050] If the current is in the practice mode, the step of saving and uploading the settlement data is skipped, and a virtual payment instruction is generated according to the settlement data.
[0051] The AOP-based POS settlement method, device, computer device, computer readable storage medium and computer program product have the design idea of aspect-oriented programming, isolate each part of the business logic, and reduce the coupling degree between each part of the business logic. Specifically, the practice mode switch state data in the settlement information is extracted, and whether the current is in the practice mode is judged according to the practice mode switch state data. If the current is in the practice mode, the step of saving and uploading the settlement data is skipped, a virtual payment instruction is generated, and virtual settlement is completed. The training demand for new cashiers can be met without affecting the system data, and the application scenario of the POS settlement method is expanded. BRIEF DESCRIPTION OF DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0053] Figure 1 The application scenario diagram of the AOP-based POS settlement method in an embodiment;
[0054] Figure 2 The flowchart of the AOP-based POS settlement method in an embodiment;
[0055] Figure 3 The user interface schematic diagram of the AOP-based POS settlement method in an embodiment;
[0056] Figure 4 The flowchart of generating settlement information required by a settlement institution in an embodiment;
[0057] Figure 5 The function menu interface schematic diagram of the AOP-based POS settlement method in an embodiment;
[0058] Figure 6 The flowchart of the AOP-based POS settlement method in another embodiment;
[0059] Figure 7 The user interface schematic diagram of the AOP-based POS settlement method in another embodiment;
[0060] Figure 8 The principle schematic diagram of the aspect-oriented programming idea in an embodiment;
[0061] Figure 9 A flow chart of the AOP-based POS settlement method in another embodiment;
[0062] Figure 10 A structural block diagram of the AOP-based POS settlement device in an embodiment;
[0063] Figure 11 An internal structural diagram of the computer device in an embodiment. DETAILED DESCRIPTION
[0064] In order to facilitate the understanding of the present application, the present application will be described in more detail below with reference to the relevant drawings. The drawings show embodiments of the present application. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
[0066] The AOP-based POS settlement method provided by the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store commodity inventory information and settlement information. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. AOP refers to aspect-oriented programming, which introduces common behavior to scattered objects or businesses to reduce the coupling degree between business modules, and can isolate each part of the business logic, so that the coupling degree between the business logic is reduced, which is beneficial to improve the reusability of the program and improve the efficiency of secondary development. To the present application, based on the idea of AOP, the practice mode switch state data is introduced in the settlement information, and in the process of executing the POS settlement method of the terminal 102: obtaining the settlement information required for settlement; the settlement information includes settlement data and practice mode switch state data; extracting the practice mode switch state data in the settlement information, and judging whether the current is in the practice mode according to the practice mode switch state data; if the current is not in the practice mode, execute the step of saving and uploading the settlement data, and generate a payment instruction according to the settlement data; if the current is in the practice mode, skip the step of saving and uploading the settlement data, and generate a virtual payment instruction according to the settlement data. Among them, the terminal 102 can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0067] In one embodiment, as Figure 2 shown, an AOP-based POS settlement method is provided, and this embodiment is exemplified by the method applied to the terminal 102. In this embodiment, the AOP-based POS settlement method includes steps S201 to S207.
[0068] Step S201, obtaining the settlement information required for settlement.
[0069] Among them, the settlement information contains settlement data and practice mode switch state data. The settlement data specifically includes commodity sales information and customer information. The commodity sales information includes but is not limited to commodity name, unit price, sales quantity, sales time, sales store and cashier identifier, etc. The customer information includes but is not limited to customer membership account and balance, etc. The practice mode switch state data is state data used to identify whether the practice mode is enabled.
[0070] It should be noted that the customer information (including but not limited to customer device information, customer personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0071] Specifically, the terminal can directly obtain the settlement information required for the settlement from the code scanning terminal or the server, or can obtain the settlement data and generate the settlement information required for the settlement based on the settlement data and the exercise mode switch state data. Further, the specific manner in which the terminal obtains the settlement data is not unique. For example, the settlement data can be obtained from the code scanning terminal by scanning the code, as shown in Figure 3 The product information can be displayed by category, for example, as shown in Figure 3 The products are classified into food, daily necessities, and fresh food, and are displayed according to different categories. Further, a product search service can be provided to quickly obtain product information.
[0072] In step S203, the exercise mode switch state data in the settlement information is extracted, and it is determined whether the current mode is the exercise mode according to the exercise mode switch state data.
[0073] As described above, the exercise mode switch state data is state data used to identify whether the exercise mode is enabled. Based on this, the terminal can extract the exercise mode switch state data in the settlement information, and determine whether the current mode is the exercise mode according to the exercise mode switch state data. For example, when the value of the exercise mode switch state data is a preset value, it is determined that the current mode is the exercise mode, or when the data format of the exercise mode switch state data is a preset format, it is determined that the current mode is the exercise mode.
[0074] Further, after determining whether the current mode is the exercise mode, the determination result can be output to facilitate the cashier to confirm the current mode in real time. For example, as shown in Figure 3 When the current mode is the exercise mode, the left window of the user interface displays the word "exercise mode". The word "exercise mode" can be set as a watermark to avoid affecting other display contents in the window.
[0075] In addition, the specific manner in which the terminal extracts the exercise mode switch state data in the settlement information is not unique. For example, the exercise mode switch state data can be obtained according to the field in which the exercise mode switch state data is located in the settlement information.
[0076] In one embodiment, extracting the exercise mode switch state data in the settlement information includes extracting a base class for storing the exercise mode switch state data in the settlement information, and determining the exercise mode switch state data according to the base class.
[0077] The base class refers to a class type defined to contain the commonality of all entities in object-oriented design. Specifically, each data entity of settlement information inherits a base class for storing exercise mode switch state data. When settlement is performed, the exercise mode switch state data stored in the base class of the data entity is extracted, and it is determined whether the current is in the exercise mode according to the exercise mode switch state data.
[0078] In step S205, if the current is not in the exercise mode, the step of saving and uploading the settlement data is performed, and the payment instruction is generated according to the settlement data.
[0079] It can be understood that if the current is not in the exercise mode, it means that the current is in the normal settlement state, and the normal settlement step can be performed. The step of saving and uploading the settlement data is performed, and the payment instruction is generated according to the settlement data. The payment instruction is used to instruct the user to pay, and the fund transfer occurs in the payment process. Further, the payment method includes mobile payment, cash payment, or member deduction, and the corresponding payment interface is shown in FIG. 8. As shown in FIG. 8, different regions on the user interface can be clicked to perform settlement according to different payment methods. Figure 3
[0080] In step S207, if the current is in the exercise mode, the step of saving and uploading the settlement data is skipped, and the virtual payment instruction is generated according to the settlement data.
[0081] If the current is in the exercise mode, it means that the current is in the cash register exercise state, and the saving and uploading of the settlement data is not required. At this time, the terminal skips the step of saving and uploading the settlement data, and directly generates the virtual payment instruction according to the settlement data. The virtual payment instruction is used to instruct the user to perform virtual payment. In the virtual payment process, only the payment action is performed without real fund transfer. The cashier can simulate the user to perform virtual payment in multiple ways in the exercise mode, such as clicking the virtual payment completion option or scanning the two-dimensional code for virtual payment.
[0082] The above POS settlement method based on AOP uses the design idea of aspect-oriented programming to isolate each part of the business logic, so that the coupling degree between the parts of the business logic is reduced. By extracting the exercise mode switch state data in the settlement information and determining whether the current is in the exercise mode according to the exercise mode switch state data, if the current is in the exercise mode, the step of saving and uploading the settlement data is skipped, and the virtual payment instruction is generated to complete the virtual settlement. On the one hand, the training needs of new cashiers can be met without affecting the system data, which is beneficial to expand the application scenarios of the POS settlement method. On the other hand, the coupling degree between the parts of the business logic is low, which is beneficial to improve the reusability of the program, thereby improving the efficiency of secondary development and reducing the development cost.
[0083] In one embodiment, as shown in Figure 4 The settlement information required for acquiring the settlement of the acquirer includes steps S402 and S404.
[0084] In step S402, the key-value pair for identifying the exercise mode switch state in the xml file is acquired, and the exercise mode switch state data is determined according to the key-value pair.
[0085] The xml is the full name of EXtensible Markup Language, also known as Extensible Markup Language, which is a markup language for marking electronic files to have structure. The xml file is a data storage file based on xml. The xml file can be stored in the data storage module of the terminal itself, or can be stored on an external data storage system. In short, the specific storage location of the xml file is not limited in this embodiment. The key value is located at the end of the registry structure chain, and is similar to the file system file, which contains the actual configuration information and data used by the current computer and application program during execution.
[0086] Specifically, the exercise mode switch state data is stored in the xml file in the form of a key-value pair through SharePreference, and the terminal determines the exercise mode switch state data by acquiring the key-value pair for identifying the exercise mode switch state in the xml file.
[0087] In step S404, the settlement data is acquired, and the settlement information required for the settlement of the acquirer is generated based on the settlement data and the exercise mode switch state data.
[0088] For the acquisition method of the settlement data, please refer to the above, which will not be repeated here. Specifically, the terminal acquires the settlement data, and generates the settlement information required for the settlement of the acquirer based on the settlement data and the exercise mode switch state data according to the preset data arrangement mode and data format.
[0089] In the above embodiment, the exercise mode switch state data is stored in the xml file in the form of a key-value pair through SharePreference. On the one hand, relying on the data persistence feature of SharePreference, the switch state of the exercise mode will not be invalid due to the restart of the app, which is beneficial to improve the use convenience. On the other hand, the settlement system can be more lightweight, and the data can be cleared together when uninstalling, without causing data residue.
[0090] In one embodiment, please continue to refer to Figure 4 Before step S402, it further includes step S401: acquiring an exercise mode opening instruction, and updating the key-value pair for identifying the exercise mode switch state in the xml file according to the exercise mode opening instruction.
[0091] The terminal acquires the practice mode opening instruction in various ways. For example, as shown in Figure 5 , the cashier can click the "practice mode" in the function menu interface to send the practice mode opening instruction to the terminal. Alternatively, the terminal can automatically open the practice mode and acquire the practice mode opening instruction when the practice time of the cashier corresponding to the cashier identifier in the settlement information is less than the preset time.
[0092] Specifically, the terminal acquires the practice mode opening instruction and checks the key-value pair for identifying the practice mode switch state in the xml file according to the practice mode opening instruction. If the two are consistent, the key-value pair remains unchanged. If the two are inconsistent, the key-value pair for identifying the practice mode switch state in the xml file is updated accordingly.
[0093] Further, as shown in Figure 5 , the POS system also supports various functions such as goods management, member management, statistical management, and sales management. The goods management includes return, exchange, pickup, delivery, inventory query, and switching out of the delivery warehouse. The member management includes adding members, etc. The statistical management includes store income and expenditure statistics, order management, shift closing, and daily closing. The sales management includes sales documents and business documents. A message center is also set up to support manual data synchronization, shift-off, and other operations.
[0094] In the above embodiment, the terminal acquires the practice mode opening instruction before extracting the practice mode switch state data, and updates the key-value pair for identifying the practice mode switch state in the xml file according to the practice mode opening instruction, which can ensure that the extracted practice mode switch state data is the latest data, and is conducive to improving the accuracy of the practice mode switch state data.
[0095] In one embodiment, as shown in Figure 6 , after step S207, step S208 is further included: receiving virtual payment feedback information and outputting prompt information according to the virtual payment feedback information.
[0096] The virtual payment feedback information refers to the feedback information received by the terminal after the user performs virtual payment. The virtual payment feedback information can specifically include payment amount and payment channel, etc. Specifically, the terminal can output corresponding prompt information according to the virtual payment feedback information. As shown in Figure 7 , when the payment amount is greater than the settlement amount, the change prompt information is output. When the code scanning payment is successful or the change is completed, the payment completion information is output. When the code scanning payment fails, the payment failure information is output. Further, when the prompt information is the payment completion information, the sales page can be automatically returned for the next settlement.
[0097] In one embodiment, the prompt information includes payment completion information. Please refer toFigure 6 In the case of the embodiment, after step S208, there is further a step S209 of generating a business document printing instruction according to the prompt information, instructing the printer to print the business document.
[0098] The specific content of the business document includes, but is not limited to, commodity sales information and customer information.
[0099] Further, when not in the practice mode, after generating the payment instruction, payment feedback information can also be received, and corresponding prompt information is output according to the payment feedback information, and when the prompt information is payment completion information, a business document printing instruction is generated, instructing the printer to print the business document.
[0100] In the above embodiment, the settlement process simulation of the entire flow is provided in the practice mode, which can help new cashiers quickly learn the entire settlement flow and improve the learning effect.
[0101] For ease of understanding, the POS settlement method based on AOP in the present application will be described in detail below. Figure 8 and Figure 9
[0102] In the present embodiment, under the software architecture of the Android system, the practice mode switch state data is stored in an xml file in the form of key-value pairs through SharePreference, wherein the default value of the practice mode switch state data is the non-practice mode. Relying on the data persistence feature of SharePreference, the practice mode switch state data will not be invalidated due to the restart of the settlement system application (app). When the cashier opens the practice mode in the app function menu page, the program will update the key-value pair stored in the xml file to the practice mode state.
[0103] Further, to let the practice mode not produce any data is mainly based on the idea of AOP, that is, to introduce common behaviors for scattered objects or businesses to reduce the coupling degree between business modules and make them easier to maintain later. In the present application, since uploading data involves interface calling, and the data entities transmitted by each interface are different, each settlement information data entity inherits a base class BaseRequest for storing the practice mode switch state. Before data uploading, the practice mode switch state data in the settlement information is taken out, and whether the current is in the practice mode is judged according to the practice mode switch state data. If in the practice mode, the steps of saving and uploading data are skipped, and the logic of successful interface calling in the normal settlement mode is directly executed to interact with the UI (User Interface), such as the sales completion prompt "payment success", the page automatically returns to the sales page, and the business document is printed.
[0104] It can be understood that if the current is in the normal settlement state, the normal settlement step is performed, the step of saving and uploading the settlement data is executed, the local database is updated, and the payment instruction is generated according to the settlement data, instructing the user to make a payment. And receive payment feedback information, output corresponding prompt information according to the payment feedback information, and generate a business document printing instruction when the prompt information is payment completion information, instructing the printer to print the business document.
[0105] The above-mentioned POS settlement method based on AOP does not save and upload data in the practice mode, so that new cashiers can use the functions of the system at will without being familiar with the software. On the one hand, the training needs of new cashiers can be met without affecting the system data, which is conducive to expanding the application scenarios of the POS settlement method. On the other hand, due to the low coupling degree between the business logic parts, the reusability of the program is improved, thereby improving the efficiency of secondary development and reducing development costs.
[0106] It should be understood that although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise stated herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.
[0107] Based on the same inventive concept, the embodiments of the present application also provide an AOP-based POS settlement device for implementing the above-mentioned AOP-based POS settlement method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more AOP-based POS settlement device embodiments provided below can refer to the limitations of the AOP-based POS settlement method in the above text, which will not be repeated here.
[0108] In one embodiment, as shown in Figure 10 An AOP-based POS settlement device 1000 is provided, which includes an acquisition module 1001, a judgment module 1003, a settlement module 1005, and a practice module 1007. Wherein:
[0109] The obtaining module 1001 is configured to obtain settlement information required by a settlement institution; the settlement information comprises settlement data and exercise mode switch state data;
[0110] The judging module 1003 is configured to extract the exercise mode switch state data in the settlement information, and judge whether the current is in the exercise mode according to the exercise mode switch state data;
[0111] The settlement module 1005 is configured to, if the judging result of the judging module is that the current is not in the exercise mode, execute the step of saving and uploading the settlement data, and generate a payment instruction according to the settlement data;
[0112] The exercise module 1007 is configured to, if the judging result of the judging module is that the current is in the exercise mode, skip the step of saving and uploading the settlement data, and generate a virtual payment instruction according to the settlement data.
[0113] In an embodiment, the obtaining module 1001 comprises:
[0114] The obtaining unit is configured to obtain a key-value pair in an xml file for identifying the exercise mode switch state, and determine the exercise mode switch state data according to the key-value pair; and is further configured to obtain the settlement data;
[0115] The generating unit is configured to generate the settlement information required by the settlement institution based on the settlement data and the exercise mode switch state data.
[0116] In an embodiment, the obtaining module 1001 further comprises:
[0117] The updating unit is configured to obtain an exercise mode opening instruction, and update the key-value pair in the xml file for identifying the exercise mode switch state according to the exercise mode opening instruction.
[0118] In an embodiment, the judging module 1003 is specifically configured to extract a base class for storing the exercise mode switch state data in the settlement information, and determine the exercise mode switch state data according to the base class.
[0119] In an embodiment, the AOP-based POS settlement device further comprises a prompt information receiving module configured to receive virtual payment feedback information, and output prompt information according to the virtual payment feedback information.
[0120] In an embodiment, the prompt information comprises payment completion information; the AOP-based POS settlement device further comprises a printing module configured to generate a business document printing instruction according to the prompt information, and instruct a printer to print the business document.
[0121] The modules in the POS settlement device based on AOP can be implemented by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so that the processor can call and execute the operations of the modules.
[0122] In one embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in FIG. 1. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is configured to perform wired or wireless communication with an external terminal. The wireless communication can be achieved by WIFI, mobile cellular network, NFC (near field communication), or other technologies. The computer program is executed by the processor to implement a POS settlement method based on AOP. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball, or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad, or mouse, etc. Figure 11 Those skilled in the art can understand that the structure shown in FIG. 1 is only a block diagram of part of the structure related to the scheme of the present application, and does not limit the computer device to which the scheme of the present application is applied. Specifically, the computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0123] Figure 11 In one embodiment, a computer device is provided, which includes a memory and a processor. The memory stores a computer program programmed based on the design idea of AOP. The processor executes the computer program to implement the steps in the method embodiments.
[0124] In one embodiment, a computer readable storage medium is provided, which stores a computer program programmed based on the design idea of AOP. The computer program is executed by a processor to implement the steps in the method embodiments.
[0125] In one embodiment, a computer readable storage medium is provided, which stores a computer program programmed based on the design idea of AOP. The computer program is executed by a processor to implement the steps in the method embodiments.
[0126] In one embodiment, a computer program product is provided, comprising a computer program programmed based on the design idea of AOP; the computer program is executed by a processor to implement the steps in the above method embodiments.
[0127] Those skilled in the art can understand that all or part of the processes in the above method embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0128] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present disclosure.
[0129] The above-described embodiments are merely illustrative of several embodiments of the present application, which are described in more detail and in a specific manner, but should not be construed as limiting the scope of the patent. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. An AOP-based POS settlement method, characterized by, The method comprises the following steps: When the practice duration of the corresponding cashier identified by the cashier identifier in the settlement information is less than the preset duration, automatically start the practice mode to obtain a practice mode starting instruction; According to the practice mode starting instruction, check the key-value pair in the xml file used to identify the practice mode switch state. If the two are consistent, the key-value pair remains unchanged. If the two are inconsistent, the key-value pair is updated accordingly; Obtain settlement data, arrange the data according to the preset data arrangement mode and data format, and generate settlement information required for settlement based on the settlement data and the practice mode switch state data identified by the key-value pair; According to the field of the practice mode switch state data in the settlement information, extract the practice mode switch state data in the settlement information, and determine whether the current is in the practice mode according to the practice mode switch state data; If the current is not in the practice mode, execute the step of saving and uploading the settlement data, and generate a payment instruction according to the settlement data; If the current is in the practice mode, skip the step of saving and uploading the settlement data, execute the interface calling logic and the user interface in the normal settlement mode, generate a virtual payment instruction according to the settlement data, and the practice mode does not generate any business data based on the AOP idea.
2. The method of claim 1, wherein, The extraction of the practice mode switch state data in the settlement information comprises: Extract the base class for storing the practice mode switch state data in the settlement information, and determine the practice mode switch state data according to the base class.
3. The method of claim 1, wherein, After generating the virtual payment instruction according to the settlement data, it further comprises: Receive virtual payment feedback information and output prompt information according to the virtual payment feedback information.
4. The method of claim 3, wherein, The prompt information includes payment completion information; after receiving the virtual payment feedback information and outputting the prompt information according to the virtual payment feedback information, it further comprises: Generate a business document printing instruction according to the prompt information to instruct the printer to print the business document.
5. An AOP-based POS settlement device, characterized by comprising: The method comprises the following steps: The acquisition module is used to automatically start the practice mode when the practice duration of the corresponding cashier identified by the cashier identifier in the settlement information is less than the preset duration, to obtain a practice mode starting instruction, to check the key-value pair in the xml file used to identify the practice mode switch state according to the practice mode starting instruction, to keep the key-value pair unchanged if the two are consistent, and to update the key-value pair accordingly if the two are inconsistent, and to obtain settlement data, to arrange the data according to the preset data arrangement mode and data format, and to generate settlement information required for settlement based on the settlement data and the practice mode switch state data identified by the key-value pair; The judgment module is used to extract the practice mode switch state data in the settlement information according to the field of the practice mode switch state data in the settlement information, and to determine whether the current is in the practice mode according to the practice mode switch state data; The settlement module is used to execute the step of saving and uploading the settlement data if the judgment result of the judgment module is that the current is not in the practice mode, and to generate a payment instruction according to the settlement data. The practice module is configured to, if the determination result of the determination module is that the current is in the practice module, skip the step of saving and uploading the settlement data, execute interface calling logic in a normal settlement mode to interact with a user interface, and generate a virtual payment instruction according to the settlement data, wherein the practice mode does not generate any business data based on an AOP idea.
6. The apparatus of claim 5, wherein, The determination module is specifically configured to: extract a base class for storing practice mode switch state data in the settlement information, and determine the practice mode switch state data according to the base class.
7. The apparatus of claim 5, wherein, The device further includes a prompt information receiving module configured to: receive virtual payment feedback information, and output prompt information according to the virtual payment feedback information. 8.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-7. The computer program is programmed based on the design idea of AOP; and the processor executes the computer program to implement the steps of the method in any one of claims 1 to 4.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is programmed based on the design idea of AOP; and the computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
10. A computer program product comprising a computer program, characterized in that, The computer program is programmed based on the design idea of AOP; and the computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
Citation Information
Patent Citations
POS operation practice system, POS operation practice method, communication terminal, and program
JP2021018704A