Baffle service system and method

Through the interface generation and interactive control module of the baffle service system, the interface information table and response strategy table are generated, intercepting and simulating responses, solving the problems of high functional verification cost and small test scope of application software on third-party platforms, and achieving high efficiency Functional verification.

CN118656299APending Publication Date: 2024-09-17XIAMEN LEELEN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410818265.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

When application software uses third-party platforms for functional verification, it leads to high development costs and small functional testing scope, especially due to the limitations of third-party platforms on performance stress testing.

Method used

Provides a baffle service system, including an interface generation module and an interactive control module. It generates an interface information table and a response policy table through the interface configuration interface, intercepts request information from the application side, and generates a response based on the matching interface information table and response policy table. information to implement simulated responses.

Benefits of technology

It effectively reduces application software development costs, expands the scope of functional testing, simplifies methods, and achieves effective functional verification of application software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656299A
    Figure CN118656299A
Patent Text Reader

Abstract

The invention relates to the technical field of testing, in particular to a baffle service system and method, and the system comprises an interface generation module which is used for receiving an interface generation mode configured by a user through an interface configuration interface and interface parameters determined according to the interface generation mode, generating an interface information table according to the interface generation mode and the interface parameters, and generating an interface response strategy table according to the interface parameters; and the interaction control module is used for intercepting request information sent by an application party, matching the corresponding interface information table and interface response strategy table according to the request information, and generating response information of the request information based on the matched interface information table and interface response strategy table. Therefore, the problems that the application software development cost is high and the function test range is small due to the fact that the application software carries out function verification through a third-party platform can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a baffle service system and method. Background Art

[0002] In the iterative development process of application software, it is generally necessary to perform functional verification in multiple environments such as development environment, test environment, pre-production environment and production environment. In specific implementation, most of them use interactive verification with the corresponding third-party platform. However, when calling the third-party platform service, you need to provide the corresponding account and password and other information. In reality, most of these accounts and passwords need to be purchased, which undoubtedly increases the development cost. In addition, for some functional tests, the third-party platform does not support it, and the scope of functional testing is small. For example, when performing performance stress testing on application software, the third-party platform interface is generally set with a query rate per second (Query Per Second, QPS) limit, which makes it impossible to perform performance stress testing. Summary of the invention

[0003] In view of this, the embodiments of the present application provide a baffle service system and method, which can effectively solve the problem that application software uses a third-party platform for function verification, resulting in high application software development costs and a small functional testing scope.

[0004] In a first aspect, an embodiment of the present application provides a baffle service system, including:

[0005] An interface generation module, used to receive an interface generation mode configured by a user through an interface configuration interface, and interface parameters determined according to the interface generation mode, and to generate an interface information table according to the interface generation mode and the interface parameters, and to generate an interface response strategy table according to the interface parameters;

[0006] The interactive control module is used to intercept the request information sent by the application party, match the corresponding interface information table and interface response strategy table according to the request information, and generate response information for the request information based on the matched interface information table and interface response strategy table.

[0007] In some embodiments, the interface generation method includes a JsonSchema generation method; the interface parameters include basic parameters and response parameters; wherein the basic parameters include an interface path and a request method type;

[0008] The interface generation module is specifically used for:

[0009] Receive the JsonSchema generation mode configured by the user for the interface generation mode through the interface configuration interface, and display the basic parameter configuration area and the response parameter editing area in the interface configuration interface;

[0010] Generate a JsonSchema data structure according to the response parameters and response parameter types input by the user through the response parameter editing area; construct a local response strategy, wherein the local response strategy is used to generate the response information according to the corresponding JsonSchema data structure; generate the interface response strategy table according to the local response strategy and a preset interface identifier;

[0011] Generate an interface information table according to the JsonSchema data structure, the interface identifier, and the interface path and request method type input by the user through the basic parameter configuration area;

[0012] The interactive control module is specifically used to parse the request information, obtain the interface path and the request method type, and match the corresponding interface information table according to the interface path and the request method type, match the interface response strategy table according to the interface identifier in the interface information table, and generate the response information according to the JsonSchema data structure in the interface information table using the local response strategy in the interface response strategy table.

