WO2018184359A1 - 支付终端应用仿真方法、移动终端和可读存储介质 - Google Patents

支付终端应用仿真方法、移动终端和可读存储介质 Download PDF

Info

Publication number
WO2018184359A1
WO2018184359A1 PCT/CN2017/102297 CN2017102297W WO2018184359A1 WO 2018184359 A1 WO2018184359 A1 WO 2018184359A1 CN 2017102297 W CN2017102297 W CN 2017102297W WO 2018184359 A1 WO2018184359 A1 WO 2018184359A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
interface
function
simulation
version
Prior art date
Application number
PCT/CN2017/102297
Other languages
English (en)
French (fr)
Inventor
李坚强
郑任持
谭朗明
Original Assignee
万达百汇科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 万达百汇科技(深圳)有限公司 filed Critical 万达百汇科技(深圳)有限公司
Publication of WO2018184359A1 publication Critical patent/WO2018184359A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Definitions

  • the present application relates to the field of embedded technologies, and in particular, to a payment terminal application emulation method, a mobile terminal, and a readable storage medium.
  • the POS (Point Of Sale) terminal is an embedded device. It is loaded with the firmware provided by the manufacturer at the factory. It needs to develop various applications and load according to the actual POS application interface and according to the actual business development process. To the POS terminal, the POS can provide related business functions.
  • the existing POS application development solution requires the developer to build the application engineering, coding and use the cross-compilation tool to compile the code into the target code. Finally, download the target code to the POS terminal to check whether the running effect matches the design, if the POS terminal In the observation, verification is wrong, you need to re-edit the code, compile, download, observe and verify, until the design requirements are met, the developer can not debug the application in real time, the application development is inefficient.
  • a payment terminal application emulation method a mobile terminal, and a readable storage medium are provided.
  • a payment terminal application simulation method comprising:
  • a mobile terminal includes a memory and a processor, wherein the memory stores computer readable instructions, and when the instructions are executed by the processor, the processor performs the following steps:
  • One or more computer readable non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the steps of:
  • FIG. 1 is a hardware environment diagram of a payment terminal application emulation method in an embodiment
  • FIG. 2 is a diagram showing the internal structure of a mobile terminal in an embodiment
  • FIG. 3 is a flowchart of a payment terminal application emulation method in an embodiment
  • FIG. 4 is a flow chart of an executable file API emulation method in an embodiment
  • FIG. 5 is a flow chart showing a display method of displaying simulation results in one embodiment
  • FIG. 6 is a flowchart of a payment terminal application emulation method in an embodiment
  • FIG. 7 is a flow chart of a payment terminal application emulation method in another embodiment
  • FIG. 8 is a flowchart of a payment terminal application emulation method in a specific embodiment
  • FIG. 9 is a schematic flow chart of generating an executable file in an embodiment
  • Figure 10 is a schematic diagram of a format of a transmitted data in an embodiment
  • FIG. 11 is a schematic diagram of a received data format in an embodiment
  • FIG. 12 is a structural block diagram of a mobile terminal in an embodiment
  • Figure 13 is a block diagram showing the structure of a simulation module in an embodiment
  • Figure 14 is a block diagram showing the structure of a display module in an embodiment
  • 15 is a structural block diagram of an application engineering acquisition module in an embodiment
  • Figure 16 is a block diagram showing the structure of a mobile terminal in another embodiment.
  • FIG. 1 is a hardware environment diagram of a payment terminal application emulation method in an embodiment.
  • the hardware environment includes serial communication between the mobile terminal 110 and the payment terminal 120, and the mobile terminal 110 provides a payment terminal application simulation environment to simulate the payment terminal application.
  • the mobile terminal 110 When the mobile terminal 110 cannot provide the corresponding simulation hardware, The mobile terminal 110 sends the corresponding interface function parameter to the payment terminal 120, and the payment terminal 120 invokes the corresponding interface function to perform simulation according to the received interface function parameter, returns the simulation result to the mobile terminal 110, and performs the simulation interface in the mobile terminal 110. display.
  • the mobile terminal includes a processor connected through a system bus, a non-volatile storage medium, an internal memory, a serial interface, a display screen, and an input device.
  • the non-volatile storage medium of the terminal stores an operating system and computer readable instructions.
  • the processor is used to provide computing and control capabilities to support the operation of the entire mobile terminal.
  • the computer readable instructions when executed by the processor, can cause the processor to perform a payment terminal application emulation method.
  • the serial interface is used for serial communication with the payment terminal, such as sending an interface function to the payment terminal, receiving an execution result returned by the payment terminal, and the like.
  • the display screen of the mobile terminal may be a liquid crystal display or an electronic ink display screen
  • the input device may be a touch layer covered on the display screen, or may be a button, a trackball or a touchpad provided on the terminal housing, or may be an external connection. Keyboard, trackpad or mouse.
  • FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the terminal to which the solution of the present application is applied.
  • the specific terminal may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
  • a payment terminal application simulation method including the following content:
  • step S310 the third-party editor version is detected, and the corresponding third-party editor is used to open the corresponding application project according to the pre-selected third-party editor version.
  • the third-party editor version refers to the version corresponding to the editor outside the simulation system, and the simulation The system automatically establishes a connection with a third-party editor.
  • the third-party editor is automatically associated and the version of the third-party editor is detected.
  • the simulation system refers to a system installed in the mobile terminal for simulating the function of the payment terminal.
  • the simulation system display interface displays the detected editor version, receives the user selection instruction, acquires the third-party editor version selected by the user, and uses the The version of the third-party editor opens the corresponding application project.
  • the simulation system can be used to open an existing application project, create a new application project, add an application project, or delete an application project. If you need to create a new application project, create a new application project and edit the name, path and description of the application project before opening the application project with the selected third-party editor. After saving, use the corresponding third-party editor to open the corresponding application. engineering. If you open the application project directly, select an application project in the list of existing application projects, and open the selected application project using the corresponding third-party editor.
  • Step S320 Obtain a custom application in the application project, compile the custom application by using a third-party editor, and link the custom application with the preset static library and the preset dynamic library to generate an executable file.
  • the custom application refers to the corresponding code written by the developer in the application engineering editing interface according to the application function of the payment terminal implemented by the developer, and the language of the writing code is the programming language corresponding to the payment terminal, such as the C language program, and the corresponding entry function.
  • the main function in order to implement simulation of the custom application, an application interface is needed for outputting information and displaying simulation information for easy viewing, so the customized application needs to run in an environment capable of providing a simulation interface.
  • the system entry function is stored in the preset static library, and the system entry function can enter the system simulation development platform, and the preset dynamic library stores a large number of interface functions for implementing the simulation function and interface of the customized application.
  • Interactive function In order to provide a simulation environment corresponding to the custom application, the entry function of the custom application needs to be transferred to the entry function of the system providing the simulation environment, so that the custom application can run in the system providing the simulation environment.
  • the interface function in the preset dynamic library is called to simulate the corresponding function, so the custom application needs to be associated with the preset static library and the preset dynamic library.
  • the custom application is compiled by a third-party editor, and the custom application corresponds to the second through the compiled link process.
  • the binary file and the preset static library and the preset dynamic library are compiled into files that can be executed by the system corresponding to the third-party editor.
  • the entry function refers to the function that is called when the application starts running. All subsequent operations of the program are called or indirectly called under the entry function.
  • Step S330 executing an executable file to simulate the function of the custom application.
  • the executable file is executed.
  • a system entry function is encapsulated in a preset static library, and the system entry function is an entry function corresponding to a system providing various interfaces
  • the execution executable file first executes a system entry function to enter a system simulation platform, and simultaneously starts a preset dynamic Library.
  • the preset static library stores the entry function address corresponding to the custom application.
  • the entry function corresponding to the custom application is obtained according to the entry function address corresponding to the custom application. Call the entry function to execute the custom application, and call the interface function in the preset dynamic library according to the application written in the custom application to simulate the corresponding function.
  • the developer can establish an application project by using a third-party editor, and write an application corresponding to the payment terminal application function, which can help the developer to quickly create an application framework.
  • Compiling with a third-party editor to create a executable file with a preset static library and a preset dynamic library, so that the custom application can be executed under the system corresponding to the third-party editor, with the help of a third-party system Provide the corresponding simulation environment and perform corresponding simulation functions to improve the efficiency of application development.
  • step S330 includes:
  • Step S331 calling a preset static library entry function in the executable file, starting a preset dynamic library according to the preset static library entry function, and obtaining an entry function address corresponding to the custom application.
  • the preset static library encapsulates the system entry function and saves the entry function address corresponding to the custom application.
  • the system providing the simulation environment first calls the system entry function, provides the application entry point, runs the executable file, obtains the entry function address corresponding to the custom application in the executable file, and starts the preset dynamics.
  • the library where the default dynamic library is responsible for providing the simulation environment.
  • Step S332 obtaining an entry function corresponding to the custom application according to the entry function address, starting to execute the custom application, and reading the current application programming interface API executed by the custom application.
  • API refers to the Application Programming Interface
  • API is a predefined function that provides the ability for applications and developers to access a set of routines based on a piece of software or hardware without having to access source code, or Understand the details of the internal working mechanism.
  • the custom application is written according to the requirements of the application function, and executed according to the execution logic of the customized application. If the specific content of the function to be called to implement the application function is all written in the customization In the application, the logic may be complicated, and it is not easy to detect when the program has an error. Therefore, in order to facilitate the execution of the customized application, the function that implements a specific function is pre-stored in other files, such as stored in a preset dynamic library. In the corresponding hardware of the payment terminal, the interface function is directly written in the custom application to directly call the function to perform the corresponding function.
  • Step S333 detecting whether an interface function corresponding to the current API exists in the preset dynamic library.
  • the currently executed code is obtained, and if the currently executed code is a call interface function, the preset dynamics of compiling the link with the custom application are first detected.
  • the library can provide the corresponding simulation environment, that is, whether there is a specific function description of the interface function corresponding to the currently executed interface function in the preset dynamic library.
  • Step S334 if yes, the corresponding interface function in the preset dynamic library is called, and the simulation execution is performed according to the interface function parameter corresponding to the current API, and the execution result is obtained.
  • the preset dynamic library stores a large number of interface functions, respectively implementing different functions. If the preset dynamic library can detect the simulation environment of the function corresponding to the current API, the interface corresponding to the corresponding function in the preset dynamic library is called. Function to get the interface provided by the current API in the custom application Function parameters, execute the corresponding interface function to simulate the function of the custom application, and obtain the simulation execution result.
  • Step S335 if not present, send the interface function parameter corresponding to the current application programming interface to the payment terminal, and receive the execution result returned by the payment terminal.
  • some interface functions are related to hardware, and the corresponding functions can be performed on the corresponding hardware, and cannot be directly simulated on the simulation system.
  • the calling function parameter is packaged into a request packet and sent to the payment terminal according to a preset format, and the payment terminal has a preset format.
  • the data packet is parsed, and the corresponding interface function is executed by the payment terminal interface corresponding to the calling function received, and the execution result is obtained, and the execution result is returned to the mobile terminal where the simulation system is located according to the preset format.
  • serial communication is performed between the terminal and the payment terminal, and the serial communication between the two devices needs to follow a certain transmission and reception format to ensure that the information between the two can be correctly transmitted and parsed, and the data format for data transmission and reception is pre-established.
  • step S3366 the execution result is displayed on the simulation interface.
  • the simulation is directly performed in the simulation system or the simulation result is obtained through the payment terminal, and the simulation result is drawn, and the simulation result is displayed on the simulation interface.
  • the executable file is executed by calling a system entry function encapsulated in the preset static library, and the corresponding entry function is executed according to the entry function address corresponding to the custom application of the execution file, and the custom application is executed.
  • the calling function of the application use the simulation system to directly simulate according to the type of the calling function or perform simulation by interacting with the payment terminal, obtain the simulation result and display the simulation result on the simulation interface, support the generation of the simulation interface and provide according to the interface function.
  • the simulation function of the interface function can quickly and intuitively display the results of the custom application.
  • step S336 includes:
  • Step S336A acquiring a target device environment handle and a data cache address, calling a drawing function to operate the target device environment handle or mapping the screen initialization data to the data cache address for drawing The area is drawn to initialize the simulation interface.
  • the device environment handle refers to a DC handle, corresponding to a DC object.
  • the inside of the object is a data structure, and contains some data structures related to the driver of the DC, such as a function pointer of the driver, a hardware-related data structure, and the like.
  • the device environment refers to the corresponding hardware parameters and driver software parameters, which is an abstraction of the device hardware.
  • GDI has at least two types of DCs, such as a screen DC and a printer DC.
  • DC is a painting tool.
  • the window display requires a canvas, and the display content on the canvas requires DC.
  • XML is used in advance to describe the screen and key characteristics, and the Duilib library is automatically parsed to create a drawing area for screen and button emulation.
  • XML is an extensible markup language, a subset of the standard universal markup language, and is a markup language used to mark electronic files to be structured.
  • the XML description uses a three-level directory, the first level is the simulation window size, the second level is the window background description, and the third level is the screen and button description.
  • Duilib is a powerful interface development tool that completely separates the user interface and processing logic, greatly improving the development efficiency of the user interface.
  • the preset dynamic library obtains the target device environment handle DC and the data cache address, directly operates the DC to draw the initial simulation interface in the drawing area by calling the drawing function or maps the screen initialization data to the corresponding data cache address, and draws the initialization in the drawing area.
  • the simulation interface completes the screen initialization simulation.
  • step S336B the load data function is called to copy the target data corresponding to the execution result to the drawing area, update the initial simulation interface, and display the execution result on the simulation interface.
  • the corresponding simulation execution result is obtained, and the target data corresponding to the simulation execution result is read by calling the load data function, and the target data is copied to the drawing area device.
  • the execution result is displayed on the simulation interface.
  • the size of the corresponding parameter description screen simulation area is preset, and the screen simulation area is divided into a minimum effective area, a top area, and a bottom area, and the size of the drawing area is determined according to the corresponding screen parameter corresponding to the execution result, and if the top area is used, the screen is used.
  • the effective area is reduced downwards, The screen coordinates are shifted down to the top area pixel height; if the bottom area is used, the effective area of the screen is zoomed out, the screen coordinates are unchanged, and the bottom area pixels are reduced in height.
  • the bottom area is used as a virtual button area, and the screen size is adjusted according to the corresponding parameters.
  • the simulation screen can be divided into a touch screen and a non-touch screen, and the preset parameter value is used to determine whether the screen is a touch screen.
  • the pressure value is simulated by a mouse event to simulate a touch operation, such as clicking a screen area to change the screen area.
  • the corresponding pressure value simulates the touch operation of the screen area, and the touch screen read data function acquires the current touch screen coordinate data.
  • the screen attribute description file is defined in advance, and the corresponding interface library is associated, and the screen attribute file is parsed to obtain the target device environment handle and the data cache address, by calling the drawing function or mapping the screen initialization data to the data cache.
  • the simulation interface can be updated according to the current execution result, and the execution result is displayed on the simulation interface, and an initialization simulation interface can be established to simulate the display function of the payment terminal.
  • step S310 includes:
  • Step S310A detecting a third-party editor version, and displaying the detected third-party editor version on the display interface.
  • an XML file describing the third-party editor information is obtained, version information in the XML file is obtained, a third-party editor version is detected, and all detected third-party editor versions are displayed on the display interface.
  • the update detection function is called to acquire a third-party editor XML file in the server, and the XML file in the server is compared with the locally stored XML file, and if the version number in the XML file in the server is detected relative to the locally stored If the version number in the XML file is updated, a reminder is issued to obtain a user operation to update the third-party editor.
  • Step S310B according to an operation instruction acting on the display interface, calling a creation function to create a current application project.
  • the interface window of the simulation system display interface includes a menu bar, a toolbar, a display window, and a status bar.
  • the menu bar includes menus for runs, projects, tools, views, and more.
  • the run menu is mainly used for control of the simulation environment, setting and importing executable files
  • the project menu provides simulation model selection and compilation
  • the tool menu is used for various tool calls
  • the view menu is used to control window display.
  • toolbar Provides a quick entry.
  • the display window includes model simulation map, print simulation output, communication simulation output, magnetic card simulation output, IC card simulation output, and output information window.
  • Get the operation instruction that acts on the display interface such as clicking the run menu of the display interface, obtaining the new instruction, and calling the creation function to create the current application project.
  • Step S310C Obtain a name and a save path corresponding to the current application project, convert the data format corresponding to the current application project into a data format corresponding to the target third-party editor version, and generate a target application project.
  • the name and the save path of the current application project set by the user are obtained, and the current application project is saved according to the set save path.
  • the third-party editor that obtains the corresponding version opens the current application, where the corresponding version refers to the version corresponding to the third-party editor selected by the user in the third-party editor version displayed on the display interface to open the current application.
  • the third-party editor of one version creates the current application project
  • use another version of the third-party editor to open the current application project call the conversion function, and obtain the name and storage path of the current application project, according to the current
  • the name and storage path of the application project are used to obtain the corresponding current application project
  • the third-party editor of the target version is obtained, and the data storage format corresponding to the target version third-party editor is read, and the data format of the current application project is converted into the target version third party.
  • the data storage format corresponding to the editor generates a corresponding target application project.
  • the third-party editor of the target version can be any version of the same third-party editor.
  • step S310D the target application project is opened by using a third-party editor corresponding to the target third-party editor version.
  • the target version of the third-party editor obtains the target application project, opens the target application process through the user operation instruction, and performs subsequent compilation and simulation operations.
  • a conversion function between each third-party editor is provided, and the same application project can be opened by using different versions of third-party editors, which improves system compatibility and simplifies the operation of the simulation system.
  • the payment terminal application simulation method further includes:
  • Step S340 when it is detected that the simulation result corresponding to the custom application reaches the preset requirement, the pre-integrated compiler is called to parse the custom application directory structure, and the corresponding script file is automatically generated.
  • a compiler is integrated in the simulation system in advance, such as a GCC compiler, and when the third-party editor debugs and modifies the customized application according to the simulation result, the simulation result of the application function of the payment terminal corresponding to the customized application reaches a pre-preparation.
  • the pre-integrated compiler is called to automatically parse the directory structure of the custom application.
  • the Rebuild command compile the modified code in the custom application to generate the corresponding makefile or Rebuild All command to recompile. Customize the application All code generates the corresponding makefile, which is a script file.
  • Step S350 compiling the script file to generate a payment terminal object file, and downloading to the payment terminal.
  • the compiled source code corresponding to the pre-integrated compiler is invoked, the makefile is compiled to generate a target binary file corresponding to the payment terminal, and the compiled target binary file is downloaded to the payment terminal, so that the payment terminal implements the corresponding function.
  • the entire compilation link process is displayed on the simulation interface using pipeline read mode, showing errors, warnings, or other compilation information that occurs during compilation.
  • the pre-stored compiler can automatically compile and compile the custom application that meets the preset requirements into the target binary file corresponding to the payment terminal, which simplifies the compiling operation process and reduces the operation complexity.
  • the payment terminal application emulation method further includes: when the third-party editor version update is detected, sending a corresponding update reminder notification; updating the third-party editor version to the latest version according to the update reminder notification.
  • the third-party editor version can be updated according to system update requirements or operational requirements. Compare the currently stored third-party editor version information with the third-party editor version information in the server to determine whether there is an update in the third-party editor version. If there is a third-party editor version not available locally in the server, determine the third party. The editor has an update, and a corresponding notification is issued to store the latest version of the third-party editor locally.
  • the third-party editor version is updated in real time, which can meet the requirements of various system versions in time, and improve the compatibility and operation convenience of the simulation system.
  • a payment terminal application simulation method including the following contents:
  • step S401 when it is detected that the VS version has an update, a reminder notification is issued to update the VS version.
  • VS Microsoft Visual Studio, Microsoft's development kit series products.
  • VS is a basic and complete set of development tools that includes most of the tools needed throughout the software lifecycle.
  • Step S402 after the update is completed, the currently existing VS version is detected and displayed on the simulation system display interface.
  • Step S403 Acquire a pre-selected current VS version to open a corresponding current application project.
  • any one of the VS versions existing in the current Windows system is selected to open the application project.
  • the application project can be an application project that has been created and saved, or a new application project. Further, application engineering or deletion of application engineering can be added as needed.
  • Step S404 obtaining the target version VS, and converting the current application project into an application project that can be opened in the target version VS.
  • the conversion function between the VS versions can be supported. After the application project is opened in a VS version or saved using a VS version, the other VS versions can be opened again. For example, if the current application project is in the application project file corresponding to the VS2003 version, when the application project is opened by using the VS2007 version, the name and storage path corresponding to the application project are obtained, and the data storage format of the application project is converted into the VS2007 version by using the conversion function. Open the data format, save the converted application project to the application project file corresponding to the VS2007 version, and open the application project using VS2007.
  • Step S405 acquiring a custom application in the application project, converting the custom application into a binary file, and compiling the binary file with the Entry module and the Windows dynamic library. Become an executable file.
  • Entry is a static library that encapsulates the WinMain function.
  • the WinMain function is the default entry function for the Windows platform application.
  • the custom application is a C language program.
  • the entry function is the main function, and the custom application is passed. Converting to a binary file and compiling with a static library can turn the custom application's entry function into a WinMain function, thus launching the windows platform application entry mechanism.
  • the windows dynamic library refers to the PayProCore module, which is activated by the Entry module and takes over the windows message loop, and can provide interface interaction functions and simulation functions.
  • the binary file corresponding to the custom application is compiled with the Entry module and the PayProCore module to generate an executable file.
  • step S406 the executable file is executed, and the custom application interface function is called to determine whether the simulation can be directly performed. If yes, step S407 is performed, and if no, step S408 is performed.
  • the main function address of the custom application is obtained, the main function is called, the PayProCore module is started, and the custom application is executed.
  • the custom application includes multiple interface functions, and the PayProCore module stores multiple interface functions, due to PayProCore.
  • the module is a dynamic library in the windows platform. For some hardware modules, it is not possible to directly simulate in the windows platform. For example, the RF module does not provide a corresponding simulation environment because there is no hardware corresponding to the RF module in the windows. Whether the windows platform can directly simulate according to the called interface function, if yes, execute step S407, and if no, execute step S408.
  • step S407 the simulation is directly performed on the windows platform, and the simulation result is output.
  • the corresponding interface function in the PayProCore module is called, and the corresponding function is directly simulated on the windows platform, and the simulation result is output. Further, before the simulation, the PayProCore module calls the correlation function to initialize the simulation environment and release the simulation resources to provide an environment for subsequent simulation.
  • Step S408 sending a simulation command to the POS terminal to obtain a simulation result returned by the POS terminal.
  • the interface function called is obtained, and the interface function is sent to the POS according to the data format as shown in FIG. Terminal, where A1 is the overall transmission format, B1 is the detailed format of the data content in A1, and C1 is the detailed format of each parameter in B1.
  • the POS terminal receives the invoked interface function.
  • the PayProCore module uses the _declspec form to export the vendor-defined POS API function.
  • the POS API function refers to the interface function of the POS terminal.
  • the POS terminal invokes the corresponding POS API function according to the interface function, simulates the function, and returns the simulation result to the mobile terminal where the windows platform is located according to the data format as shown in FIG. 11, where A2 is the overall transmission format, and B2 is The detailed format of the data content corresponding to the execution result in A2, and C2 is the detailed format of each parameter in B2.
  • step S409 the simulation result is displayed on the simulation interface.
  • MFC Microsoft Foundation Classes
  • the direct UI interface library refers to drawing directly on the parent window (Paint on parent dc directly).
  • the child window is not created in the form of a window handle (windowless), but a logical window, drawn on top of the parent window.
  • the duilib library is the first open source library in China. It is a powerful interface development tool that can completely separate the user interface and processing logic, greatly improving the development efficiency of the user interface.
  • the XML description uses a three-level directory, the first level is the simulation window size, the second level is the window background description, and the third level is the screen and button description.
  • Use different control description screens and buttons, and set attribute descriptions respectively describe the size of screens and buttons, and corresponding attributes, such as describing black and white screen or color screen attributes, describing whether the parameters of the touch screen are attribute parameters, and attribute parameters describing the effective area of the screen.
  • the screen initialization attribute parameters, etc. describe whether the button is a property parameter of the virtual button.
  • the simulation interface displays the simulation result
  • the simulation interface is initialized, the duilib library is called to parse the screen attribute parameter, the corresponding drawing area is created, and the drawing area size is determined, and the simulation result is obtained after initialization.
  • Data update initialization simulation The interface is displayed.
  • step S410 the pre-stored compiler is called to compile the executable file whose simulation result meets the preset condition into the target binary file corresponding to the POS terminal, and download it to the POS terminal.
  • the GCC compiler is integrated in the PayProCore module to obtain an executable file, and the executable file is compiled into a target binary file corresponding to the POS terminal, and downloaded to the POS terminal to implement an application function corresponding to the POS terminal.
  • the application corresponding to the POS terminal is converted into an executable file executable on the windows platform, and the simulation is performed by using the windows interface.
  • the simulation results are displayed in the simulation interface, the custom application can be debugged according to the simulation result in real time, according to the pre-integrated after the debugging is completed.
  • the compiler can directly generate the target program that the POS terminal can execute, which simplifies the debugging and compiling process of the POS terminal application function program, and improves the efficiency of application development.
  • the application also provides a mobile terminal.
  • the internal structure of the mobile terminal may correspond to the structure as shown in FIG. 2, and each of the following modules may be implemented in whole or in part by software, hardware, or a combination thereof.
  • the mobile terminal includes:
  • the application engineering obtaining module 1210 is configured to detect a third-party editor version, and use a corresponding third-party editor to open a corresponding application project according to the pre-selected third-party editor version.
  • the executable file generating module 1220 is configured to obtain a custom application in the application project, compile the custom application by using a third-party editor, and link the custom application with the preset static library and the preset dynamic library to generate an executable file. .
  • the simulation module 1230 is configured to execute an executable file and simulate the function of the custom application.
  • the simulation module 1230 includes:
  • the calling module 1230A is configured to invoke a preset static library entry function in the executable file, start a preset dynamic library according to a preset static library entry function, and obtain an entry letter corresponding to the customized application. Number address.
  • the API obtaining module 1230B is configured to obtain an entry function corresponding to the custom application according to the entry function address, start executing the custom application, and read the current application programming interface API executed by the custom application.
  • the detecting module 1230C is configured to detect whether an interface function corresponding to the current API exists in the preset dynamic library.
  • the simulation execution module 1230D is configured to, if present, invoke a corresponding interface function in the preset dynamic library, perform simulation execution according to the interface function parameter corresponding to the current API, and obtain an execution result.
  • the interaction execution module 1230E is configured to: if not present, send the interface function parameter corresponding to the current application programming interface to the payment terminal, and receive the execution result returned by the payment terminal.
  • the display module 1230F is configured to display an execution result on the simulation interface.
  • the display module 1230F further includes:
  • the initialization simulation interface establishing module 1231 is configured to acquire a target device environment handle and a data cache address, invoke a drawing function to operate the target device environment handle, or map the screen initialization data to the data cache address to draw an initialization simulation interface in the drawing area.
  • the update module 1232 is configured to call the load data function to copy the target data corresponding to the execution result to the drawing area, update the initialization simulation interface, and display the execution result on the simulation interface.
  • the application engineering acquisition module 1210 includes:
  • the editor detection module 1210A is configured to detect a third-party editor version, and display the detected third-party editor version on the display interface.
  • the creating module 1210B is configured to invoke a creation function to create a current application project according to an operation instruction applied to the display interface.
  • the application engineering generating module 1210C is configured to obtain a name and a saving path corresponding to the current application project, convert the data format corresponding to the current application project into a data format corresponding to the target third-party editor version, generate a target application project, and edit with the target third party.
  • the third-party editor corresponding to the version of the device opens the target application project.
  • the foregoing mobile terminal further includes:
  • the compiling and downloading module 1240 is configured to parse the custom source code directory structure, automatically generate a corresponding script file, and execute a pre-integrated compiler to compile the script file when detecting that the simulation result corresponding to the custom application reaches the preset requirement. Pay the terminal object file and download it to the payment terminal.
  • a mobile terminal comprising a memory and a processor, the memory storing computer readable instructions, when the computer readable instructions are executed by the processor, causing the processor to perform the step of: detecting a third party editor version Use the corresponding third-party editor to open the corresponding application project according to the pre-selected third-party editor version; obtain the custom application in the application project, compile the custom application using the third-party editor; and customize the application with Pre-set static libraries and preset dynamic library links to generate executable files; and execute executable files to simulate the functions of custom applications.
  • the processor when the computer readable instructions are executed by the processor, the processor further causes the processor to perform the steps of: calling a preset static library entry function in the executable file; and starting the preset dynamic library according to the preset static library entry function, And obtain the entry function address corresponding to the custom application; obtain the entry function corresponding to the custom application according to the entry function address, start executing the custom application, and read the current application programming interface API executed by the custom application; Whether there is an interface function corresponding to the current API in the dynamic library; if yes, the corresponding interface function in the preset dynamic library is called, and the simulation execution is performed according to the interface function parameter corresponding to the current API, and the execution result is obtained; and the execution result is displayed. On the simulation interface.
  • the processor when the computer readable instructions are executed by the processor, the processor further causes the processor to perform the following steps: if it is detected that the interface function corresponding to the current API does not exist in the preset dynamic library, the current application programming interface is correspondingly The interface function parameter is sent to the payment terminal; and the execution result returned by the payment terminal is received, and the execution result is displayed on the simulation interface.
  • the processor when the computer readable instructions are executed by the processor, the processor further causes the processor to: acquire the target device context handle and the data cache address; invoke the draw function to operate the target device context handle or map the screen initialization data to the data Cache address to draw the initial simulation interface in the drawing area; and call the load data function to copy the target data corresponding to the execution result to On the drawing area, the initialization simulation interface is updated, and the execution result is displayed on the simulation interface.
  • the processor when the computer readable instructions are executed by the processor, the processor further causes the processor to perform the steps of: detecting a third party editor version, displaying the detected third party editor version on the display interface; Operation instruction, calling the creation function to create the current application project; obtaining the name and save path corresponding to the current application project, converting the data format corresponding to the current application project to the data format corresponding to the target third-party editor version, generating the target application project; The third-party editor corresponding to the target third-party editor version opens the target application project.
  • the processor when the computer readable instructions are executed by the processor, the processor further causes the processor to perform the step of: calling a pre-integrated compiler to parse the custom when it is detected that the simulation result corresponding to the custom application reaches a preset requirement
  • the application directory structure automatically generates a corresponding script file; and compiles the script file to generate a payment terminal object file, and downloads it to the payment terminal.
  • the processor when the computer readable instructions are executed by the processor, the processor is further caused to perform the steps of: transmitting a corresponding update reminder notification when a third party editor version update is detected; and updating the third party based on the update reminder notification
  • the editor version is the latest version.
  • one or more computer readable non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the following Step: Detect the third-party editor version, use the corresponding third-party editor to open the corresponding application project according to the pre-selected third-party editor version; obtain the custom application in the application project, compile the custom application using the third-party editor a program; linking a custom application with a preset static library and a preset dynamic library to generate an executable file; and executing an executable file to simulate the function of the custom application.
  • the one or more processors when the computer readable instructions are executed by one or more processors, the one or more processors are further caused to perform the steps of: calling a preset static library entry function in the executable file; The entry function starts the preset dynamic library, and obtains the entry function address corresponding to the custom application; obtains the entry function corresponding to the custom application according to the entry function address, starts executing the custom application, and reads the current execution of the custom application.
  • An application programming interface API detecting whether an interface function corresponding to the current API exists in the preset dynamic library; if present, Calling the corresponding interface function in the preset dynamic library, performing simulation execution according to the interface function parameters corresponding to the current API, and obtaining the execution result; and displaying the execution result on the simulation interface.
  • the one or more processors when the computer readable instructions are executed by one or more processors, the one or more processors further perform the step of: if it is detected that an interface function corresponding to the current API does not exist in the preset dynamic library, Then, the interface function parameter corresponding to the current application programming interface is sent to the payment terminal; and the execution result returned by the payment terminal is received, and the execution result is displayed on the simulation interface.
  • the one or more processors when the computer readable instructions are executed by one or more processors, are further caused to: obtain a target device environment handle and a data cache address; invoke a draw function to operate the target device context handle Or map the screen initialization data to the data cache address to draw the initial simulation interface in the drawing area; and call the load data function to copy the target data corresponding to the execution result to the drawing area, update the initial simulation interface, and display the execution result in the simulation interface.
  • the one or more processors when the computer readable instructions are executed by one or more processors, the one or more processors further cause the step of: detecting a third party editor version, displaying the detected third party editor on the display interface Version; according to the operation instruction acting on the display interface, the creation function is called to create the current application project; the name and the save path corresponding to the current application project are obtained, and the data format corresponding to the current application project is converted into the data format corresponding to the target third-party editor version. , generating the target application project; and opening the target application project using a third-party editor corresponding to the target third-party editor version.
  • the one or more processors when the computer readable instructions are executed by one or more processors, the one or more processors further cause the step of: calling when the simulation result corresponding to the custom application reaches a preset requirement
  • the pre-integrated compiler parses the custom application directory structure, automatically generates the corresponding script file; and compiles the script file to generate the payment terminal object file, and downloads it to the payment terminal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

