WO2019169759A1 - 模拟接口的创建装置、方法及计算机可读存储介质 - Google Patents

模拟接口的创建装置、方法及计算机可读存储介质 Download PDF

Info

Publication number
WO2019169759A1
WO2019169759A1 PCT/CN2018/089184 CN2018089184W WO2019169759A1 WO 2019169759 A1 WO2019169759 A1 WO 2019169759A1 CN 2018089184 W CN2018089184 W CN 2018089184W WO 2019169759 A1 WO2019169759 A1 WO 2019169759A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
interface
field
input parameter
parameter field
Prior art date
Application number
PCT/CN2018/089184
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 WO2019169759A1 publication Critical patent/WO2019169759A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware
    • G06F11/3656Software debugging using additional hardware using a specific debug interface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler

Definitions

  • the present application relates to the field of computer technologies, and in particular, to an apparatus, a method, and a computer readable storage medium for creating an analog interface.
  • System interface testing is primarily used to detect interactions between the system and the outside of the system and between subsystems within the system.
  • the focus of system interface testing is to examine the exchange of data, the transfer and control management processes, and the logical dependencies between systems.
  • the mock test simulation test
  • the target interface is tested.
  • the present application provides a device, a method, and a computer readable storage medium for creating an analog interface.
  • the main purpose of the present invention is to solve the problem that the creation of an analog interface in the prior art requires not only a large amount of human resources but also an inefficient creation.
  • the present application provides an apparatus for creating an analog interface, the apparatus including a memory and a processor, wherein the memory stores an interface creation program executable on the processor, the interface creation program being The following steps are implemented when the processor is executed:
  • the present application further provides a method for creating an analog interface, the method comprising:
  • the interface configuration interface information is sent to the user terminal, so that the user terminal displays the interface configuration interface according to the interface configuration interface information;
  • the present application further provides a computer readable storage medium having an interface creation program stored thereon, the interface creation program being executable by one or more processors to implement The steps of the method of creating an analog interface as described above.
  • the device, the method and the computer-readable storage medium for creating an analog interface provided by the present application, when the user needs to create an analog interface, send an interface configuration interface to the user terminal for display, and the user can set third-party system information and interface information based on the interface.
  • Obtaining the information set by the user is stored in the cache area, and the parameter configuration interface is sent to the user terminal for display.
  • the confirmation instruction triggered by the parameter configuration interface the information of the input parameter field input by the user based on the parameter configuration interface is obtained.
  • the field information and the parameter of the input parameter field set for the input parameter field, the code frame matching the third party system information matching and the interface information is invoked, and the analog interface is generated based on the code frame and various parameter fields and rules input by the user, and is proposed by the present application.
  • the development solution provides a configuration display page.
  • the pre-set code framework can be called repeatedly.
  • the user can simulate the interface to be supported by the configuration page, which is easy to use and can be used by people without coding ability, which saves human resources. And improve The efficiency of creating an analog interface.
  • FIG. 1 is a schematic diagram of a first embodiment of an apparatus for creating an analog interface according to the present application
  • FIG. 2 is a schematic diagram of a program module of an interface creation program in an embodiment of a device for creating an analog interface according to the present application;
  • FIG. 3 is a flowchart of a first embodiment of a method for creating an analog interface according to the present application.
  • the application provides a device for creating an analog interface.
  • FIG. 1 it is a schematic diagram of a first embodiment of a device for creating an analog interface according to the present application.
  • the device for creating the analog interface may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet computer, or a portable computer.
  • PC Personal Computer
  • terminal device such as a smart phone, a tablet computer, or a portable computer.
  • the creation device of the analog interface includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 11 may in some embodiments be an internal storage unit of the creation device of the analog interface, such as the hard disk of the creation device of the analog interface.
  • the memory 11 may also be an external storage device of the creation device of the analog interface in other embodiments, such as a plug-in hard disk equipped on the creation device of the analog interface, a smart memory card (SMC), and a secure digital (Secure) Digital, SD) cards, flash cards, etc.
  • the memory 11 may also include an internal storage unit of the creation device of the analog interface as well as an external storage device.
  • the memory 11 can be used not only for storing application software of a creation device installed in an analog interface and various types of data, such as code of an interface creation program, but also for temporarily storing data that has been output or is to be output.
  • the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11. Data, such as execution interface creation programs, etc.
  • CPU Central Processing Unit
  • controller microcontroller
  • microprocessor or other data processing chip for running program code or processing stored in the memory 11.
  • Data such as execution interface creation programs, etc.
  • Communication bus 13 is used to implement connection communication between these components.
  • the network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
  • a standard wired interface such as a WI-FI interface
  • Figure 1 shows only the creation of an analog interface with components 11-14 and an interface creation program, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the device may further include a user interface
  • the user interface may include a display
  • an input unit such as a keyboard
  • the optional user interface may further include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display may also be suitably referred to as a display screen or display unit for displaying information processed in the creation device of the analog interface and a user interface for displaying the visualization.
  • an interface creation program is stored in the memory 11; when the processor 12 executes the interface creation program stored in the memory 11, the following steps are implemented:
  • the interface configuration interface information is sent to the user terminal, so that the user terminal displays the interface configuration interface according to the interface configuration interface information.
  • the third-party system information and the interface information set by the user based on the interface configuration interface are obtained, and the parameter configuration interface information is sent to the user terminal, so that the user terminal displays the parameter configuration interface according to the parameter configuration interface information.
  • the user terminal establishes a communication connection with the creating device, and the user performs the creation of the analog interface through the user terminal, for example, the creation of the analog interface through the web page.
  • the creating device receives the analog interface creation instruction sent by the user sending terminal
  • the interface configuration interface information is sent to the user terminal, and the user terminal displays the corresponding interface configuration interface according to the received interface information, where the user information configuration interface is displayed on the interface information configuration interface.
  • the third-party system information and the interface information specifically, in this embodiment, the third-party system information is generally a third-party system name
  • the interface information includes but is not limited to the following information: interface type, interface name, interface description, etc., wherein the implementation
  • the device of the example can implement the creation of various types of interfaces.
  • the user inputs the values of the foregoing information through the configuration interface, where the third-party system and the interface type that can be used are displayed in the form of a selection box, and the user selects according to the needs.
  • a code framework corresponding to a plurality of optional third-party systems or interface types, respectively, is pre-stored in the creation device.
  • the user submits the information to the device for creating the analog interface.
  • the device for creating the analog interface obtains the third-party system information and interface information set by the user and stores the information in the cache area. Then, the creating device of the analog interface sends the parameter configuration interface information to the user terminal, and the user terminal displays the corresponding parameter configuration interface according to the received parameter configuration interface information, and the user inputs various parameters of the analog interface to be created through the interface.
  • the inbound field information, the parameter field information, and the parameter of the parameter field set for the parameter field are obtained by the user according to the parameter configuration interface.
  • the user needs to enter the following information through the parameter configuration interface: the input parameter field information, the parameter field information, and the input parameter field rules set for the input parameter field.
  • the input parameter field information and the output parameter field information mainly include the following parameter fields: a field name, a variable name, a field type, a field length, a necessary field, and a matching entry field rule.
  • the interface creation program may be further executed by the processor 12 to implement the following steps before the step of calling the code framework that matches the third-party system information matching and the interface information:
  • the interface creation program may be further executed by the processor 12 to implement the following steps before the step of calling the code framework that matches the third-party system information matching and the interface information. :
  • the user terminal If it is detected that the entry parameter is invalid, the user terminal sends the prompt information that the entry field is invalid, and displays the illegal field content in the prompt information.
  • the validity of each input parameter field in the corresponding input parameter field information is verified by the verification rule set by the user, that is, the input parameter field information input by the user includes a verification rule, and is obtained.
  • the verification rule set by the user
  • the field name, variable name, field type, field length and other information of the input parameter field are verified by the verification rule, and the judgment is legal. If it is legal, the next step is continued; otherwise, The user terminal needs to be prompted to modify the parameter field.
  • the user may set one or more parameters of the input parameter field in the parameter configuration interface, and when there are multiple rules, associate multiple rules to achieve simultaneous support.
  • the business scenario is returned.
  • Configuration rule 1 The field rule of the tradecco in the parameter field is "%1,%7", then " ⁇ "code”:”701001", “message”: “password does not comply with security rules” ⁇ ", that is, If the end of the tradeacco's input value is 1 or 7, the simulation returns " ⁇ "code”:"701001", “message”: “Password does not comply with security rules” ⁇ ".
  • Configuration rule 2 The field rule of the input parameter field tradeacco is "%2,%8", then return " ⁇ "code”:"$ ⁇ Random(100000,999999,) ⁇ ","message”:"Password is not safe
  • the device for creating an analog interface when the user needs to create an analog interface, sends an interface configuration interface to the user terminal for display, and the user can set third-party system information and interface information based on the interface to obtain the information storage set by the user. Go to the cache area and send the parameter configuration interface to the user terminal for display.
  • receive the confirmation command triggered by the parameter configuration interface obtain the input parameter field information, the parameter field information and the input parameter field that the user inputs based on the parameter configuration interface.
  • Set the input parameter field rule call the code framework that matches the third-party system information matching and interface information, generate an analog interface based on the code frame and various parameter fields and rules input by the user, and provide a configuration display page by using the sending solution proposed by the application.
  • the pre-set code framework can be called repeatedly.
  • the user can simulate the return of the interface that needs to be supported through the configuration page. It is easy to use, and can be used by people without coding ability, which saves human resources and improves the creation of the analog interface. effectiveness.
  • a second embodiment of the apparatus for creating an analog interface of the present application is proposed based on the first embodiment.
  • the interface creation program can also be executed by the processor 12 to implement the following steps:
  • the interface modification request sent by the user terminal When the interface modification request sent by the user terminal is received, the interface corresponding to the interface modification request is determined, and the parameter modification interface information is sent to the user terminal, so that the user terminal can modify the interface information display parameter modification interface according to the parameter, where Each parameter field of the analog interface is displayed on the parameter modification interface;
  • the analog interface is modified according to the modified input parameter field information, the parameter field information, and/or the input parameter field rule set for the input parameter field.
  • the existing analog interface needs to be re-encoded when the interface parameters and the parameters of the input parameter field are changed during the testing process. Therefore, developers who need certain coding experience can develop and modify the analog interface.
  • the device for creating the analog interface in the embodiment is created by the user setting the interface parameters and adding the parameters to the pre-written code frame. Therefore, the device parameters of the embodiment can directly input the interface parameters and parameters. Information such as field rules is modified and does not require re-encoding.
  • the interface creation program may also be divided into one or more modules, and one or more modules are stored in the memory 11 and are composed of one or more processors (this embodiment is The processor 12) is executed to complete the application.
  • a module referred to in the present application refers to a series of computer program instruction segments capable of performing a specific function for describing an execution process of an interface creation program in a creation device of an analog interface.
  • FIG. 2 it is a schematic diagram of a program module of an interface creation program in an embodiment of a device for creating an analog interface of the present application.
  • the interface creation program may be divided into an information sending module 10 and a data acquiring module 20.
  • interface generation module 30, illustratively:
  • the information sending module 10 is configured to: when receiving the analog interface creation instruction sent by the user terminal, send the interface configuration interface information to the user terminal, where the user terminal displays the interface configuration interface according to the interface configuration interface information;
  • the data obtaining module 20 is configured to: acquire third-party system information and interface information set by the user based on the interface configuration interface;
  • the information sending module 10 is further configured to: send parameter configuration interface information to the user terminal, where the user terminal displays a parameter configuration interface according to the parameter configuration interface information;
  • the data obtaining module 20 is further configured to: when receiving the confirmation instruction triggered by the parameter configuration interface, acquire the input parameter field information, the parameter field information, and the input set for the input parameter field that are input by the user based on the parameter configuration interface. Refer to the field rules;
  • the interface generating module 30 is configured to: invoke a code framework that matches the third-party system information matching and interface information, according to the code frame and the input parameter field information, the parameter field information, and the input parameter set for the input parameter field. Field rules generate an analog interface.
  • the present application also provides a method for creating an analog interface.
  • FIG. 3 it is a flowchart of a first embodiment of a method for creating an analog interface of the present application.
  • the method may be performed by a device, which may be implemented by software and/or hardware.
  • the creation device of the analog interface is described as an execution body of the method.
  • the method for creating an analog interface includes:
  • step S10 when receiving the analog interface creation instruction sent by the user terminal, the interface configuration interface information is sent to the user terminal, so that the user terminal displays the interface configuration interface according to the interface configuration interface information.
  • Step S20 Obtain third-party system information and interface information set by the user based on the interface configuration interface, and send parameter configuration interface information to the user terminal, so that the user terminal displays a parameter configuration interface according to the parameter configuration interface information.
  • the user terminal establishes a communication connection with the creating device, and the user performs the creation of the analog interface through the user terminal, for example, the creation of the analog interface through the web page.
  • the creating device receives the analog interface creation instruction sent by the user sending terminal
  • the interface configuration interface information is sent to the user terminal, and the user terminal displays the corresponding interface configuration interface according to the received interface information, where the user information configuration interface is displayed on the interface information configuration interface.
  • the third-party system information and the interface information specifically, in this embodiment, the third-party system information is generally a third-party system name
  • the interface information includes but is not limited to the following information: interface type, interface name, interface description, etc., wherein the implementation
  • the device of the example can implement the creation of various types of interfaces.
  • the user inputs the values of the foregoing information through the configuration interface, where the third-party system and the interface type that can be used are displayed in the form of a selection box, and the user selects according to the needs.
  • a code framework corresponding to a plurality of optional third-party systems or interface types, respectively, is pre-stored in the creation device.
  • the user submits the information to the device for creating the analog interface.
  • the device for creating the analog interface obtains the third-party system information and interface information set by the user and stores the information in the cache area. Then, the creating device of the analog interface sends the parameter configuration interface information to the user terminal, and the user terminal displays the corresponding parameter configuration interface according to the received parameter configuration interface information, and the user inputs various parameters of the analog interface to be created through the interface.
  • Step S30 Upon receiving the confirmation instruction triggered by the parameter configuration interface, obtain the input parameter field information, the parameter input field information, and the input parameter field rule set for the input parameter field, which are input by the user based on the parameter configuration interface.
  • Step S40 calling a code frame that matches the third-party system information matching and interface information, and generating a simulation according to the code frame and the input parameter field information, the parameter field information, and the parameter of the input parameter field set for the input parameter field. interface.
  • the user needs to enter the following information through the parameter configuration interface: the input parameter field information, the parameter field information, and the input parameter field rules set for the input parameter field.
  • the input parameter field information and the output parameter field information mainly include the following parameter fields: a field name, a variable name, a field type, a field length, a necessary field, and a matching entry field rule.
  • the method before the step of invoking a code framework that matches the third-party system information and the interface information, the method further includes the following steps:
  • the method before the step of invoking a code framework that matches the third-party system information and the interface information, the method further includes the following steps:
  • the user terminal If it is detected that the entry parameter is invalid, the user terminal sends the prompt information that the entry field is invalid, and displays the illegal field content in the prompt information.
  • the validity of each input parameter field in the corresponding input parameter field information is verified by the verification rule set by the user, that is, the input parameter field information input by the user includes a verification rule, and is obtained.
  • the verification rule set by the user
  • the field name, variable name, field type, field length and other information of the input parameter field are verified by the verification rule, and the judgment is legal. If it is legal, the next step is continued; otherwise, The user terminal needs to be prompted to modify the parameter field.
  • the user may set one or more parameters of the input parameter field in the parameter configuration interface, and when there are multiple rules, associate multiple rules to achieve simultaneous support.
  • the business scenario is returned.
  • Configuration rule 1 The field rule of the tradecco in the parameter field is "%1,%7", then " ⁇ "code”:”701001", “message”: “password does not comply with security rules” ⁇ ", that is, If the end of the tradeacco's input value is 1 or 7, the simulation returns " ⁇ "code”:"701001", “message”: “Password does not comply with security rules” ⁇ ".
  • Configuration rule 2 The field rule of the input parameter field tradeacco is "%2,%8", then return " ⁇ "code”:"$ ⁇ Random(100000,999999,) ⁇ ","message”:"Password is not safe
  • the method for creating an analog interface in this embodiment is to send an interface configuration interface to the user terminal for display when the user needs to create an analog interface.
  • the user can set third-party system information and interface information based on the interface to obtain the information storage set by the user. Go to the cache area and send the parameter configuration interface to the user terminal for display.
  • Set the input parameter field rule call the code framework that matches the third-party system information matching and interface information, generate an analog interface based on the code frame and various parameter fields and rules input by the user, and provide a configuration display page by using the sending solution proposed by the application.
  • the pre-set code framework can be called repeatedly.
  • the user can simulate the return of the interface that needs to be supported through the configuration page. It is easy to use, and can be used by people without coding ability, which saves human resources and improves the creation of the analog interface. effectiveness.
  • a second embodiment of the method for creating an analog interface of the present application is proposed based on the first embodiment.
  • the method may further implement the following steps:
  • the interface modification request sent by the user terminal When the interface modification request sent by the user terminal is received, the interface corresponding to the interface modification request is determined, and the parameter modification interface information is sent to the user terminal, so that the user terminal can modify the interface information display parameter modification interface according to the parameter, where Each parameter field of the analog interface is displayed on the parameter modification interface;
  • the analog interface is modified according to the modified input parameter field information, the parameter field information, and/or the input parameter field rule set for the input parameter field.
  • the existing analog interface needs to be re-encoded when the interface parameters and the parameters of the input parameter field are changed during the testing process. Therefore, developers who need certain coding experience can develop and modify the analog interface.
  • the device for creating the analog interface in the embodiment is created by the user setting the interface parameters and adding the parameters to the pre-written code frame. Therefore, the device parameters of the embodiment can directly input the interface parameters and parameters. Information such as field rules is modified and does not require re-encoding.
  • the embodiment of the present application further provides a computer readable storage medium, where the interface creator is stored, and the interface creator can be executed by one or more processors to implement the following operations:
  • the interface configuration interface information is sent to the user terminal, so that the user terminal displays the interface configuration interface according to the interface configuration interface information;
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Abstract