[0013] In some embodiments, the interface generation method includes an information configuration generation method; the interface parameters include response parameters and request parameters;

[0014] The interface generation module is specifically used for:

[0015] Receiving information configuration generation mode configured by a user for an interface generation mode through an interface configuration interface, and displaying a basic parameter configuration area, a request parameter editing area, and a response parameter editing area on the interface configuration interface;

[0016] Determine local response data according to the response parameter, response parameter type and response parameter value input by the user through the response parameter editing area; generate the interface response strategy table according to the interface identifier, the request parameter and the local response data;

[0017] Generate an interface information table according to the interface identifier, the request parameters input by the user through the request parameter editing area, the interface path and the request method type input through the basic parameter configuration area;

[0018] The interactive control module is specifically used to parse the request information, obtain the interface path and the request method type, match the corresponding interface information table according to the interface path, the request method type and the request parameters, match the interface response strategy table according to the interface identifier in the interface information table, and generate the response information according to the local response data in the interface response strategy table.

[0019] In some embodiments, the interaction control module is further used to detect whether the JsonSchema data structure exists in the interface information table before generating the response information;

[0020] If it is confirmed that the JsonSchema data structure exists, then according to the JsonSchema data structure in the interface information table, the response information is generated using the response strategy in the interface response strategy table;

[0021] If it is confirmed that the JsonSchema data structure does not exist, the response information is generated according to the response data in the interface response strategy table.

[0022] In some embodiments, the interface generation module is further used to construct a global response strategy according to business requirements and add the global response data to the interface information table;

[0023] The interaction control module is further configured to generate the response information using the global response strategy according to the JsonSchema data structure when no local response strategy can be found in the matching interface response strategy table;

[0024] Alternatively, the interface generation module is further configured to determine global response data according to the global response parameter, global response parameter type and global response parameter value input by the user through the interface configuration interface, and add the global response policy to the interface information table;

[0025] The interaction control module is further configured to generate the response information according to the global response data when no local response data can be found in the matching interface response strategy table.

[0026] In some embodiments, the baffle service system further includes: a project management module;

[0027] The interface generation module is further configured to receive a project identifier input by a user through the basic parameter configuration area; and add the project identifier to the interface information table and the interface response strategy table;

[0028] The interactive control module is further used to parse the request information to obtain a project identifier, and match the corresponding interface information table and interface response strategy table according to the project identifier;

[0029] The interface generation module is further configured to generate a project management table according to the project identifier input by the user through the basic parameter configuration area and the interface classification selected;

[0030] The project management module is used to search for the corresponding interface information table and interface response strategy table according to the project identifier and the interface classification in the project management table, and display the configuration information corresponding to the basic parameters, response parameters and request parameters of each interface belonging to the same project.

[0031] In some embodiments, the baffle service system further comprises: a debugging module;

[0032] The debugging module is used to trigger the sending of test request information to the interactive control module through the debugging buttons corresponding to the various interfaces, so as to call the corresponding interface and output the corresponding response information through the debugging interface.

[0033] In some embodiments, the baffle service system further includes an import and export module;

[0034] The import and export module is used to export the local response data or the JsonSchema data structure respectively to obtain the corresponding josn data file; and import the josn data file to obtain the corresponding local response data or the JsonSchema data structure.

[0035] In some embodiments, the baffle service system further includes a comprehensive authority management module;

[0036] The comprehensive authority management module is used to create each user and each role according to the organizational structure and project, and configure interface operation authority and authority for each role to operate each interface in the baffle service system.

[0037] In a second aspect, an embodiment of the present application provides a baffle service testing method, which is applied to a baffle service system provided in the first aspect of the present application, and the method includes:

[0038] Intercept the request information sent by the application, match the corresponding interface information table and interface response strategy table according to the request information, and generate response information according to the interface information table and the interface response strategy table.

[0039] The embodiments of the present application have the following beneficial effects:

[0040] In this application, the interface parameters are configured through the interface configuration interface to generate an interface response strategy table and an interface information table. Then, the request information sent by the application is intercepted, and the corresponding interface information table and interface response strategy table are matched according to the request information, and the response information of the request information is generated based on the matched interface information table and interface response strategy table. The implementation method is simple and can effectively solve the problem that the application software uses a third-party platform for function verification, resulting in high application software development costs and a small functional test scope. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 A first structural block diagram of the baffle service system of an embodiment of the present application is shown;

[0043] Figure 2 A second structural block diagram of the baffle service system of an embodiment of the present application is shown;

[0044] Figure 3 A schematic diagram showing a basic parameter configuration area in a baffle service system according to an embodiment of the present application is shown;

[0045] Figure 4 A schematic diagram showing a response parameter editing area in the baffle service system of an embodiment of the present application is shown;

[0046] Figure 5 A schematic diagram showing a request parameter editing area in a baffle service system according to an embodiment of the present application is shown;

[0047] Figure 6 A third structural block diagram of the baffle service system of an embodiment of the present application is shown;

[0048] Figure 7 A timing diagram showing a method for verifying identity information of an application party of a comprehensive authority management module in a baffle service system according to an embodiment of the present application is shown;

[0049] Figure 8 A schematic diagram showing a flow chart of a baffle service testing method according to an embodiment of the present application is shown;

[0050] Fig. 9 A timing diagram of a baffle service test method according to an embodiment of the present application is shown;

[0051] Fig.10 Another flow chart of the baffle service testing method according to an embodiment of the present application is shown.

[0052] Description of main component symbols:

[0053] 100 -interface generation module; 200 -interaction control module; 300 -interface configuration interface; 400 -project management module; 500 -debugging module; 600 -import and export module; 700 -comprehensive authority management module. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0055] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0056] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.

[0057] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0058] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0059] When the application software is tested, in fact, except for the pre-production environment and the production environment, which require real data, other environments only need to call the third-party interface to simulate and return the corresponding response information. Therefore, in order to effectively solve the problem that the application software uses a third-party platform for function verification, resulting in high application software development costs and a small functional test scope, this application proposes a baffle service system and method.

[0060] The baffle service system is described below in conjunction with some specific embodiments.

[0061] Figure 11 shows a structural block diagram of the baffle service system of the embodiment of the present application. Exemplarily, the baffle service system includes: an interface generation module 100 and an interaction control module 200, such as Figure 2 As shown, it also includes an interface configuration interface 300. It can be understood that the baffle service system is divided into three layers, namely, a UI layer, a service layer and a data layer. The UI layer includes an interface configuration interface 300. The data layer includes a database for storing generated data. The service layer includes an interface generation module 100 and an interactive control module 200, etc.

[0062] The interface configuration interface 300 includes a basic parameter configuration area, a request parameter configuration area, and a response parameter editing area. The basic parameter configuration area is used to configure the basic parameters in the interface parameters, the response parameter editing area is used to add, delete, and modify the response parameters in the interface parameters, and the request parameter configuration area is used to add, delete, and modify the request parameters in the interface parameters.

[0063] The interface generation module 100 is used to receive the interface generation method configured by the user through the interface configuration interface 300, and the interface parameters determined according to the interface generation method, and to generate an interface information table according to the interface generation method and the interface parameters, and to generate an interface response strategy table according to the interface parameters.

[0064] The interactive control module 200 is used to intercept the request information sent by the application, match the corresponding interface information table and interface response strategy table according to the request information, and generate response information for the request information based on the matched interface information table and interface response strategy table. When intercepting the request information sent by the application, an interceptor can be used, which is not limited by this application.

[0065] Furthermore, the interface generation method includes a JsonSchema generation method; the interface parameters include basic parameters and response parameters; wherein the basic parameters include an interface path and a request method type. The request method type includes a POST request and a GET request, etc.

[0066] The interface generation module 100 is specifically used for:

[0067] (i) receiving the JsonSchema generation mode configured by the user for the interface generation mode through the interface configuration interface 300, and displaying the basic parameter configuration area (such as Figure 3 Basic settings area) and response parameter editing area (such as Figure 4 Return data setting area).

[0068] (ii) Generate a JsonSchema data structure based on the response parameters and response parameter types input by the user through the response parameter editing area. Among them, the response parameters and response parameter types are set according to business requirements, and the embodiments of the present application do not limit this. For example, if the application party needs to request user information, the response parameters include the user name of a string type, the department to which the user belongs of a string type, the user's employment time of an integer type, etc. The response parameter information is described in the form of JsonSchema to obtain a JsonSchema data structure. Demonstratively, the json-schema-inferrer framework is used to generate a JsonSchema data structure through a json string.

[0069] (iii) constructing a local response strategy, wherein the local response strategy is used to generate the response information according to the corresponding JsonSchema data structure;

[0070] (iv) Generate the interface response strategy table according to the local response strategy and the preset interface identifier. Store the local response strategy of the interface and the preset unique interface identifier as fields in an interface response strategy table. The interface identifier is used to retrieve the interface response strategy table.

[0071] In order to improve the response efficiency, the embodiment of the present application adopts a method of randomly generating response parameter values ​​to generate response information. The local response strategy is a random method. The value range of the response parameter is limited according to business requirements. The random method is used to randomly generate a response parameter value according to the response parameters and the corresponding types described in the JsonSchema data structure, and the response information is constructed by each response parameter value.

[0072] Exemplarily, the interface response strategy table is as shown in Table 1, including a local response strategy field and an interface identification field.

[0073]

[0074] (V) Generate an interface information table according to the JsonSchema data structure, the interface identifier, and the interface path and request method type input by the user through the basic parameter configuration area. That is, the interface information table includes fields such as the JsonSchema data structure, the interface identifier, the interface path, and the request method type. In order to reduce storage space, the JsonSchema data structure is stored in the interface information table. Exemplarily, the interface information table is shown in Table 2:

[0075] Table 2 Interface Information Table 1

[0076]

[0077] The interface response strategy table and the interface information table are both stored in a database, such as MySQL.

[0078] The interaction control module 200 is specifically used to parse the request information, obtain the interface path and the request method type, match the corresponding interface information table according to the interface path and the request method type, match the interface response strategy table according to the interface identifier in the interface information table, and generate the response information according to the JsonSchema data structure in the interface information table using the local response strategy in the interface response strategy table. It can be understood that if multiple interface information tables are obtained by matching the corresponding interface information table according to the interface path and the request method type, the first interface information table retrieved is obtained as the interface information table of the interface.

[0079] Furthermore, the interface generation method also includes an information configuration generation method. The interface parameters include response parameters and request parameters.

[0080] In order to facilitate setting fixed response information for the interface, the interface generation module 100 in the embodiment of the present application is further used for:

[0081] (i) receiving information configuration generation mode configured by the user through the interface configuration interface 300 for the interface generation mode, and displaying the basic parameter configuration area and the request parameter editing area (such as Figure 5 The request parameter editing area includes trigger buttons for adding, deleting and modifying request parameters, and also includes buttons for adding request parameters in batches. For example, request parameters can be added by adding Query parameters.

[0082] (ii) determining local response data according to the response parameters, response parameter types and response parameter values ​​input by the user through the response parameter editing area; and generating the interface response strategy table according to the interface identifier, the request parameters and the local response data.

[0083] Table 3 Interface response strategy Table 2

[0084]

[0085]

[0086] For example, the response parameters include id data and Boolean data, and the response parameters are assembled into a josn data, such as {"id":123,"isError":false}, which uses the josn data as local response data.

[0087] (III) Generate an interface information table according to the interface identifier, the request parameters input by the user through the request parameter editing area, the interface path and the request method type input through the basic parameter configuration area. The added request parameters are assembled in josn format and then stored as a field in the interface information table. Exemplarily, the interface information table is shown in Table 4:

[0088] Table 4 Interface Information Table 2

[0089]

[0090] Furthermore, each request parameter includes a request parameter name, a request parameter type, and a parameter weight.

[0091] The interaction control module 200 is specifically used to parse the request information, obtain the interface path and the request method type, match the corresponding interface information table according to the interface path, the request method type and the request parameters, match the interface response strategy table according to the interface identifier in the interface information table, and generate the response information according to the local response data in the interface response strategy table. If multiple interface information tables are matched according to the interface path, the request method type and the request parameters, then select the one with the largest parameter weight from the matched interface information tables according to the parameter weight.

[0092] Furthermore, the interaction control module 200 is also used to detect whether the JsonSchema data structure exists in the interface information table before generating the response information.

[0093] If the existence of the JsonSchema data structure is confirmed, the response information is generated according to the JsonSchema data structure in the interface information table using the response strategy in the interface response strategy table that matches the JsonSchema data structure.

[0094] If it is confirmed that the JsonSchema data structure does not exist, the response information is generated according to the response data in the interface response strategy table.

[0095] Furthermore, in order to ensure the stability of system response, the interface generation module 100 is further configured to construct a global response strategy according to business requirements and add the global response data to the interface information table.

[0096] The interaction control module 200 is further specifically configured to generate the response information using the global response strategy according to the JsonSchema data structure when no local response strategy can be found in the matching interface response strategy table.

[0097] The interface generation module 100 is further specifically used to determine global response data according to the global response parameter, global response parameter type and global response parameter value input by the user through the interface configuration interface 300, and add the global response policy to the interface information table.

[0098] The interaction control module 200 is further specifically configured to generate the response information according to the global response data when no local response data can be found in the matching interface response strategy table.

[0099] In one implementation, in order to facilitate the management of multiple application interfaces, such as Figure 6 As shown, the baffle service system further includes: a project management module 400 .

[0100] The interface generation module 100 is further configured to receive a project identifier input by a user through the basic parameter configuration area; and add the project identifier to the interface information table and the interface response strategy table;

[0101] The interaction control module 200 is further used to parse the request information to obtain a project identifier, and match the corresponding interface information table and interface response strategy table according to the project identifier.

[0102] The interface generation module 100 is also specifically used to generate a project management table according to the project identification input by the user through the basic parameter configuration area and the interface classification selected. The project management table is shown in Table 5, including the primary key id, the parent node id, the project name, the project number and the interface level (each level is determined according to the interface classification, and the interface classification is the category in which the interface is divided according to the business function).

[0103] Table 5 Project Management Table

[0104]

[0105] The project management module 400 is used to search for the corresponding interface information table and interface response strategy table according to the project identifier and the interface classification in the project management table, and display the configuration information corresponding to the basic parameters, response parameters and request parameters of each interface belonging to the same project. Specifically, in the embodiment of the present application, the first level of the project tree is divided according to the project dimension, the middle level can be multiple sub-projects, and the last level is the interface. Click on each node of the project tree to display the corresponding details. If it is a project node, the project information and the project member list are displayed. If it is an interface node, the interface details are displayed, including basic interface parameters, request parameters, response parameters, and simulated response strategies, etc. The project tree node provides the function of adding, deleting and modifying. When a node has child nodes, deletion is not allowed, but the name can be modified.

[0106] In one implementation, in order to improve the testing efficiency of the application side and reduce the probability of abnormal baffle service during use, such as Figure 6 As shown, the baffle service system further includes: a debugging module 500 .

[0107] The debugging module 500 is used to trigger the sending of test request information to the interactive control module 200 through the debugging buttons corresponding to the respective interfaces, so as to call the corresponding interface, and output the corresponding response information through the debugging interface.

[0108] In one implementation, in order to improve configuration efficiency, implement a fast configuration interface and reduce configuration workload, such as Figure 6 As shown, the baffle service system also includes an import and export module 600.

[0109] The import and export module 600 is used to export the local response data or the JsonSchema data structure respectively to obtain the corresponding josn data file; and import the josn data file to obtain the corresponding local response data or the JsonSchema data structure.

[0110] When exporting, you can use the easyExcel framework to export Excel files, or you can directly export JSON files. When importing, you can use the easyExcel framework to directly import Excel files, or directly import JSON files. Both Excel files and JSON files are formats that Postman can support.

[0111] In one embodiment, in order to facilitate the use of the baffle service system by various workers in the project, such as Figure 6 As shown, the baffle service system also includes a comprehensive authority management module 700.

[0112] The comprehensive authority management module 700 is used to create each user and each role according to the organizational structure and project, and configure interface operation authority and authority for each role to operate each interface in the baffle service system.

[0113] The comprehensive authority management module 700 includes user management, role management, and authority management. Among them, user management is used to provide functions such as adding, deleting, modifying, and checking users; role management is used to provide functions such as adding, deleting, modifying, and checking roles, role users, and authorization; and authority management is used to provide functions such as adding, deleting, modifying, and checking each user, and authority tree.

[0114] In the embodiment of the present application, the permission management based on the RBAC model realizes role management. Among them, the database tables mainly used are: user table, role table, permission table, user role intermediate table and role permission intermediate table, etc. The user table and the role table are in a many-to-many relationship, so a user role intermediate table is introduced to configure the many-to-many relationship between users and roles. The role table and the permission table are also in a many-to-many relationship, so another role permission intermediate table is introduced to configure the many-to-many relationship between roles and permissions.

[0115] Before the application party uses the baffle service system of the embodiment of the present application, it is also necessary to verify the identity information of the application party, such as Figure 7 As shown, the specific verification methods include:

[0116] The application party enters the user name, password, verification code, and adds verification parameters to form a login request message, and sends the login request message to the baffle service system.

[0117] The baffle service system searches the database for user information registered according to the user name, and the user information includes the user password.

[0118] The baffle service system encrypts the input password with md5, compares it with the user password in the database, and verifies the verification code.

[0119] If the verification is successful, a token is generated using jwt, and the token is stored in redis, with an expiration time of 1 hour.

[0120] The baffle service system uses the user ID as the key and the user information as the key value to store it in redis, and finally returns the token to the application.

[0121] Before executing the baffle service method of the embodiment of the present application, the present application further includes:

[0122] S110, in the interface configuration interface 300, configure the JsonSchema generation method or the information configuration generation method for the interface generation method, and correspondingly display the basic parameter configuration area and the response parameter editing area, or display the basic parameter configuration area, the request parameter editing area and the response parameter editing area.

[0123] S120, when generating JsonSchema, add the response parameter and the response parameter type in the response parameter editing area to obtain the JsonSchema data structure. It is also necessary to construct a global response strategy and a local response strategy according to business requirements.

[0124] S130, in the information configuration generation mode, edit the response parameters, response parameter types and response parameter values ​​in the response parameter editing area to generate local response data; and configure the global response parameters, global response parameter types and global response parameter values ​​to obtain global response data.

[0125] S140, regardless of the JsonSchema generation method or the information configuration generation method, the interface path, request method type, interface identifier, project identifier, and interface classification must be configured in the basic parameter configuration area.

[0126] The interface information table finally obtained is shown in Table 6, and the interface response strategy table is shown in Table 7.

[0127] Table 6 Interface Information Table 3

[0128]

[0129]

[0130] Table 7 Interface response strategy Table 3

[0131]

[0132] S150, click the debugging buttons corresponding to each interface to trigger sending a test request message to the interactive control module 200, that is, calling the corresponding interface, and outputting the corresponding response message through the debugging interface to verify whether the interface response function is normal.

[0133] The baffle testing method is described below in conjunction with some specific embodiments.

[0134] The baffle service system baffle service method comprises:

[0135] The request information sent by the application is intercepted, and the corresponding interface information table and interface response strategy table are matched according to the request information, and response information of the request information is generated based on the matched interface information table and interface response strategy table.

[0136] For example, Figure 8 , Fig. 9 As shown, the method of matching the corresponding interface information table and interface response strategy table according to the request information, and generating response information of the request information based on the matched interface information table and interface response strategy table includes:

[0137] S210, parsing the request information to obtain the interface path and the request method type.

[0138] S220, matching the corresponding interface information table according to the interface path (request url) and the request method type (method).

[0139] S230: Match the interface response strategy table according to the interface identifier in the interface information table.

[0140] S240, based on the JsonSchema data structure in the interface information table, the response information is generated using the local response strategy in the interface response strategy table. The local response strategy is a random method that limits the value range of the response parameter according to business requirements. The random method is used to randomly generate a response parameter value based on the response parameters and corresponding types described in the JsonSchema data structure, and the response information is constructed from the response parameter values.

[0141] Furthermore, when no local response strategy can be found in the matching interface response strategy table, the response information is generated using the global response strategy in the interface information table according to the JsonSchema data structure.

[0142] Furthermore, when parsing the request information, a project identifier is obtained, and the corresponding interface information table and interface response strategy table need to be matched according to the project identifier, that is, the interface information table is matched according to the project identifier, interface path and request method type.

[0143] For example, Fig.10 As shown, the method of matching the corresponding interface information table and interface response strategy table according to the request information, and generating response information of the request information based on the matched interface information table and interface response strategy table includes:

[0144] S310, parsing the request information to obtain the interface path and the request method type.

[0145] S320: Match a corresponding interface information table according to the interface path, the request method type, and the request parameters.

[0146] S330, matching the interface response strategy table according to the interface identifier in the interface information table, and generating the response information according to the local response data in the interface response strategy table.

[0147] Further, when no local response data can be found in the matching interface response strategy table, the response information is generated according to the global response data in the interface information table.

[0148] Furthermore, when parsing the request information, a project identifier is obtained, and the corresponding interface information table and interface response strategy table need to be matched according to the project identifier, that is, the corresponding interface information table is matched according to the project identifier, interface path, request method type and request parameters.

[0149] It can be understood that before generating the response information, it also includes detecting whether the JsonSchema data structure exists in the interface information table.

[0150] If the existence of the JsonSchema data structure is confirmed, the response information is generated according to the JsonSchema data structure in the interface information table using the response strategy in the interface response strategy table.

[0151] If it is confirmed that the JsonSchema data structure does not exist, the response information is generated according to the response data in the interface response strategy table.

[0152] The present application also provides a terminal device. Exemplarily, the terminal device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the above-mentioned baffle service testing method or implement the functions of each module in the above-mentioned baffle service system.

[0153] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. At least one of the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0154] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.