一种支付终端(120)应用仿真方法,检测第三方编辑器版本,根据预先选择的第三方编辑器版本打开对应的应用工程(S310),获取应用工程中的自定义应用程序,使用第三方编辑器编译自定义应用程序,将自定义应用程序与预设静态库及预设动态库链接生成可执行文件(S320),执行可执行文件,对自定义应用程序的功能进行仿真(S330)。

Description

支付终端应用仿真方法、移动终端和可读存储介质
本申请要求于2017年04月07日提交中国专利局,申请号为201710225700.4,发明名称为“支付终端应用仿真方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及嵌入式技术领域,特别是涉及一种支付终端应用仿真方法、移动终端和可读存储介质。
背景技术
POS(Point Of Sale,支付终端)终端是一种嵌入式设备,在出厂时一般装载了厂商提供的固件,需要根据厂商提供的POS应用接口并根据实际业务开发流程开发出各类应用程序并装载到POS终端中,POS才能对外提供相关业务功能。现有的POS应用程序开发方案需要开发人员自行建立应用工程、编码并使用交叉编译工具将代码编译成目标代码,最后将目标代码下载到POS终端中查看运行效果是否与设计符合,如果在POS终端中观察、验证有误,需要重新修改代码、编译、下载、观察验证,直至达到设计要求,开发人员无法实时调试应用程序,应用开发的效率低下。
发明内容
根据本申请的各种实施例,提供一种支付终端应用程序仿真方法、移动终端和可读存储介质。
一种支付终端应用仿真方法,所述方法包括:
检测第三方编辑器版本,根据预先选择的第三方编辑器版本使用对应的第三方编辑器打开对应的应用工程;
获取所述应用工程中的自定义应用程序,使用第三方编辑器编译所述自定义应用程序;
将所述自定义应用程序与预设静态库及预设动态库链接生成可执行文件;及
执行所述可执行文件,对所述自定义应用程序的功能进行仿真。
一种移动终端,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行以下步骤:
检测第三方编辑器版本,根据预先选择的第三方编辑器版本使用对应的第三方编辑器打开对应的应用工程;
获取所述应用工程中的自定义应用程序,使用第三方编辑器编译所述自定义应用程序;
将所述自定义应用程序与预设静态库及预设动态库链接生成可执行文件;及
执行所述可执行文件,对所述自定义应用程序的功能进行仿真。
一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
检测第三方编辑器版本,根据预先选择的第三方编辑器版本使用对应的第三方编辑器打开对应的应用工程;
获取所述应用工程中的自定义应用程序,使用第三方编辑器编译所述自定义应用程序;
将所述自定义应用程序与预设静态库及预设动态库链接生成可执行文件;及
执行所述可执行文件,对所述自定义应用程序的功能进行仿真。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为一个实施例中支付终端应用仿真方法的硬件环境图;
图2为一个实施例中移动终端的内部结构图;
图3为一个实施例中支付终端应用仿真方法的流程图;
图4为一个实施例中可执行文件API仿真方法的流程图;
图5为一个实施例中显示仿真结果的显示方法的流程图;
图6为一个实施例中支付终端应用仿真方法的流程图;
图7为另一个实施例中支付终端应用仿真方法的流程图;
图8为一个具体实施例中支付终端应用仿真方法的流程图;
图9为一个实施例中生成可执行文件的流程示意图;
图10为一个实施例中发送数据格式的示意图;
图11为一个实施例中接收数据格式的示意图;
图12为一个实施例中移动终端的结构框图;
图13为一个实施例中仿真模块的结构框图;
图14为一个实施例中显示模块的结构框图;
图15为一个实施例中应用工程获取模块的结构框图;
图16为另一个实施例中移动终端的结构框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。图1为一个实施例中支付终端应用仿真方法的硬件环境图。参照图1,该硬件环境包括移动终端110与支付终端120之间进行串口通信,移动终端110提供支付终端应用仿真环境对支付终端应用程序进行仿真,当移动终端110无法提供相应的仿真硬件时,移动终端110将对应的接口函数参数发送至支付终端120,支付终端120根据接收的接口函数参数调用对应的接口函数进行仿真,将仿真结果返回至移动终端110,在移动终端110中的仿真界面进行显示。
图2为一个实施例中移动终端的内部结构图。如图2所示,该移动终端包括通过系统总线连接的处理器、非易失性存储介质、内存储器、串行接口、显示屏和输入装置。其中,终端的非易失性存储介质存储有操作系统和计算机可读指令。该处理器用于提供计算和控制能力,支撑整个移动终端的运行。该计算机可读指令被所述处理器执行时,可使得所述处理器执行一种支付终端应用仿真方法。串行接口用于与支付终端进行串口通信,如发送接口函数至支付终端,接收用于支付终端返回的执行结果等。移动终端的显示屏可以是液晶显示屏或者电子墨水显示屏等,输入装置可以是显示屏上覆盖的触摸层,也可以是终端外壳上设置的按键、轨迹球或触控板,也可以是外接的键盘、触控板或鼠标等。本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的终端的限定,具体的终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
如图3所示,在一个实施例中,提供一种支付终端应用仿真方法,包括如下内容:
步骤S310,检测第三方编辑器版本,根据预先选择的第三方编辑器版本使用对应的第三方编辑器打开对应的应用工程。
其中,第三方编辑器版本是指仿真系统之外的编辑器对应的版本,仿真 系统与第三方编辑器自动建立连接,当在移动终端中开启仿真系统时,自动关联第三方编辑器,并检测第三方编辑器的版本。仿真系统是指安装在移动终端中用于对支付终端功能进行仿真的系统,在仿真系统显示界面显示检测到的编辑器版本,接收用户选择指令,获取用户选取的第三方编辑器版本,使用该版本的第三方编辑器打开对应的应用工程。
具体地,可以利用仿真系统打开已有应用工程、新建应用工程、添加应用工程或删除应用工程。如果需要新建应用工程,则在使用选择的第三方编辑器打开应用工程之前,建立新的应用工程并编辑该应用工程的名称、路径和描述,保存后使用对应的第三方编辑器打开对应的应用工程。如果直接打开应用工程,则在已经存在的应用工程列表中选择一个应用工程,使用对应的第三方编辑器打开选择的应用工程。
步骤S320,获取应用工程中的自定义应用程序,使用第三方编辑器编译自定义应用程序,将自定义应用程序与预设静态库及预设动态库链接生成可执行文件。
其中,自定义应用程序是指开发人员根据需要实现的支付终端的应用功能在应用工程编辑界面编写的对应代码,编写代码的语言为支付终端对应的编程语言,如C语言程序,对应的入口函数为main函数,而为了实现对自定义应用程序的仿真需要提供应用界面用于输出信息并显示仿真信息,便于查看,因此自定义应用程序需要在能够提供仿真界面的环境中运行。
具体地,预设静态库中存储了系统入口函数,通过系统入口函数能够进入到系统仿真开发平台,预设动态库中存储了大量的接口函数,用来实现自定义应用程序的仿真功能和界面交互功能。为了提供自定义应用程序对应的仿真环境,需要将自定义应用程序的入口函数转接到提供仿真环境的系统的入口函数上,以使自定义应用程序能够在提供仿真环境的系统中运行,在运行过程中调用预设动态库中的接口函数,对相应功能进行仿真,因此需要将自定义应用程序与预设静态库以及预设动态库相关联。通过第三方编辑器对自定义应用程序进行编译,通过编译的链接过程将自定义应用程序对应的二 进制文件和预设静态库以及预设动态库编译成能够在第三方编辑器对应的系统执行的文件。其中入口函数是指应用程序最开始运行时调用的函数,程序后续的所有操作都在入口函数下被调用或间接被调用。
步骤S330,执行可执行文件,对自定义应用程序的功能进行仿真。
具体地,当根据自定义应用程序和预设静态库以及预设动态库链接生成对应的可执行文件后,执行该可执行文件。其中,在预设静态库中封装一个系统入口函数,该系统入口函数为提供各种界面的系统对应的入口函数,执行可执行文件首先执行系统入口函数进入系统仿真平台,并同时启动预设动态库。进一步地,预设静态库中保存了自定义应用程序对应的入口函数地址,当执行系统入口函数进入系统仿真平台后,根据自定义应用程序对应的入口函数地址获取自定义应用程序对应的入口函数,调用该入口函数执行自定义应用程序,并根据自定义应用程序中编写的应用程序调用预设动态库中的接口函数,对相应功能进行仿真。
本实施例中,通过与第三方编辑器建立关联,使开发人员能够借助第三方编辑器建立应用工程,编写支付终端应用功能对应的应用程序,能够帮助开发人员快速创建应用程序框架。使用第三方编辑器进行编译使自定义应用程序与预设静态库以及预设动态库链接生成可执行文件,从而使自定义应用程序能够在第三方编辑器对应的系统下执行,借助第三方系统提供对应的仿真环境,并执行相应的仿真功能,提高了应用开发的效率。
如图4所示,在一个实施例中,步骤S330包括:
步骤S331,调用可执行文件中的预设静态库入口函数,根据预设静态库入口函数启动预设动态库,并获取自定义应用程序对应的入口函数地址。
具体地,预设静态库中封装了系统入口函数,并保存了自定义应用程序对应的入口函数地址。当开始运行可执行文件时,提供仿真环境的系统首先调用系统入口函数,提供应用程序入口点,运行可执行文件,获取可执行文件中自定义应用程序对应的入口函数地址,并启动预设动态库,其中预设动态库负责提供仿真环境。
步骤S332,根据入口函数地址获取自定义应用程序对应的入口函数,开始执行自定义应用程序,读取自定义应用程序执行的当前应用程序编程接口API。
具体地,当调用系统入口函数为应用程序提供入口后,根据获取的自定义应用程序对应的入口函数地址调用对应的入口函数,开始执行自定义应用程序,自定义应用程序中定义了实现不同功能的应用程序编程接口API,其中API是指Application Programming Interface,是一些预先定义的函数,能够提供应用程序与开发人员基于某软件或硬件得以访问一组例程的能力,而又无需访问源码,或理解内部工作机制的细节。
进一步地,为了实现支付终端的应用功能,根据应用功能的需求编写自定义应用程序,按照自定义应用程序的执行逻辑依次执行,如果将实现应用功能需要调用的函数的具体内容全部写在自定义应用程序中,可能造成逻辑复杂,当程序出现错误时不易检测,因此,为了便于自定义应用程序的执行,将实现某个具体功能的函数预先存储在其他文件中,如存储在预设动态库中或支付终端的相应硬件中,在自定义应用程序中编写接口函数直接调用该函数,执行相应的功能。
步骤S333,检测预设动态库中是否存在与当前API对应的接口函数。
具体地,按照自定义应用程序的执行逻辑依次执行自定义应用程序的过程中,获取当前执行的代码,若当前执行的代码为调用接口函数,首先检测与自定义应用程序编译链接的预设动态库是否能够提供对应的仿真环境,也就是预设动态库中是否存在与当前执行的接口函数对应的接口函数的具体功能描述。
步骤S334,若存在,则调用预设动态库中对应的接口函数,根据当前API对应的接口函数参数进行仿真执行,得到执行结果。
具体地,预设动态库中存储了大量的接口函数,分别实现不同的功能,若检测到预设动态库能够提供当前API对应的功能的仿真环境,则调用预设动态库中对应功能的接口函数,获取自定义应用程序中当前API提供的接口 函数参数,执行对应的接口函数对自定义应用程序的功能进行仿真,获取仿真执行结果。
步骤S335,若不存在,则将当前应用程序编程接口对应的接口函数参数发送至支付终端,接收支付终端返回的执行结果。
具体地,有些接口函数与硬件相关,在相应的硬件上才能执行相应功能,不能直接在仿真系统上进行仿真。当自定义应用程序执行的当前代码调用的接口函数对应的功能无法在仿真系统上直接仿真,则将该调用函数参数按照预设格式打包成请求包发送至支付终端,支付终端对预设格式的数据包进行解析,并获取调用与接收的调用函数想对应的支付终端接口执行相应接口函数,获取执行结果,并将执行结果按照预设格式返回至仿真系统所在的移动终端。
进一步地,终端与支付终端之间进行串口通讯,两台机器之间的串口通讯需要遵循一定的收发格式,以保证两者之间的信息能够正确传递和解析,预先制定数据收发的数据格式。
步骤S336,将执行结果显示在仿真界面上。
具体地,在仿真系统中直接进行仿真或者通过支付终端进行交互仿真获取对应的仿真结果,绘制仿真界面,将仿真结果在仿真界面上显示。
本实施例中,通过调用预设静态库中封装的系统入口函数,执行可执行文件,并根据执行文件的自定义应用程序对应的入口函数地址获取对应的入口函数执行自定义应用程序,获取自定义应用程序的调用函数,根据调用函数的类型使用仿真系统直接进行仿真或通过与支付终端进行交互进行仿真,获取仿真结果并将仿真结果显示在仿真界面上,支持生成仿真界面并且根据接口函数提供接口函数的仿真功能,能够快速直观的展示自定义应用程序运行结果。
如图5所示,在一个实施例中,步骤S336包括:
步骤S336A,获取目标设备环境句柄和数据缓存地址,调用绘制函数操作目标设备环境句柄或将屏幕初始化数据映射到数据缓存地址上,以在绘图 区域绘制初始化仿真界面。
其中,设备环境句柄是指DC句柄,对应一个DC对象,对象内部是一个数据结构,包含该DC的驱动程序相关的一些数据结构,比如驱动的函数指针,硬件相关的数据结构等等。设备环境指的是对应的硬件参数和驱动程序软件参数,是对设备硬件的一种抽象。比如GDI有屏幕DC和打印机DC等至少两种DC,DC是一种绘画工具,窗口显示需要一个画布,在画布上显示内容需要DC。
具体地,预先使用XML文件描述屏幕和按键特性,使用Duilib库自动解析,创建绘图区域进行屏幕和按键仿真。其中XML是指可扩展标记语言,标准通用标记语言的子集,是一种用于标记电子文件使其具有结构性的标记语言。XML描述采用三级目录,第一级是仿真窗口大小,第二级是窗口背景描述,第三级是屏幕和按键描述。Duilib是一款强大的界面开发工具,可以将用户界面和处理逻辑彻底分离,极大地提高用户界面的开发效率。
在初始化屏幕绘图区时,利用Duilib库中的DuiSim文件获取屏幕对应的控件属性并设置屏幕数据结构参数,调用Create Compatible DC创建DC,并根据宽和高度,调用Create DIB Section生成绘图区域并绑定DC,预设动态库获取目标设备环境句柄DC和数据缓存地址,通过调用绘制函数直接操作DC在绘图区域绘制初始化仿真界面或者将屏幕初始化数据映射到对应的数据缓存地址中,在绘图区域绘制初始化仿真界面,完成屏幕初始化仿真。
步骤S336B,调用加载数据函数将执行结果对应的目标数据复制到绘图区域上,更新初始化仿真界面,在仿真界面显示执行结果。
具体地,当根据自定义应用程序的接口函数对相应功能进行仿真后,获取对应的仿真执行结果,通过调用加载数据函数读取仿真执行结果对应的目标数据,将目标数据复制到绘图区域设备上,在仿真界面显示执行结果。
进一步地,预先设置对应参数描述屏幕仿真区域的大小,将屏幕仿真区域划分为最小有效区域、顶部区域和底部区域,根据执行结果对应的相应屏幕参数确定绘图区域的大小,如果使用顶部区域则屏幕有效区域向下缩小, 屏幕坐标向下平移顶部区域像素高度;如果使用底部区域,则屏幕有效区域向上缩小,屏幕坐标不变,高度缩小底部区域像素。例如仿真界面存在虚拟按键,则将底部区域作为虚拟按键区域,屏幕大小根据相应参数进行调节。
特别地,仿真屏幕可以分为触摸屏和非触摸屏,使用预设参数值判断屏幕是否为触摸屏,当屏幕为触摸屏时,通过鼠标事件设置压力值仿真触摸操作,如点击屏幕区域,改变该处屏幕区域对应的压力值仿真该屏幕区域的触摸操作,通过触摸屏读取数据函数获取当前触摸屏坐标数据。
本实施例中,预先定义屏幕属性描述文件,并关联对应的界面库,对屏幕属性文件进行解析能够获取到目标设备环境句柄和数据缓存地址,通过调用绘制函数或者将屏幕初始化数据映射到数据缓存地址上,并能够根据当前执行结果更新仿真界面,在仿真界面对执行结果进行显示,能够建立初始化仿真界面,对支付终端的显示功能进行仿真。
如图6所示,在一个实施例中,步骤S310包括:
步骤S310A,检测第三方编辑器版本,在显示界面显示检测到的第三方编辑器版本。
具体地,获取描述第三方编辑器信息的XML文件,获取XML文件中的版本信息,检测第三方编辑器版本,在显示界面显示所有检测到的第三方编辑器的版本。特别地,调用更新检测函数获取服务器中的第三方编辑器XML文件,将服务器中的XML文件与本地存储的XML文件相比较,若检测到服务器中的XML文件中的版本号相对于本地存储的XML文件中的版本号有更新,则发出提醒,获取用户操作对第三方编辑器进行更新。
步骤S310B,根据作用于显示界面的操作指令,调用创建函数创建当前应用工程。
具体地,在仿真系统显示界面的界面窗口包括菜单栏、工具栏、显示窗口及状态栏。菜单栏中包括运行、项目、工具、视图等菜单。运行菜单主要用于仿真环境的控制,设置和导入可执行文件,项目菜单提供仿真机型选择和编译,工具菜单用于各种工具调用,视图菜单用于控制窗口显示。工具栏 提供快捷入口,显示窗口包括机型仿真图、打印仿真输出、通讯仿真输出、磁卡仿真输出、IC卡仿真输出以及输出信息窗口。
获取作用于显示界面的操作指令,如点击显示界面的运行菜单,获取新建指令,调用创建函数创建当前应用工程。
步骤S310C,获取当前应用工程对应的名称和保存路径,将当前应用工程对应的数据格式转换为目标第三方编辑器版本对应的数据格式,生成目标应用工程。
具体地,在创建当前应用工程的过程中获取用户设置的当前应用工程的名称与保存路径,按照设置的保存路径保存当前应用工程。获取对应版本的第三方编辑器打开当前应用程序,其中对应版本是指用户在显示界面显示的第三方编辑器版本中选择的用来打开当前应用程序的第三方编辑器对应的版本。
进一步地,当在其中一个版本的第三方编辑器创建了当前应用工程后,使用另一个版本的第三方编辑器打开当前应用工程,调用转换函数,获取当前应用工程的名称和存储路径,根据当前应用工程的名称和存储路径获取对应的当前应用工程,同时获取目标版本第三方编辑器,读取目标版本第三方编辑器对应的数据存储格式,将当前应用工程的数据格式转换为目标版本第三方编辑器对应的数据存储格式,生成对应的目标应用工程。其中目标版本的第三方编辑器可以是相同第三方编辑器的任何版本。
步骤S310D,使用目标第三方编辑器版本对应的第三方编辑器打开目标应用工程。
具体地,目标版本的第三方编辑器获取目标应用工程,通过用户操作指令打开目标应用过程,并进行后续编译仿真操作。
本实施例中,提供各个第三方编辑器之间的转换功能,能够使用不同版本的第三方编辑器打开相同的应用工程,提高了系统的兼容性,简化了仿真系统的操作。
如图7所示,在一个实施例中,支付终端应用仿真方法还包括:
步骤S340,当检测到自定义应用程序对应的仿真结果达到预设要求时,调用预先集成的编译器解析自定义应用程序目录结构,自动生成对应的脚本文件。
具体地,预先在仿真系统中集成编译器,如GCC编译器,当在第三方编辑器中根据仿真结果调试修改自定义应用程序,使自定义应用程序对应的支付终端的应用功能仿真结果达到预设要求时,调用预先集成的编译器,自动解析自定义应用程序的目录结构,通过执行Rebuild命令对自定义应用程序中的修改过的代码进行编译链接生成对应的makefile文件或Rebuild All命令重新编译自定义应用程序所有代码生成对应的makefile文件,makefile文件是一种脚本文件。
步骤S350,将脚本文件编译生成支付终端目标文件,并下载至支付终端。
具体地,调用预先集成的编译器对应的编译源代码,对makefile文件进行编译生成支付终端对应的目标二进制文件,将编译后的目标二进制文件下载至支付终端,使支付终端实现相应功能。整个编译链接过程使用管道读取的方式显示在仿真界面上,显示编译过程中出现的错误、警告或其他编译信息。
本实施例中,预先存储的编译器能够自动将仿真符合预设要求的自定义应用程序编译链接成支付终端对应的目标二进制文件,简化了编译操作过程,降低了操作复杂度。
在一个实施例中,支付终端应用仿真方法还包括:当检测到第三方编辑器版本更新时,发送对应的更新提醒通知;根据更新提醒通知更新第三方编辑器版本为最新版本。
具体地,第三方编辑器版本可以根据系统更新要求或者操作需求,进行版本更新。将当前本地存储的第三方编辑器版本信息与服务器中的第三方编辑器版本信息比较,确定第三方编辑器版本是否存在更新,如服务器中存在本地没有的第三方编辑器版本,则确定第三方编辑器存在更新,发出对应的通知,将最新版本的第三方编辑器存储至本地。
本实施例中,实时更新第三方编辑器版本,能够及时满足各种系统版本的要求,提升仿真系统的兼容性和操作便利性。
如图8所示,在一个具体实施例中,以在windows系统下,使用VS编辑器为例,提供一种支付终端应用仿真方法,包括以下内容:
步骤S401,当检测到VS版本有更新时,发出提醒通知更新VS版本。
其中,VS(Microsoft Visual Studio,美国微软公司的开发工具包系列产品)。VS是一个基本完整的开发工具集,它包括了整个软件生命周期中所需要的大部分工具。通过比较本地XML文件中的版本信息和服务器XML文件中的版本检测是否有VS版本更新,当有VS版本更新时,发出提醒,获取对应的更新指令使用更新模块更新VS版本。
步骤S402,更新完成后,检测当前存在的VS版本并显示在仿真系统显示界面。
步骤S403,获取预先选择的当前VS版本打开对应的当前应用工程。
具体地,在当前windows系统中存在的VS版本中选择任意一个VS版本打开应用工程。其中应用工程可以是已经创建并保存的应用工程,也可以是新建的应用工程。进一步地,可以根据需要添加应用工程或删除应用工程。
步骤S404,获取目标版本VS,将当前应用工程转换为能够在目标版本VS中打开的应用工程。
具体地,能够支持VS版本间的转换功能,应用工程在一个VS版本下打开或者使用一个VS版本保存后,可以使用其他VS版本再次打开。如当前应用工程在VS2003版本对应的应用工程文件中,当使用VS2007版本打开该应用工程时,获取该应用工程对应的名称和存储路径,使用转换函数将应用工程的数据存储格式转换为VS2007版本能够打开的数据格式,将转换后的应用工程保存至VS2007版本对应的应用工程文件中,使用VS2007打开该应用工程。
步骤S405,获取应用工程中的自定义应用程序,将自定义应用程序转换成二进制文件,并将二进制文件与Entry模块和windows动态库编译链接生 成可执行文件。
如图9所示,Entry为一个静态库,封装了WinMain函数,WinMain函数是windows平台应用程序的默认入口函数,自定义应用程序为C语言程序,入口函数为main函数,通过将自定义应用程序转换为二进制文件,并与静态库编译链接,能够将自定义应用程序的入口函数变为WinMain函数,从而启动windows平台应用程序入口机制。
进一步地,windows动态库是指PayProCore模块,由Entry模块启动后接管windows消息循环,能够提供界面交互功能和仿真功能。将自定义应用程序对应的二进制文件与Entry模块以及PayProCore模块编译链接生成可执行文件。
步骤S406,执行可执行文件,调用自定义应用程序接口函数,判断是否可以直接仿真,若是,则执行步骤S407,若否,则执行步骤S408。
具体地,获取自定义应用程序的main函数地址,调用main函数并启动PayProCore模块,执行自定义应用程序,自定义应用程序中包括多个接口函数,PayProCore模块中存储有多个接口函数,由于PayProCore模块是windows平台中的动态库,对于有些硬件模块无法直接在windows平台中进行仿真,如RF模块,由于windows中不存在RF模块对应的硬件,因此无法提供对应的仿真环境。根据调用的接口函数判断windows平台是否能够直接仿真,若是,则执行则执行步骤S407,若否,则执行步骤S408。
步骤S407,直接在windows平台进行仿真,并输出仿真结果。
具体地,调用PayProCore模块中对应的接口函数,直接在windows平台对相应功能进行仿真,并输出仿真结果。进一步地,在进行仿真之前,PayProCore模块调用相关函数对仿真环境进行初始化,并释放仿真资源,为后续仿真提供环境。
步骤S408,发送仿真命令至POS终端,获取POS终端返回的仿真结果。
具体地,如windows平台无法提供当前接口函数功能的仿真环境,则获取调用的接口函数,将该接口函数按照如图10所示的数据格式发送至POS 终端,其中A1为整体的发送格式,B1为A1中的数据内容的详细格式,C1为B1中每个参数的详细格式。POS终端接收调用的接口函数,PayProCore模块使用_declspec形式导出厂商定义的POS API函数,POS API函数是指POS终端的接口函数。POS终端根据接口函数调用对应的POS API函数,对该功能进行仿真,并按照如图11所示的数据格式将仿真结果返回至windows平台所在的移动终端,其中A2为整体的发送格式,B2为A2中的执行结果对应的数据内容的详细格式,C2为B2中每个参数的详细格式。
步骤S409,在仿真界面上显示仿真结果。
具体地,将MFC和direct UI界面库相结合,对不同POS机型对应的仿真界面进行仿真,简化机型添加流程,并使用duilib库进行解析,清晰易懂,方便快捷。其中MFC(Microsoft Foundation Classes,微软基础类)是一个微软公司提供的类库,以C++类的形式封装了Windows API,并且包含一个应用程序框架,以减少应用程序开发人员的工作量。其中包含的类包含大量Windows句柄封装类和很多Windows的内建控件和组件的封装类。direct UI界面库是指直接在父窗口上绘图(Paint on parent dc directly)。即子窗口不以窗口句柄的形式创建(windowless),只是逻辑上的窗口,绘制在父窗口之上。duilib库是国内首个界面开源库,一款强大的界面开发工具,可以将用户界面和处理逻辑彻底分离,极大地提高用户界面的开发效率。
使用XML文件描述POS机型对应的屏幕和按键特性。XML描述采用三级目录,第一级是仿真窗口大小,第二级是窗口背景描述,第三级是屏幕和按键描述。分别使用不同的控制描述屏幕和按键,并分别设置属性描述,描述屏幕和按键的大小以及对应属性,如描述黑白屏或彩屏属性、描述是否为触摸屏的属性参数、以及描述屏幕有效区域的属性参数和屏幕初始化属性参数等,描述按键是否为虚拟按键的属性参数。
进一步地,在仿真界面显示仿真结果之前,首先根据对应的POS终端的机型初始化仿真界面,调用duilib库解析屏幕属性参数,创建对应的绘图区域并确定绘图区域大小,初始化后获取仿真结果对应的数据更新初始化仿真 界面进行显示。
步骤S410,调用预先存储的编译器将仿真结果满足预设条件的可执行文件编译为POS终端对应的目标二进制文件,下载至POS终端。
具体地,预先在PayProCore模块中集成GCC编译器,获取可执行文件,将可执行文件编译成POS终端对应的目标二进制文件,下载至POS终端,实现POS终端对应的应用功能。
本实施例中,通过将自定义应用程序与windows入口函数以及windows动态库编译链接成可执行文件,将POS终端对应的应用程序转换为能够在windows平台执行的可执行文件,利用windows界面进行仿真,并且根据自定义应用程序的接口函数在windows平台仿真或者与POS终端交互仿真,将仿真结果显示在仿真界面,能够实时根据仿真结果对自定义应用程序进行调试,在调试完成后根据预先集成的编译器能够直接生成POS终端能够执行的目标程序,简化了POS终端应用功能程序的调试、编译过程,提高了应用开发的效率。
本申请还提供一种移动终端。该移动终端的内部结构可对应于如图2所示的结构,下述每个模块可全部或部分通过软件、硬件或其组合来实现。
如图12所示,在一个实施例中,移动终端包括:
应用工程获取模块1210,用于检测第三方编辑器版本,根据预先选择的第三方编辑器版本使用对应的第三方编辑器打开对应的应用工程。
可执行文件生成模块1220,用于获取应用工程中的自定义应用程序,使用第三方编辑器编译自定义应用程序,将自定义应用程序与预设静态库及预设动态库链接生成可执行文件。
仿真模块1230,用于执行可执行文件,对自定义应用程序的功能进行仿真。
如图13所示,在一个实施例中,仿真模块1230包括:
调用模块1230A,用于调用可执行文件中的预设静态库入口函数,根据预设静态库入口函数启动预设动态库,并获取自定义应用程序对应的入口函 数地址。
API获取模块1230B,用于根据入口函数地址获取自定义应用程序对应的入口函数,开始执行自定义应用程序,读取自定义应用程序执行的当前应用程序编程接口API。
检测模块1230C,用于检测预设动态库中是否存在与当前API对应的接口函数。
仿真执行模块1230D,用于若存在,则调用预设动态库中对应的接口函数,根据当前API对应的接口函数参数进行仿真执行,得到执行结果。
交互执行模块1230E,用于若不存在,则将当前应用程序编程接口对应的接口函数参数发送至支付终端,接收支付终端返回的执行结果。
显示模块1230F,用于在仿真界面显示执行结果。
如图14所示,在一个实施例中,显示模块1230F还包括:
初始化仿真界面建立模块1231,用于获取目标设备环境句柄和数据缓存地址,调用绘制函数操作目标设备环境句柄或将屏幕初始化数据映射到数据缓存地址上,以在绘图区域绘制初始化仿真界面。
更新模块1232,用于调用加载数据函数将执行结果对应的目标数据复制到绘图区域上,更新初始化仿真界面,在仿真界面显示执行结果。
如图15所示,在一个实施例中,应用工程获取模块1210包括:
编辑器检测模块1210A,用于检测第三方编辑器版本,在显示界面显示检测到的第三方编辑器版本。
创建模块1210B,用于根据作用于显示界面的操作指令,调用创建函数创建当前应用工程。
应用工程生成模块1210C,用于获取当前应用工程对应的名称和保存路径,将当前应用工程对应的数据格式转换为目标第三方编辑器版本对应的数据格式,生成目标应用工程,使用目标第三方编辑器版本对应的第三方编辑器打开目标应用工程。
如图16所示,在一个实施例中,上述移动终端还包括:
编译下载模块1240,用于当检测到自定义应用程序对应的仿真结果达到预设要求时,解析自定义源代码目录结构,自动生成对应的脚本文件,调用预先集成的编译器将脚本文件编译生成支付终端目标文件,并下载至支付终端。
在一个实施例中,提供一种移动终端,包括存储器和处理器,存储器中储存有计算机可读指令,计算机可读指令被处理器执行时,使得处理器执行以下步骤:检测第三方编辑器版本,根据预先选择的第三方编辑器版本使用对应的第三方编辑器打开对应的应用工程;获取应用工程中的自定义应用程序,使用第三方编辑器编译自定义应用程序;将自定义应用程序与预设静态库及预设动态库链接生成可执行文件;及执行可执行文件,对自定义应用程序的功能进行仿真。
在一个实施例中,计算机可读指令被处理器执行时,还使得处理器执行以下步骤:调用可执行文件中的预设静态库入口函数;根据预设静态库入口函数启动预设动态库,并获取自定义应用程序对应的入口函数地址;根据入口函数地址获取自定义应用程序对应的入口函数,开始执行自定义应用程序,读取自定义应用程序执行的当前应用程序编程接口API;检测预设动态库中是否存在与当前API对应的接口函数;若存在,则调用预设动态库中对应的接口函数,根据当前API对应的接口函数参数进行仿真执行,得到执行结果;及将执行结果显示在仿真界面上。
在一个实施例中,计算机可读指令被处理器执行时,还使得处理器执行以下步骤:若检测到预设动态库中不存在与当前API对应的接口函数,则将当前应用程序编程接口对应的接口函数参数发送至支付终端;及接收支付终端返回的执行结果,将执行结果显示在仿真界面上。
在一个实施例中,计算机可读指令被处理器执行时,还使得处理器执行以下步骤:获取目标设备环境句柄和数据缓存地址;调用绘制函数操作目标设备环境句柄或将屏幕初始化数据映射到数据缓存地址上,以在绘图区域绘制初始化仿真界面;及调用加载数据函数将执行结果对应的目标数据复制到 绘图区域上,更新初始化仿真界面,在仿真界面显示执行结果。
在一个实施例中,计算机可读指令被处理器执行时,还使得处理器执行以下步骤:检测第三方编辑器版本,在显示界面显示检测到的第三方编辑器版本;根据作用于显示界面的操作指令,调用创建函数创建当前应用工程;获取当前应用工程对应的名称和保存路径,将当前应用工程对应的数据格式转换为目标第三方编辑器版本对应的数据格式,生成目标应用工程;及使用目标第三方编辑器版本对应的第三方编辑器打开目标应用工程。
在一个实施例中,计算机可读指令被处理器执行时,还使得处理器执行以下步骤:当检测到自定义应用程序对应的仿真结果达到预设要求时,调用预先集成的编译器解析自定义应用程序目录结构,自动生成对应的脚本文件;及将脚本文件编译生成支付终端目标文件,并下载至支付终端。
在一个实施例中,计算机可读指令被处理器执行时,还使得处理器执行以下步骤:当检测到第三方编辑器版本更新时,发送对应的更新提醒通知;及根据更新提醒通知更新第三方编辑器版本为最新版本。
在一个实施例中,一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:检测第三方编辑器版本,根据预先选择的第三方编辑器版本使用对应的第三方编辑器打开对应的应用工程;获取应用工程中的自定义应用程序,使用第三方编辑器编译自定义应用程序;将自定义应用程序与预设静态库及预设动态库链接生成可执行文件;及执行可执行文件,对自定义应用程序的功能进行仿真。
在一个实施例中,计算机可读指令被一个或多个处理器执行时,还使得一个或多个处理器执行以下步骤:调用可执行文件中的预设静态库入口函数;根据预设静态库入口函数启动预设动态库,并获取自定义应用程序对应的入口函数地址;根据入口函数地址获取自定义应用程序对应的入口函数,开始执行自定义应用程序,读取自定义应用程序执行的当前应用程序编程接口API;检测预设动态库中是否存在与当前API对应的接口函数;若存在,则 调用预设动态库中对应的接口函数,根据当前API对应的接口函数参数进行仿真执行,得到执行结果;及将执行结果显示在仿真界面上。
在一个实施例中,计算机可读指令被一个或多个处理器执行时,还使得一个或多个处理器执行以下步骤:若检测到预设动态库中不存在与当前API对应的接口函数,则将当前应用程序编程接口对应的接口函数参数发送至支付终端;及接收支付终端返回的执行结果,将执行结果显示在仿真界面上。
在一个实施例中,计算机可读指令被一个或多个处理器执行时,还使得一个或多个处理器执行以下步骤:获取目标设备环境句柄和数据缓存地址;调用绘制函数操作目标设备环境句柄或将屏幕初始化数据映射到数据缓存地址上,以在绘图区域绘制初始化仿真界面;及调用加载数据函数将执行结果对应的目标数据复制到绘图区域上,更新初始化仿真界面,在仿真界面显示执行结果。
在一个实施例中,计算机可读指令被一个或多个处理器执行时,还使得一个或多个处理器执行以下步骤:检测第三方编辑器版本,在显示界面显示检测到的第三方编辑器版本;根据作用于显示界面的操作指令,调用创建函数创建当前应用工程;获取当前应用工程对应的名称和保存路径,将当前应用工程对应的数据格式转换为目标第三方编辑器版本对应的数据格式,生成目标应用工程;及使用目标第三方编辑器版本对应的第三方编辑器打开目标应用工程。
在一个实施例中,计算机可读指令被一个或多个处理器执行时,还使得一个或多个处理器执行以下步骤:当检测到自定义应用程序对应的仿真结果达到预设要求时,调用预先集成的编译器解析自定义应用程序目录结构,自动生成对应的脚本文件;及将脚本文件编译生成支付终端目标文件,并下载至支付终端。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种支付终端应用仿真方法,包括:
    检测第三方编辑器版本,根据预先选择的第三方编辑器版本打开对应的应用工程;
    获取所述应用工程中的自定义应用程序,使用第三方编辑器编译所述自定义应用程序;
    将所述自定义应用程序与预设静态库及预设动态库链接生成可执行文件;及
    执行所述可执行文件,对所述自定义应用程序的功能进行仿真。
  2. 根据权利要求1所述的方法,其特征在于,所述执行所述可执行文件,对所述自定义应用程序的功能进行仿真,包括:
    调用所述可执行文件中的预设静态库入口函数;
    根据所述预设静态库入口函数启动所述预设动态库,并获取所述自定义应用程序对应的入口函数地址;
    根据所述入口函数地址获取所述自定义应用程序对应的入口函数,开始执行所述自定义应用程序,读取所述自定义应用程序执行的当前应用程序编程接口API;
    检测所述预设动态库中是否存在与所述当前API对应的接口函数;
    若存在,则调用所述预设动态库中对应的接口函数,根据所述当前API对应的接口函数参数进行仿真执行,得到执行结果;及
    将执行结果显示在仿真界面上。
  3. 根据权利要求2所述的方法,其特征在于,所述检测所述预设动态库中是否存在与所述当前API对应的接口函数之后,还包括:
    若检测到所述预设动态库中不存在与所述当前API对应的接口函数,则将所述当前应用程序编程接口对应的接口函数参数发送至支付终端;及
    接收所述支付终端返回的执行结果,将执行结果显示在仿真界面上。
  4. 根据权利要求2所述的方法,其特征在于,所述将执行结果显示在仿真界面上,包括:
    获取目标设备环境句柄和数据缓存地址;
    调用绘制函数操作所述目标设备环境句柄或将屏幕初始化数据映射到所述数据缓存地址上,以在绘图区域绘制初始化仿真界面;及
    调用加载数据函数将执行结果对应的目标数据复制到绘图区域上,更新初始化仿真界面,在仿真界面显示执行结果。
  5. 根据权利要求1所述的方法,其特征在于,所述检测第三方编辑器版本,根据预先选择的第三方编辑器版本打开对应的应用工程,包括:
    检测第三方编辑器版本,在显示界面显示检测到的第三方编辑器版本;
    根据作用于所述显示界面的操作指令,调用创建函数创建当前应用工程;
    获取所述当前应用工程对应的名称和保存路径,将当前应用工程对应的数据格式转换为目标第三方编辑器版本对应的数据格式,生成目标应用工程;及
    使用所述目标第三方编辑器版本对应的第三方编辑器打开所述目标应用工程。
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当检测到所述自定义应用程序对应的仿真结果达到预设要求时,调用预先集成的编译器解析所述自定义应用程序目录结构,自动生成对应的脚本文件;及
    将所述脚本文件编译生成支付终端目标文件,并下载至支付终端。
  7. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当检测到所述第三方编辑器版本更新时,发送对应的更新提醒通知;及
    根据所述更新提醒通知更新所述第三方编辑器版本为最新版本。
  8. 一种移动终端,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行:
    检测第三方编辑器版本,根据预先选择的第三方编辑器版本使用对应的 第三方编辑器打开对应的应用工程;
    获取所述应用工程中的自定义应用程序,使用第三方编辑器编译所述自定义应用程序;
    将所述自定义应用程序与预设静态库及预设动态库链接生成可执行文件;及
    执行所述可执行文件,对所述自定义应用程序的功能进行仿真。
  9. 根据权利要求8所述的移动终端,其特征在于,所述计算机可读指令被所述处理器执行时,还使得所述处理器执行:
    调用所述可执行文件中的预设静态库入口函数;
    根据所述预设静态库入口函数启动所述预设动态库,并获取所述自定义应用程序对应的入口函数地址;
    根据所述入口函数地址获取所述自定义应用程序对应的入口函数,开始执行所述自定义应用程序,读取所述自定义应用程序执行的当前应用程序编程接口API;
    检测所述预设动态库中是否存在与所述当前API对应的接口函数;
    若存在,则调用所述预设动态库中对应的接口函数,根据所述当前API对应的接口函数参数进行仿真执行,得到执行结果;及
    将执行结果显示在仿真界面上。
  10. 根据权利要求9所述的移动终端,其特征在于,所述计算机可读指令被所述处理器执行时,还使得所述处理器执行:
    若检测到所述预设动态库中不存在与所述当前API对应的接口函数,则将所述当前应用程序编程接口对应的接口函数参数发送至支付终端;及
    接收所述支付终端返回的执行结果,将执行结果显示在仿真界面上。
  11. 根据权利要求9所述的移动终端,其特征在于,所述计算机可读指令被所述处理器执行时,还使得所述处理器执行:
    获取目标设备环境句柄和数据缓存地址;
    调用绘制函数操作所述目标设备环境句柄或将屏幕初始化数据映射到所 述数据缓存地址上,以在绘图区域绘制初始化仿真界面;及
    调用加载数据函数将执行结果对应的目标数据复制到绘图区域上,更新初始化仿真界面,在仿真界面显示执行结果。
  12. 根据权利要求8所述的移动终端,其特征在于,所述计算机可读指令被所述处理器执行时,还使得所述处理器执行:
    检测第三方编辑器版本,在显示界面显示检测到的第三方编辑器版本;
    根据作用于所述显示界面的操作指令,调用创建函数创建当前应用工程;
    获取所述当前应用工程对应的名称和保存路径,将当前应用工程对应的数据格式转换为目标第三方编辑器版本对应的数据格式,生成目标应用工程;及
    使用所述目标第三方编辑器版本对应的第三方编辑器打开所述目标应用工程。
  13. 根据权利要求8所述的移动终端,其特征在于,所述计算机可读指令被所述处理器执行时,还使得所述处理器执行:
    当检测到所述自定义应用程序对应的仿真结果达到预设要求时,调用预先集成的编译器解析所述自定义应用程序目录结构,自动生成对应的脚本文件;及
    将所述脚本文件编译生成支付终端目标文件,并下载至支付终端。
  14. 根据权利要求8所述的移动终端,其特征在用于,所述计算机可读指令被所述处理器执行时,还使得所述处理器执行:
    当检测到第三方编辑器版本更新时,发送对应的更新提醒通知;及
    根据所述更新提醒通知更新所述第三方编辑器版本为最新版本。
  15. 一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行:
    检测第三方编辑器版本,根据预先选择的第三方编辑器版本使用对应的第三方编辑器打开对应的应用工程;
    获取所述应用工程中的自定义应用程序,使用第三方编辑器编译所述自定义应用程序;
    将所述自定义应用程序与预设静态库及预设动态库链接生成可执行文件;及
    执行所述可执行文件,对所述自定义应用程序的功能进行仿真。
  16. 根据权利要求15所述的可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,还使得所述一个或多个处理器执行:
    调用所述可执行文件中的预设静态库入口函数;
    根据所述预设静态库入口函数启动所述预设动态库,并获取所述自定义应用程序对应的入口函数地址;
    根据所述入口函数地址获取所述自定义应用程序对应的入口函数,开始执行所述自定义应用程序,读取所述自定义应用程序执行的当前应用程序编程接口API;
    检测所述预设动态库中是否存在与所述当前API对应的接口函数;
    若存在,则调用所述预设动态库中对应的接口函数,根据所述当前API对应的接口函数参数进行仿真执行,得到执行结果;及
    将执行结果显示在仿真界面上。
  17. 根据权利要求16所述的可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行:
    若检测到所述预设动态库中不存在与所述当前API对应的接口函数,则将所述当前应用程序编程接口对应的接口函数参数发送至支付终端;及
    接收所述支付终端返回的执行结果,将执行结果显示在仿真界面上。
  18. 根据权利要求16所述的可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行:
    获取目标设备环境句柄和数据缓存地址,;
    调用绘制函数操作所述目标设备环境句柄或将屏幕初始化数据映射到所述数据缓存地址上,以在绘图区域绘制初始化仿真界面;及
    调用加载数据函数将执行结果对应的目标数据复制到绘图区域上,更新初始化仿真界面,在仿真界面显示执行结果。
  19. 根据权利要求15所述的可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行:
    检测第三方编辑器版本,在显示界面显示检测到的第三方编辑器版本;
    根据作用于所述显示界面的操作指令,调用创建函数创建当前应用工程;
    获取所述当前应用工程对应的名称和保存路径,将当前应用工程对应的数据格式转换为目标第三方编辑器版本对应的数据格式,生成目标应用工程;及
    使用所述目标第三方编辑器版本对应的第三方编辑器打开所述目标应用工程。
  20. 根据权利要求15所述的可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行:
    当检测到所述自定义应用程序对应的仿真结果达到预设要求时,调用预先集成的编译器解析所述自定义应用程序目录结构,自动生成对应的脚本文件;及
    将所述脚本文件编译生成支付终端目标文件,并下载至支付终端。