本申请公开了一种模拟接口的创建装置,包括存储器和处理器,存储器上存储有可在处理器上运行的接口创建程序,该程序被处理器执行时实现如下步骤:当接收到用户终端发送的模拟接口创建指令时,在用户终端展示接口配置界面;获取用户基于配置界面设置的第三方系统信息和接口信息,并在用户终端展示参数配置界面;在接收到确认指令时,获取入参字段信息、出参字段信息以及为入参字段设置的入参字段规则;调用与第三方系统信息匹配和接口信息匹配的代码框架,生成模拟接口。本申请还提出一种模拟接口的创建方法以及一种计算机可读存储介质。本申请解决了现有技术中创建模拟接口不仅需要耗费大量人力资源,而且创建效率低下的问题。

Description

模拟接口的创建装置、方法及计算机可读存储介质
本申请基于巴黎公约申明享有2018年03月06日递交的申请号为201810183370.1、名称为“模拟接口的创建装置、方法及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种模拟接口的创建装置、方法及计算机可读存储介质。
背景技术
系统接口测试主要用于检测系统与系统外部之间以及系统内部各个子系统之间的交互点。系统接口测试的重点是要检查数据的交换,传递和控制管理过程,以及系统间的相互逻辑依赖关系等。而在系统接口测试时,测试该系统接口与第三方系统之间的交互情况,因此可以采用mock测试(模拟测试)的方式模拟调用第三方系统的返回,即创建模拟接口(模拟接口)来对目标接口进行测试,现有的模拟第三方返回的,大多是采用直接编写对应的mock代码,但是种方式写成的mock接口(模拟接口)灵活性差,需要专业的代码编写人员才能够实现,由于代码的编写需要耗费较长的时间,导致创建模拟接口不仅需要耗费大量人力资源,而且创建效率低下。
发明内容
本申请提供一种模拟接口的创建装置、方法及计算机可读存储介质,其主要目的在于解决现有技术中创建模拟接口不仅需要耗费大量人力资源,而且创建效率低下的问题。
为实现上述目的,本申请提供一种模拟接口的创建装置,该装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的接口创建程序,所述接口创建程序被所述处理器执行时实现如下步骤:
当接收到用户终端发送的模拟接口创建指令时,向所述用户终端发送接 口配置界面信息,以供所述用户终端根据所述接口配置界面信息展示接口配置界面;
获取用户基于所述接口配置界面设置的第三方系统信息和接口信息,并向所述用户终端发送参数配置界面信息,以供所述用户终端根据所述参数配置界面信息展示参数配置界面;
在接收到基于所述参数配置界面触发的确认指令时,获取用户基于所述参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则;
调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口。
此外,为实现上述目的,本申请还提供一种模拟接口的创建方法,该方法包括:
当接收到用户终端发送的模拟接口创建指令时,向所述用户终端发送接口配置界面信息,以供所述用户终端根据所述接口配置界面信息展示接口配置界面;
获取用户基于所述接口配置界面设置的第三方系统信息和接口信息,并向所述用户终端发送参数配置界面信息,以供所述用户终端根据所述参数配置界面信息展示参数配置界面;
在接收到基于所述参数配置界面触发的确认指令时,获取用户基于所述参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则;
调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有接口创建程序,所述接口创建程序可被一个或者多个处理器执行,以实现如上所述的模拟接口的创建方法的步骤。
本申请提出的模拟接口的创建装置、方法及计算机可读存储介质,在用户需要创建模拟接口时,向用户终端发送接口配置界面进行展示,用户可以 基于该界面设置第三方系统信息和接口信息,获取用户设置的这些信息存储至缓存区域,并将参数配置界面发送到用户终端显示,当接收到基于参数配置界面触发的确认指令时,获取用户基于参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则,调用与第三方系统信息匹配和接口信息匹配的代码框架,基于代码框架和用户输入的各个参数字段及规则生成模拟接口,通过本申请提出的发方案,提供配置展示页面,预先设置的代码框架可以被反复调用,使用人员可通过配置页面即可模拟需要支持的接口返回,易上手,没有编码能力的人员也可使用,节省了人力资源,并且提高了创建模拟接口的效率。
附图说明
图1为本申请模拟接口的创建装置第一实施例的示意图;
图2为本申请模拟接口的创建装置一实施例中接口创建程序的程序模块示意图;
图3为本申请模拟接口的创建方法第一实施例的流程图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种模拟接口的创建装置。参照图1所示,为本申请模拟接口的创建装置第一实施例的示意图。
在本实施例中,模拟接口的创建装置可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、便携计算机等终端设备。
该模拟接口的创建装置至少包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是模拟接口的创建装置的内部存储单元,例如该模拟接口的创建装置的硬盘。存储器11在另一 些实施例中也可以是模拟接口的创建装置的外部存储设备,例如模拟接口的创建装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括模拟接口的创建装置的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于模拟接口的创建装置的应用软件及各类数据,例如接口创建程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行接口创建程序等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置与其他电子设备之间建立通信连接。
图1仅示出了具有组件11-14以及接口创建程序的模拟接口的创建装置,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选地,该装置还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在模拟接口的创建装置中处理的信息以及用于显示可视化的用户界面。
在图1所示的装置实施例中,存储器11中存储有接口创建程序;处理器12执行存储器11中存储的接口创建程序时实现如下步骤:
当接收到用户终端发送的模拟接口创建指令时,向所述用户终端发送接口配置界面信息,以供所述用户终端根据所述接口配置界面信息展示接口配置界面。
获取用户基于所述接口配置界面设置的第三方系统信息和接口信息,并向所述用户终端发送参数配置界面信息,以供所述用户终端根据所述参数配置界面信息展示参数配置界面。
在本实施例中,用户终端与创建装置建立通讯连接,用户通过用户终端进行模拟接口的创建,例如通过web页面进行模拟接口的创建。创建装置接收用户发终端送的模拟接口创建指令时,向用户终端发送接口配置界面信息,用户终端根据接收到的界面信息展示对应的接口配置界面,该接口信息配置界面上展示需要用户配置的第三方系统信息和接口信息,具体地,在该实施例中,第三方系统信息一般是第三方系统名称,接口信息包括但不限于如下信息:接口类型、接口名称、接口描述等,其中,本实施例的装置可以实现各种类型接口的创建。用户通过该配置界面输入上述各个信息的值,其中,该配置界面上可以以选择框的形式展示可供使用的第三方系统、接口类型,用户根据需要从中选择。在创建装置中预先存储有分别与多个可选的第三方系统或接口类型对应的代码框架。
用户在接口配置界面设置完成第三方系统信息和接口信息后,将其提交到模拟接口的创建装置,模拟接口的创建装置获取用户设置的第三方系统信息和接口信息,存储到缓存区域。然后,模拟接口的创建装置向用户终端发送参数配置界面信息,用户终端根据接收到的参数配置界面信息展示对应的参数配置界面,用户通过该界面输入要创建的模拟接口的各个参数。
在接收到基于所述参数配置界面触发的确认指令时,获取用户基于所述参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则。
调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口。
用户需要通过参数配置界面输入以下信息:入参字段信息、出参字段信息以及为入参字段设置的入参字段规则。其中,入参字段信息和出参字段信息主要包括以下参数字段:字段名称、变量名称、字段类型、字段长度、是否必要字段、匹配入参字段规则。
在接收到基于参数配置界面触发的确认指令时,获取用户输入的输入参数字段和输出参数字段的配置信息以及配置规则,调用与该第三方系统和/接口类型对应的代码框架,并获取缓存区域中存储的模拟接口信息,将上述各个参数对应的值补充到获取的代码框架中,并对补充后的代码框架封装成为 一个可以被调用执行的模拟接口并存储,以供测试系统调用该接口实现模拟调用第三方系统的返回。
可选地,作为一种实施方式,接口创建程序还可被处理器12执行,以在所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,还实现如下步骤:
对所述入参字段信息、所述出参字段信息中的各个关键字段的格式和完整性进行校验;若所述各个关键字段没有缺失、且格式正确,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;若检测到有关键字段缺失,和/或关键字段不完整,则向用户终端发送补全关键字段的提示信息。
在调用代码框架进行数据补充之前,对各个字段数据的格式以及数据的完整性进行校验,以判断输入参数字段是否有效,当输入的参数关键字段缺失,和/或关键字段不完整时,判定用户输入的为无效参数字段,提示用户对参数字段进行修改。
可选地,作为另外一种实施方式,接口创建程序还可被处理器12执行,以在所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,还实现如下步骤:
从所述入参字段信息中获取用户设置的校验规则;
根据所述校验规则对所述入参字段信息中的各个入参字段的值、字段长度、字段类型进行验证,以判断各个入参字段是否合法;
若所述入参字段信息中的各个入参字段均合法,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
若检测到有入参字段不合法,则向所述用户终端发送入参字段不合法的提示信息,并在所述提示信息中显示不合法的字段内容。
在该实施方式中,通过用户设置的校验规则来检验对应的入参字段信息中各个入参字段的合法性,也就是说,用户输入的入参字段信息中包含有校验规则,在获取到入参字段信息中,通过其中的校验规则对输入参数字段的字段名称、变量名称、字段类型、字段长度等信息进行校验,判断是否合法,如果合法,则继续执行下一步,否则,需要提示用户终端对参数字段进行修改。
此外,需要说明的是,本实施例中,用户可以在参数配置界面为入参字段设置一个或者多个入参字段规则,当规则有多个时,将多个规则关联,以实现同时支持多业务场景返回。例如:
配置规则1:入参字段tradeacco的字段规则为“%1,%7”,则返回“{"code":"701001","message":"密码不符合安全规则"}”,也就是说,如果tradeacco的入参值的末尾为1或7,则模拟返回“{"code":"701001","message":"密码不符合安全规则"}”。配置规则2:入参字段tradeacco的字段规则为“%2,%8”,则返回“{"code":"${Random(100000,999999,)}","message":"密码不符合安全规则"}”,也就是说,如果tradeacco的入参值的末尾为2或8,则模拟返回“{"code":"701001","message":"密码不符合安全规则"}”,配置默认返回“{"code":"000000","message":"处理成功"}”,即当入参值的末尾既没有命中规则1,也没有命中规则2时,默认返回成功。
本实施例提出的模拟接口的创建装置,在用户需要创建模拟接口时,向用户终端发送接口配置界面进行展示,用户可以基于该界面设置第三方系统信息和接口信息,获取用户设置的这些信息存储至缓存区域,并将参数配置界面发送到用户终端显示,当接收到基于参数配置界面触发的确认指令时,获取用户基于参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则,调用与第三方系统信息匹配和接口信息匹配的代码框架,基于代码框架和用户输入的各个参数字段及规则生成模拟接口,通过本申请提出的发方案,提供配置展示页面,预先设置的代码框架可以被反复调用,使用人员可通过配置页面即可模拟需要支持的接口返回,易上手,没有编码能力的人员也可使用,节省了人力资源,并且提高了创建模拟接口的效率。
基于第一实施例提出本申请模拟接口的创建装置的第二实施例。在本实施例中,接口创建程序还可被处理器12执行,以实现如下步骤:
当接收到用户终端发送的接口修改请求时,确定所述接口修改请求对应的模拟接口,向所述用户终端发送参数修改界面信息,以供用户终端根据参数修改界面信息展示参数修改界面,其中,所述参数修改界面上显示有该模拟接口的各个参数字段;
接收用户终端基于参数修改界面发送的修改后的入参字段信息、出参字 段信息和/或为入参字段设置的入参字段规则;
根据修改后的入参字段信息、出参字段信息和/或为入参字段设置的入参字段规则修改该模拟接口。
现有的模拟接口在测试过程中需要对接口参数、入参字段规则等信息改动时,需要重新编码,因此需要一定编码经验的开发人员才能进行模拟接口的开发与修改。而本实施例中的模拟接口的创建装置是通过用户设置接口参数,将这些参数补充到预先编写好的代码框架中来创建的,因此,通过本实施例的装置可以直接对接口参数、入参字段规则等信息进行修改,不需要重新编码。
可选地,在其他的实施例中,接口创建程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述接口创建程序在模拟接口的创建装置中的执行过程。
例如,参照图2所示,为本申请模拟接口的创建装置一实施例中的接口创建程序的程序模块示意图,该实施例中,接口创建程序可以被分割为信息发送模块10、数据获取模块20和接口生成模块30,示例性地:
信息发送模块10用于:当接收到用户终端发送的模拟接口创建指令时,向所述用户终端发送接口配置界面信息,以供所述用户终端根据所述接口配置界面信息展示接口配置界面;
数据获取模块20用于:获取用户基于所述接口配置界面设置的第三方系统信息和接口信息;
信息发送模块10还用于:向所述用户终端发送参数配置界面信息,以供所述用户终端根据所述参数配置界面信息展示参数配置界面;
数据获取模块20还用于:在接收到基于所述参数配置界面触发的确认指令时,获取用户基于所述参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则;
接口生成模块30用于:调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口。
上述信息发送模块10、数据获取模块20和接口生成模块30等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。
此外,本申请还提供一种模拟接口的创建方法。参照图3所示,为本申请模拟接口的创建方法第一实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现,以下实施例中以模拟接口的创建装置作为方法的执行主体进行说明。
在本实施例中,模拟接口的创建方法包括:
步骤S10,当接收到用户终端发送的模拟接口创建指令时,向所述用户终端发送接口配置界面信息,以供所述用户终端根据所述接口配置界面信息展示接口配置界面。
步骤S20,获取用户基于所述接口配置界面设置的第三方系统信息和接口信息,并向所述用户终端发送参数配置界面信息,以供所述用户终端根据所述参数配置界面信息展示参数配置界面。
在本实施例中,用户终端与创建装置建立通讯连接,用户通过用户终端进行模拟接口的创建,例如通过web页面进行模拟接口的创建。创建装置接收用户发终端送的模拟接口创建指令时,向用户终端发送接口配置界面信息,用户终端根据接收到的界面信息展示对应的接口配置界面,该接口信息配置界面上展示需要用户配置的第三方系统信息和接口信息,具体地,在该实施例中,第三方系统信息一般是第三方系统名称,接口信息包括但不限于如下信息:接口类型、接口名称、接口描述等,其中,本实施例的装置可以实现各种类型接口的创建。用户通过该配置界面输入上述各个信息的值,其中,该配置界面上可以以选择框的形式展示可供使用的第三方系统、接口类型,用户根据需要从中选择。在创建装置中预先存储有分别与多个可选的第三方系统或接口类型对应的代码框架。
用户在接口配置界面设置完成第三方系统信息和接口信息后,将其提交到模拟接口的创建装置,模拟接口的创建装置获取用户设置的第三方系统信息和接口信息,存储到缓存区域。然后,模拟接口的创建装置向用户终端发送参数配置界面信息,用户终端根据接收到的参数配置界面信息展示对应的参数配置界面,用户通过该界面输入要创建的模拟接口的各个参数。
步骤S30,在接收到基于所述参数配置界面触发的确认指令时,获取用户 基于所述参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则。
步骤S40,调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口。
用户需要通过参数配置界面输入以下信息:入参字段信息、出参字段信息以及为入参字段设置的入参字段规则。其中,入参字段信息和出参字段信息主要包括以下参数字段:字段名称、变量名称、字段类型、字段长度、是否必要字段、匹配入参字段规则。
在接收到基于参数配置界面触发的确认指令时,获取用户输入的输入参数字段和输出参数字段的配置信息以及配置规则,调用与该第三方系统和/接口类型对应的代码框架,并获取缓存区域中存储的模拟接口信息,将上述各个参数对应的值补充到获取的代码框架中,并对补充后的代码框架封装成为一个可以被调用执行的模拟接口并存储,以供测试系统调用该接口实现模拟调用第三方系统的返回。
可选地,作为一种实施方式,调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,该方法还包括如下步骤:
对所述入参字段信息、所述出参字段信息中的各个关键字段的格式和完整性进行校验;若所述各个关键字段没有缺失、且格式正确,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;若检测到有关键字段缺失,和/或关键字段不完整,则向用户终端发送补全关键字段的提示信息。
在调用代码框架进行数据补充之前,对各个字段数据的格式以及数据的完整性进行校验,以判断输入参数字段是否有效,当输入的参数关键字段缺失,和/或关键字段不完整时,判定用户输入的为无效参数字段,提示用户对参数字段进行修改。
可选地,作为另外一种实施方式,调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,该方法还包括如下步骤:
从所述入参字段信息中获取用户设置的校验规则;
根据所述校验规则对所述入参字段信息中的各个入参字段的值、字段长 度、字段类型进行验证,以判断各个入参字段是否合法;
若所述入参字段信息中的各个入参字段均合法,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
若检测到有入参字段不合法,则向所述用户终端发送入参字段不合法的提示信息,并在所述提示信息中显示不合法的字段内容。
在该实施方式中,通过用户设置的校验规则来检验对应的入参字段信息中各个入参字段的合法性,也就是说,用户输入的入参字段信息中包含有校验规则,在获取到入参字段信息中,通过其中的校验规则对输入参数字段的字段名称、变量名称、字段类型、字段长度等信息进行校验,判断是否合法,如果合法,则继续执行下一步,否则,需要提示用户终端对参数字段进行修改。
此外,需要说明的是,本实施例中,用户可以在参数配置界面为入参字段设置一个或者多个入参字段规则,当规则有多个时,将多个规则关联,以实现同时支持多业务场景返回。例如:
配置规则1:入参字段tradeacco的字段规则为“%1,%7”,则返回“{"code":"701001","message":"密码不符合安全规则"}”,也就是说,如果tradeacco的入参值的末尾为1或7,则模拟返回“{"code":"701001","message":"密码不符合安全规则"}”。配置规则2:入参字段tradeacco的字段规则为“%2,%8”,则返回“{"code":"${Random(100000,999999,)}","message":"密码不符合安全规则"}”,也就是说,如果tradeacco的入参值的末尾为2或8,则模拟返回“{"code":"701001","message":"密码不符合安全规则"}”,配置默认返回“{"code":"000000","message":"处理成功"}”,即如果入参值的末尾既没有命中规则1,也没有命中规则2时,默认返回成功。
本实施例提出的模拟接口的创建方法,在用户需要创建模拟接口时,向用户终端发送接口配置界面进行展示,用户可以基于该界面设置第三方系统信息和接口信息,获取用户设置的这些信息存储至缓存区域,并将参数配置界面发送到用户终端显示,当接收到基于参数配置界面触发的确认指令时,获取用户基于参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则,调用与第三方系统信息匹配和接口信息匹配的代码框架,基于代码框架和用户输入的各个参数字段及规则生成模拟接口,通 过本申请提出的发方案,提供配置展示页面,预先设置的代码框架可以被反复调用,使用人员可通过配置页面即可模拟需要支持的接口返回,易上手,没有编码能力的人员也可使用,节省了人力资源,并且提高了创建模拟接口的效率。
基于第一实施例提出本申请模拟接口的创建方法的第二实施例。在本实施例中,该方法还可以实现如下步骤:
当接收到用户终端发送的接口修改请求时,确定所述接口修改请求对应的模拟接口,向所述用户终端发送参数修改界面信息,以供用户终端根据参数修改界面信息展示参数修改界面,其中,所述参数修改界面上显示有该模拟接口的各个参数字段;
接收用户终端基于参数修改界面发送的修改后的入参字段信息、出参字段信息和/或为入参字段设置的入参字段规则;
根据修改后的入参字段信息、出参字段信息和/或为入参字段设置的入参字段规则修改该模拟接口。
现有的模拟接口在测试过程中需要对接口参数、入参字段规则等信息改动时,需要重新编码,因此需要一定编码经验的开发人员才能进行模拟接口的开发与修改。而本实施例中的模拟接口的创建装置是通过用户设置接口参数,将这些参数补充到预先编写好的代码框架中来创建的,因此,通过本实施例的装置可以直接对接口参数、入参字段规则等信息进行修改,不需要重新编码。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有接口创建程序,所述接口创建程序可被一个或多个处理器执行,以实现如下操作:
当接收到用户终端发送的模拟接口创建指令时,向所述用户终端发送接口配置界面信息,以供所述用户终端根据所述接口配置界面信息展示接口配置界面;
获取用户基于所述接口配置界面设置的第三方系统信息和接口信息,并向所述用户终端发送参数配置界面信息,以供所述用户终端根据所述参数配置界面信息展示参数配置界面;
在接收到基于所述参数配置界面触发的确认指令时,获取用户基于所述 参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则;
调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口。
本申请计算机可读存储介质具体实施方式与上述模拟接口的创建装置和方法各实施例基本相同,在此不作累述。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种模拟接口的创建装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的接口创建程序,所述接口创建程序被所述处理器执行时实现如下步骤:
    当接收到用户终端发送的模拟接口创建指令时,向所述用户终端发送接口配置界面信息,以供所述用户终端根据所述接口配置界面信息展示接口配置界面;
    获取用户基于所述接口配置界面设置的第三方系统信息和接口信息,并向所述用户终端发送参数配置界面信息,以供所述用户终端根据所述参数配置界面信息展示参数配置界面;
    在接收到基于所述参数配置界面触发的确认指令时,获取用户基于所述参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则;
    调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口。
  2. 如权利要求1所述的模拟接口的创建装置,其特征在于,所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口的步骤包括:
    调用与所述第三方系统信息匹配和接口信息匹配的代码框架,将所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则分别补充到所述代码框架中的对应位置处;
    将补充后的代码框架封装为模拟接口。
  3. 如权利要求2所述的模拟接口的创建装置,其特征在于,所述接口创建程序还可被所述处理器执行,以在所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,还实现如下步骤:
    对所述入参字段信息、所述出参字段信息中的各个关键字段的格式和完整性进行校验;
    若所述各个关键字段没有缺失、且格式正确,则执行所述调用与所述第 三方系统信息匹配和接口信息匹配的代码框架的步骤;
    若检测到有关键字段缺失,和/或关键字段不完整,则向用户终端发送补全关键字段的提示信息。
  4. 如权利要求2所述的模拟接口的创建装置,其特征在于,所述接口创建程序还可被所述处理器执行,以在所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,还实现如下步骤:
    从所述入参字段信息中获取用户设置的校验规则;
    根据所述校验规则对所述入参字段信息中的各个入参字段的值、字段长度、字段类型进行验证,以判断各个入参字段是否合法;
    若所述入参字段信息中的各个入参字段均合法,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
    若检测到有入参字段不合法,则向所述用户终端发送入参字段不合法的提示信息,并在所述提示信息中显示不合法的字段内容。
  5. 如权利要求3所述的模拟接口的创建装置,其特征在于,所述接口创建程序还可被所述处理器执行,以在所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,还实现如下步骤:
    从所述入参字段信息中获取用户设置的校验规则;
    根据所述校验规则对所述入参字段信息中的各个入参字段的值、字段长度、字段类型进行验证,以判断各个入参字段是否合法;
    若所述入参字段信息中的各个入参字段均合法,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
    若检测到有入参字段不合法,则向所述用户终端发送入参字段不合法的提示信息,并在所述提示信息中显示不合法的字段内容。
  6. 如权利要求3所述的模拟接口的创建装置,其特征在于,所述接口信息包括接口类型、接口名称和接口描述;所述入参字段信息和所述出参字段信息包括以下字段:参数字段名称、是否是必要字段和校验规则。
  7. 如权利要求4所述的模拟接口的创建装置,其特征在于,所述接口信息包括接口类型、接口名称和接口描述;所述入参字段信息和所述出参字段信息包括以下字段:参数字段名称、是否是必要字段和校验规则。
  8. 一种模拟接口的创建方法,其特征在于,所述方法包括:
    当接收到用户终端发送的模拟接口创建指令时,向所述用户终端发送接口配置界面信息,以供所述用户终端根据所述接口配置界面信息展示接口配置界面;
    获取用户基于所述接口配置界面设置的第三方系统信息和接口信息,并向所述用户终端发送参数配置界面信息,以供所述用户终端根据所述参数配置界面信息展示参数配置界面;
    在接收到基于所述参数配置界面触发的确认指令时,获取用户基于所述参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则;
    调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口。
  9. 如权利要求8所述的模拟接口的创建方法,其特征在于,所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口的步骤包括:
    调用与所述第三方系统信息匹配和接口信息匹配的代码框架,将所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则分别补充到所述代码框架中的对应位置处;
    将补充后的代码框架封装为模拟接口。
  10. 如权利要求9所述的模拟接口的创建方法,其特征在于,所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,所述方法还包括步骤:
    对所述入参字段信息、所述出参字段信息中的各个关键字段的格式和完整性进行校验;
    若所述各个关键字段没有缺失、且格式正确,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
    若检测到有关键字段缺失,和/或关键字段不完整,则向用户终端发送补全关键字段的提示信息。
  11. 如权利要求9所述的模拟接口的创建方法,其特征在于,所述调用 与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,所述方法还包括步骤:
    从所述入参字段信息中获取用户设置的校验规则;
    根据所述校验规则对所述入参字段信息中的各个入参字段的值、字段长度、字段类型进行验证,以判断各个入参字段是否合法;
    若所述入参字段信息中的各个入参字段均合法,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
    若检测到有入参字段不合法,则向所述用户终端发送入参字段不合法的提示信息,并在所述提示信息中显示不合法的字段内容。
  12. 如权利要求10所述的模拟接口的创建方法,其特征在于,所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,所述方法还包括步骤:
    从所述入参字段信息中获取用户设置的校验规则;
    根据所述校验规则对所述入参字段信息中的各个入参字段的值、字段长度、字段类型进行验证,以判断各个入参字段是否合法;
    若所述入参字段信息中的各个入参字段均合法,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
    若检测到有入参字段不合法,则向所述用户终端发送入参字段不合法的提示信息,并在所述提示信息中显示不合法的字段内容。
  13. 如权利要求10所述的模拟接口的创建方法,其特征在于,所述接口信息包括接口类型、接口名称和接口描述;所述入参字段信息和所述出参字段信息包括以下字段:参数字段名称、是否是必要字段和校验规则。
  14. 如权利要求11所述的模拟接口的创建方法,其特征在于,所述接口信息包括接口类型、接口名称和接口描述;所述入参字段信息和所述出参字段信息包括以下字段:参数字段名称、是否是必要字段和校验规则。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有接口创建程序,所述接口创建程序可被一个或者多个处理器执行,以实现如下步骤:
    当接收到用户终端发送的模拟接口创建指令时,向所述用户终端发送接口配置界面信息,以供所述用户终端根据所述接口配置界面信息展示接口配 置界面;
    获取用户基于所述接口配置界面设置的第三方系统信息和接口信息,并向所述用户终端发送参数配置界面信息,以供所述用户终端根据所述参数配置界面信息展示参数配置界面;
    在接收到基于所述参数配置界面触发的确认指令时,获取用户基于所述参数配置界面输入的入参字段信息、出参字段信息以及为入参字段设置的入参字段规则;
    调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架,根据所述代码框架和所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则生成模拟接口的步骤包括:
    调用与所述第三方系统信息匹配和接口信息匹配的代码框架,将所述入参字段信息、出参字段信息以及为入参字段设置的入参字段规则分别补充到所述代码框架中的对应位置处;
    将补充后的代码框架封装为模拟接口。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述接口创建程序还可被所述处理器执行,以在所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,还实现如下步骤:
    对所述入参字段信息、所述出参字段信息中的各个关键字段的格式和完整性进行校验;
    若所述各个关键字段没有缺失、且格式正确,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
    若检测到有关键字段缺失,和/或关键字段不完整,则向用户终端发送补全关键字段的提示信息。
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述接口创建程序还可被所述处理器执行,以在所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,还实现如下步骤:
    从所述入参字段信息中获取用户设置的校验规则;
    根据所述校验规则对所述入参字段信息中的各个入参字段的值、字段长度、字段类型进行验证,以判断各个入参字段是否合法;
    若所述入参字段信息中的各个入参字段均合法,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
    若检测到有入参字段不合法,则向所述用户终端发送入参字段不合法的提示信息,并在所述提示信息中显示不合法的字段内容。
  19. 如权利要求17所述的计算机可读存储介质,其特征在于,所述接口创建程序还可被所述处理器执行,以在所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤之前,还实现如下步骤:
    从所述入参字段信息中获取用户设置的校验规则;
    根据所述校验规则对所述入参字段信息中的各个入参字段的值、字段长度、字段类型进行验证,以判断各个入参字段是否合法;
    若所述入参字段信息中的各个入参字段均合法,则执行所述调用与所述第三方系统信息匹配和接口信息匹配的代码框架的步骤;
    若检测到有入参字段不合法,则向所述用户终端发送入参字段不合法的提示信息,并在所述提示信息中显示不合法的字段内容。
  20. 如权利要求17所述的计算机可读存储介质,其特征在于,所述接口信息包括接口类型、接口名称和接口描述;所述入参字段信息和所述出参字段信息包括以下字段:参数字段名称、是否是必要字段和校验规则。