[0155] The present application also provides a readable storage medium for storing the computer program used in the above-mentioned terminal device.

[0156] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0157] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0158] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0159] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A baffle service system, characterized in that: include: An interface generation module, used to receive an interface generation mode configured by a user through an interface configuration interface, and interface parameters determined according to the interface generation mode, and to generate an interface information table according to the interface generation mode and the interface parameters, and to generate an interface response strategy table according to the interface parameters; The interactive control module is used to intercept the request information sent by the application party, match the corresponding interface information table and interface response strategy table according to the request information, and generate response information for the request information based on the matched interface information table and interface response strategy table.

2. The baffle service system according to claim 1, characterized in that: The interface generation method includes a JsonSchema generation method; the interface parameters include basic parameters and response parameters; wherein the basic parameters include an interface path and a request method type; The interface generation module is specifically used for: Receive the JsonSchema generation mode configured by the user for the interface generation mode through the interface configuration interface, and display the basic parameter configuration area and the response parameter editing area in the interface configuration interface; Generate a JsonSchema data structure according to the response parameters and response parameter types input by the user through the response parameter editing area; construct a local response strategy, wherein the local response strategy is used to generate the response information according to the corresponding JsonSchema data structure; generate the interface response strategy table according to the local response strategy and a preset interface identifier; Generate an interface information table according to the JsonSchema data structure, the interface identifier, and the interface path and request method type input by the user through the basic parameter configuration area; The interactive control module is specifically used for: Parse the request information to obtain the interface path and the request method type, match the corresponding interface information table according to the interface path and the request method type, and match the interface response strategy table according to the interface identifier in the interface information table; The response information is generated according to the JsonSchema data structure in the interface information table using the local response strategy in the interface response strategy table.