PCT/CN2017/102297 2017-04-07 2017-09-19 支付终端应用仿真方法、移动终端和可读存储介质 WO2018184359A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710225700.4 2017-04-07
CN201710225700.4A CN107193628A (zh) 2017-04-07 2017-04-07 支付终端应用仿真方法和装置

Publications (1)

Publication Number Publication Date
WO2018184359A1 true WO2018184359A1 (zh) 2018-10-11

Family

ID=59871363

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/102297 WO2018184359A1 (zh) 2017-04-07 2017-09-19 支付终端应用仿真方法、移动终端和可读存储介质

Country Status (2)

Country Link
CN (1) CN107193628A (zh)
WO (1) WO2018184359A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943484B (zh) * 2017-11-30 2021-04-06 广州酷狗计算机科技有限公司 执行业务功能的方法和装置
CN110908668A (zh) * 2019-11-21 2020-03-24 深圳市新威尔电子有限公司 用于编译电池检测系统脚本程序的编译器
CN111124373A (zh) * 2019-12-26 2020-05-08 武汉精鸿电子技术有限公司 一种测试软件开发方法、装置及测试设备
CN116501651A (zh) * 2023-06-27 2023-07-28 北京世冠金洋科技发展有限公司 一种仿真数据的处理方法、装置、设备和计算机可读介质
CN117806852B (zh) * 2024-03-01 2024-05-14 傲拓科技股份有限公司 一种接口调用方法、装置、存储介质及处理器

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060282247A1 (en) * 2005-05-25 2006-12-14 Brennan James T Combined hardware and network simulator for testing embedded wireless communication device software and methods
CN1991765A (zh) * 2005-12-29 2007-07-04 北京金远见电脑技术有限公司 手持终端应用程序的开发装置和方法
CN101097457A (zh) * 2007-06-20 2008-01-02 深圳市菲特数码技术有限公司 电波钟应用程序开发系统
CN102662648A (zh) * 2012-03-05 2012-09-12 广东天波信息技术股份有限公司 一种通讯终端的嵌入式软件开发仿真平台及其应用
CN104699523A (zh) * 2015-03-24 2015-06-10 北京深思数盾科技有限公司 用于硬件平台所开发的应用程序的调试方法和系统
CN105589709A (zh) * 2014-12-24 2016-05-18 中国银联股份有限公司 一种修改pos终端菜单的装置和方法
CN105843630A (zh) * 2016-06-08 2016-08-10 江西洪都航空工业集团有限责任公司 一种基于机器人图形化编程开发的方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7266490B2 (en) * 2000-12-28 2007-09-04 Robert Marc Zeidman Apparatus and method for connecting hardware to a circuit simulation
CN103942091A (zh) * 2014-04-17 2014-07-23 国家电网公司 Matlab自定义模型和psasp联合仿真的励磁系统仿真方法及系统
CN103984555B (zh) * 2014-05-29 2017-03-15 四川航天系统工程研究所 一种树表结合驱动Windows/Linux平台通讯协议源代码自动生成方法
CN104881358B (zh) * 2015-05-28 2018-02-16 南京南瑞继保电气有限公司 一种程序仿真测试方法及系统
CN105785793B (zh) * 2016-03-04 2018-05-08 济南大学 基于pscad的数字化保护源代码级闭环仿真方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060282247A1 (en) * 2005-05-25 2006-12-14 Brennan James T Combined hardware and network simulator for testing embedded wireless communication device software and methods
CN1991765A (zh) * 2005-12-29 2007-07-04 北京金远见电脑技术有限公司 手持终端应用程序的开发装置和方法
CN101097457A (zh) * 2007-06-20 2008-01-02 深圳市菲特数码技术有限公司 电波钟应用程序开发系统
CN102662648A (zh) * 2012-03-05 2012-09-12 广东天波信息技术股份有限公司 一种通讯终端的嵌入式软件开发仿真平台及其应用
CN105589709A (zh) * 2014-12-24 2016-05-18 中国银联股份有限公司 一种修改pos终端菜单的装置和方法
CN104699523A (zh) * 2015-03-24 2015-06-10 北京深思数盾科技有限公司 用于硬件平台所开发的应用程序的调试方法和系统
CN105843630A (zh) * 2016-06-08 2016-08-10 江西洪都航空工业集团有限责任公司 一种基于机器人图形化编程开发的方法