PCT/CN2018/089184 2018-03-06 2018-05-31 模拟接口的创建装置、方法及计算机可读存储介质 WO2019169759A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810183370.1A CN108446225A (zh) 2018-03-06 2018-03-06 模拟接口的创建装置、方法及计算机可读存储介质
CN201810183370.1 2018-03-06

Publications (1)

Publication Number Publication Date
WO2019169759A1 true WO2019169759A1 (zh) 2019-09-12

Family

ID=63193777

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/089184 WO2019169759A1 (zh) 2018-03-06 2018-05-31 模拟接口的创建装置、方法及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108446225A (zh)
WO (1) WO2019169759A1 (zh)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109522218A (zh) * 2018-10-19 2019-03-26 平安科技(深圳)有限公司 接口测试方法、装置、计算机设备和存储介质
CN109783859A (zh) * 2018-12-13 2019-05-21 重庆金融资产交易所有限责任公司 模型构建方法、装置及计算机可读存储介质
CN109783367B (zh) * 2018-12-15 2023-10-27 中国平安人寿保险股份有限公司 接口测试方法、装置、计算机装置及存储介质
CN109902003B (zh) * 2019-02-19 2022-06-14 创新先进技术有限公司 测试脚本的生成方法及装置
CN110275831B (zh) * 2019-06-18 2023-10-27 广州华多网络科技有限公司 协议接口的mock数据校验方法和装置
CN110413354B (zh) * 2019-08-01 2022-06-07 苏州浪潮智能科技有限公司 一种实现与第三方平台交互的方法、设备以及存储介质
CN110716975B (zh) * 2019-10-08 2023-08-08 杭州数政科技有限公司 一种数据接口生成方法以及数据接口共享平台
CN111221517A (zh) * 2019-10-12 2020-06-02 中国平安财产保险股份有限公司 一种模型创建方法、装置、计算机设备和可读存储介质
CN110990276A (zh) * 2019-11-29 2020-04-10 泰康保险集团股份有限公司 接口字段自动化测试方法、装置和存储介质
CN111324394B (zh) * 2020-01-23 2023-05-12 北京恒华伟业科技股份有限公司 系统集成的方法和装置
CN111459588A (zh) * 2020-03-27 2020-07-28 深圳融安网络科技有限公司 大数据模型设置方法、终端设备及计算机可读存储介质
CN112764751A (zh) * 2021-01-27 2021-05-07 深圳市酷开网络科技股份有限公司 接口生成方法和装置、接口请求方法和装置及存储介质
CN115811513B (zh) * 2023-02-08 2023-06-02 广州市玄武无线科技股份有限公司 第三方接口请求设计方法、装置、存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002073860A2 (en) * 2001-03-08 2002-09-19 Adler Richard M System for analyzing strategic business decisions
US20050102127A1 (en) * 2003-11-11 2005-05-12 The Boeing Company Systems, methods and computer program products for modeling an event in a spreadsheet environment
CN108427631A (zh) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 一种应用测试系统、方法、电子设备和可读存储介质

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100547562C (zh) * 2006-10-18 2009-10-07 国际商业机器公司 自动生成可再现运行时问题的单元测试用例的方法和系统
CN101576843A (zh) * 2008-05-07 2009-11-11 阿里巴巴集团控股有限公司 一种测试应用程序接口的方法和装置
CN103136095A (zh) * 2011-11-28 2013-06-05 阿里巴巴集团控股有限公司 一种测试应用程序接口的方法、装置及系统
CN103297475B (zh) * 2012-03-01 2017-03-01 阿里巴巴集团控股有限公司 Mock服务系统及Mock服务的处理方法
CN104572463B (zh) * 2014-12-31 2018-04-03 广州酷狗计算机科技有限公司 测试接口信息的方法及装置
CN106874174B (zh) * 2015-12-11 2020-08-21 阿里巴巴集团控股有限公司 接口测试及功能测试的实现方法和装置
CN107179984A (zh) * 2016-03-10 2017-09-19 北京京东尚科信息技术有限公司 一种接口mock方法及接口测试方法
CN107368405B (zh) * 2016-05-11 2021-11-09 腾讯科技(北京)有限公司 测试系统、测试方法、mock平台、拦截器和客户端
CN106528400A (zh) * 2016-09-22 2017-03-22 深圳峰创智诚科技有限公司 Mock测试方法和装置
CN106502916A (zh) * 2016-12-05 2017-03-15 广州唯品会信息科技有限公司 软件测试方法及系统
CN107402884A (zh) * 2017-07-31 2017-11-28 深圳乐信软件技术有限公司 生成接口测试代码的方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002073860A2 (en) * 2001-03-08 2002-09-19 Adler Richard M System for analyzing strategic business decisions
US20050102127A1 (en) * 2003-11-11 2005-05-12 The Boeing Company Systems, methods and computer program products for modeling an event in a spreadsheet environment
CN108427631A (zh) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 一种应用测试系统、方法、电子设备和可读存储介质