3. The baffle service system according to claim 2, characterized in that: The interface generation method includes an information configuration generation method; the interface parameters include response parameters and request parameters; The interface generation module is specifically used for: Receiving information configuration generation mode configured by a user for an interface generation mode through an interface configuration interface, and displaying a basic parameter configuration area, a request parameter editing area, and a response parameter editing area on the interface configuration interface; Determining local response data according to the response parameter, response parameter type and response parameter value input by the user through the response parameter editing area; Generate the interface response strategy table according to the interface identifier, the request parameter and the local response data; Generate an interface information table according to the interface identifier, the request parameters input by the user through the request parameter editing area, the interface path and the request method type input through the basic parameter configuration area; The interactive control module is specifically used to parse the request information, obtain the interface path and the request method type, match the corresponding interface information table according to the interface path, the request method type and the request parameters, match the interface response strategy table according to the interface identifier in the interface information table, and generate the response information according to the local response data in the interface response strategy table.

4. The baffle service system according to claim 3, characterized in that: The interaction control module is further used to detect whether the JsonSchema data structure exists in the interface information table before generating the response information; If it is confirmed that the JsonSchema data structure exists, then according to the JsonSchema data structure in the interface information table, the response information is generated using the response strategy in the interface response strategy table; If it is confirmed that the JsonSchema data structure does not exist, the response information is generated according to the response data in the interface response strategy table.