Also Published As

Publication number Publication date
CN107193628A (zh) 2017-09-22

Similar Documents

Publication Publication Date Title
WO2018184359A1 (zh) 支付终端应用仿真方法、移动终端和可读存储介质
WO2019144680A1 (zh) 自动化测试方法及装置、存储介质、电子设备
US7051316B2 (en) Distributed computing component system with diagrammatic graphical representation of code with separate delineated display area by type
US9916134B2 (en) Methods and systems for accessing distributed computing components through the internet
US7856619B2 (en) Method and system for automated testing of a graphic-based programming tool
Voelter et al. mbeddr: Instantiating a language workbench in the embedded software domain
CN113064593B (zh) 移动app动态化的方法、装置、计算机设备及存储介质
US9122798B2 (en) Debugger with method restart capability
KR101416104B1 (ko) 하이브리드 웹 어플리케이션의 네이티브 기능을 수행하는 자바스크립트 코드의 동적 로딩 장치와 방법
Rischpater Application development with qt creator
Izquierdo et al. API2MoL: Automating the building of bridges between APIs and Model-Driven Engineering
JP2001502096A (ja) 電子民生機器のグラフィカルユーザインターフェースを設計するための方法とシステム
CN108287720B (zh) 软件编译方法、装置、设备及存储介质
Botturi et al. Model-driven design for the development of multi-platform smartphone applications
KR20140021088A (ko) 하이브리드 웹 어플리케이션 개발을 위한 호환성 높은 플러그인 시스템
US9164877B2 (en) Business application inspection and modification
US20220197607A1 (en) System and method for developing user interface applications
Cornez Android Programming Concepts
CN114741054A (zh) 基于国产化操作系统的桌面应用软件开发及构建的方法
Cheng Flutter Recipes
RU2799988C2 (ru) Система и способ динамической визуализации элементов программного обеспечения
Bai Introduction to Apache NetBeans IDE
CN116360779B (zh) 基于qiankun在Vue CLI应用构建微前端基座的方法
Rischpater et al. Introducing qt quick
Chalmers Read Eval Print Loop and User Interface for the DEX Security Policy Configuration Language

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17904911

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 31/01/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17904911

Country of ref document: EP

Kind code of ref document: A1