Also Published As

Publication number Publication date
CN108446225A (zh) 2018-08-24

Similar Documents

Publication Publication Date Title
WO2019169759A1 (zh) 模拟接口的创建装置、方法及计算机可读存储介质
US20200143051A1 (en) Security scanning method and apparatus for mini program, and electronic device
US9524284B2 (en) System, method and computer readable medium for recording authoring events with web page content
US8983935B2 (en) Methods for utilizing a javascript emulator in a web content proxy server and devices thereof
WO2018120722A1 (zh) 异步接口测试方法、终端、设备、系统及存储介质
CN110602052A (zh) 微服务处理方法及服务器
CN109308285A (zh) 数据库脚本管理方法、装置、计算机设备及存储介质
WO2022252637A1 (zh) 基于浏览器的rpa实现方法、装置、设备及介质
CN108845839B (zh) 应用页面加载方法、装置及计算机可读存储介质
JP2009529720A5 (zh)
MX2013013970A (es) Sistema y metodo para conservar referencias en los aislamientos de procesos.
WO2020015191A1 (zh) 业务规则的发布管理方法、电子装置及可读存储介质
CN112558946A (zh) 一种生成代码的方法、装置、设备和计算机可读存储介质
WO2021249356A1 (zh) 表单数据校验方法、系统、服务器和用户终端
WO2019148721A1 (zh) 电子装置、互联网服务系统风险预警方法及存储介质
CN113448862B (zh) 软件版本测试方法、装置及计算机设备
CN111797020A (zh) 基于动态字节码的mock数据方法及装置
WO2020232868A1 (zh) 一种数据发送方法及相关设备
WO2021169124A1 (zh) 安装软件包至目标主机的方法、装置和计算机设备
CN108021445B (zh) 内存优化方法、装置、系统及计算机可读存储介质
MacIntyre et al. Pro PHP programming
WO2022062478A1 (zh) 一种任意账号密码重置逻辑漏洞的检测方法、装置及介质
CN110727595A (zh) 一种应用登录界面识别方法、智能终端及存储介质
CN114189553A (zh) 一种流量回放方法、系统及计算设备
CN113467784A (zh) 应用程序处理方法及其装置、计算机可读存储介质

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: 18908885

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 09.12.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18908885

Country of ref document: EP

Kind code of ref document: A1