5. The baffle service system according to claim 3, characterized in that: The interface generation module is further configured to construct a global response strategy according to business requirements and add the global response data to the interface information table; The interaction control module is further configured to generate the response information using the global response strategy according to the JsonSchema data structure when no local response strategy can be found in the matching interface response strategy table; Alternatively, the interface generation module is further configured to determine global response data according to the global response parameter, global response parameter type and global response parameter value input by the user through the interface configuration interface, and add the global response policy to the interface information table; The interaction control module is further configured to generate the response information according to the global response data when no local response data can be found in the matching interface response strategy table.

6. The baffle service system according to claim 3, characterized in that: The baffle service system also includes: a project management module; The interface generation module is further configured to receive a project identifier input by a user through the basic parameter configuration area; and add the project identifier to the interface information table and the interface response strategy table; The interactive control module is further used to parse the request information to obtain a project identifier, and match the corresponding interface information table and interface response strategy table according to the project identifier; The interface generation module is further configured to generate a project management table according to the project identifier input by the user through the basic parameter configuration area and the interface classification selected; The project management module is used to search for the corresponding interface information table and interface response strategy table according to the project identifier and the interface classification in the project management table, and display the configuration information corresponding to the basic parameters, response parameters and request parameters of each interface belonging to the same project.

7. The baffle service system according to any one of claims 1 to 6, characterized in that: The baffle service system further includes: a debugging module; The debugging module is used to trigger the sending of test request information to the interactive control module through the debugging buttons corresponding to the various interfaces, so as to call the corresponding interface and output the corresponding response information through the debugging interface.

8. The baffle service system according to any one of claims 2 to 6, characterized in that: The baffle service system also includes an import and export module; The import and export module is used to export the local response data or the JsonSchema data structure respectively to obtain the corresponding josn data file; And, import the josn data file to obtain the corresponding local response data or the JsonSchema data structure.

9. The baffle service system according to any one of claims 1 to 6, characterized in that: The baffle service system also includes a comprehensive authority management module; The comprehensive authority management module is used to create each user and each role according to the organizational structure and project, and configure interface operation authority and authority for each role to operate each interface in the baffle service system.

10. A baffle service testing method, characterized in that: Applied to the baffle service system according to any one of claims 1 to 9, the method comprises: Intercept the request information sent by the application, match the corresponding interface information table and interface response strategy table according to the request information, and generate response information according to the interface information table and the interface response strategy table.