Interface simulation method and device and electronic equipment

By receiving the interface simulation request and obtaining the matching simulation template, the response rules are determined to generate the target response data, which solves the problem in the existing technology that the interface simulation differences between different test environments cannot be reflected, and improves the efficiency and accuracy of the simulation test.

CN118656290APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410166871.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-05
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

The existing technology cannot effectively reflect the differences in interface simulation between different test environments in simulation tests, resulting in high hardware costs and low efficiency, and cannot provide accurate simulation responses in multiple test environments.

Method used

By receiving interface simulation requests, obtain the target simulation template that matches the simulation environment, determine the response rules and generate target response data, ensuring that specific and accurate simulation responses are provided in different test environments.

Benefits of technology

It improves the efficiency and accuracy of interface simulation, reduces hardware costs, realizes differential simulation in a variety of test environments, and ensures the specificity and accuracy of interface simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656290A
    Figure CN118656290A
Patent Text Reader

Abstract

The embodiment of the invention discloses an interface simulation method and device and electronic equipment. The interface simulation method comprises the steps of receiving a first interface simulation request of a first application; the first interface simulation request comprises request information, interface information of a first interface and simulation environment information; obtaining a target simulation template matched with the simulation environment information; determining a target response rule of the first interface simulation request according to the target simulation template, the interface information of the first interface and the request information; generating target response data of the first interface simulation request according to the target response rule; the target response data is used for testing the first application. According to the invention, different simulation response results can be realized in different test environments, and the specificity and accuracy of interface simulation in different test environments are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of application testing technology, and in particular to an interface simulation method, device and electronic equipment. Background Art

[0002] Before the server completes the API (Application Programming Interface) development, the API is not available. Client developers need to wait for the server API to be completed before they can connect and develop the API to ensure that the client and server can achieve the same function according to the same goal. Simulating the API capabilities through Mock can assist client development. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide an interface simulation method, device and electronic device, which can achieve different simulation response results in different test environments, thereby ensuring the specificity and accuracy of interface simulation in different test environments.

[0004] To solve the above technical problems, the embodiments of the present application are implemented as follows:

[0005] On the one hand, an embodiment of the present application provides an interface simulation method, the method comprising:

[0006] Receiving a first interface simulation request of a first application; the first interface simulation request includes request information, interface information of the first interface and simulation environment information;

[0007] Acquire a target simulation template that matches the simulation environment information; the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request, and the correspondence between the response rules;

[0008] Determine a target response rule for the first interface simulation request according to the target simulation template, the interface information of the first interface, and the request information;

[0009] According to the target response rule, target response data of the first interface simulation request is generated; the target response data is used to test the first application.

[0010] On the other hand, an embodiment of the present application provides an interface simulation device, the device comprising:

[0011] A receiving module, configured to receive a first interface simulation request of a first application; the first interface simulation request includes request information, interface information of the first interface and simulation environment information;

[0012] An acquisition module, used to acquire a target simulation template matching the simulation environment information; the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request, and the correspondence between the response rules;

[0013] A determination module, configured to determine a target response rule for the first interface simulation request according to the target simulation template, the interface information of the first interface and the request information;

[0014] A generation module is used to generate target response data of the first interface simulation request according to the target response rule; the target response data is used to test the first application.

[0015] On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory electrically connected to the processor, the memory storing a computer program, and the processor being used to call and execute the computer program from the memory to implement the above-mentioned interface simulation method.

[0016] On the other hand, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program can be executed by a processor to implement the above-mentioned interface simulation method.

[0017] On the other hand, an embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the above-mentioned interface simulation method.

[0018] Adopting the technical solution of the embodiment of the present application, by receiving the first interface simulation request of the first application, the first interface simulation request includes request information, interface information of the first interface and simulation environment information, and then obtaining the target simulation template matching the simulation environment information, the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request and the correspondence between the response rules; then according to the target simulation template, the interface information of the first interface and the request information, determine the target response rule of the first interface simulation request, and generate the target response data of the first interface simulation request according to the target response rule, and the target response data is used to test the first application. Since in the field of application testing, each application usually has multiple test environments, and the request information and response rules in different test environments are different, therefore, by obtaining the target simulation template matching the simulation environment information, the simulation environment information is used to characterize the current test environment, so that the first application can select a matching template for simulation response based on the current test environment of the first application in the scenario of multiple test environments, so that the same application can have different simulation response results in different test environments, ensuring the specificity and accuracy of interface simulation in different test environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate one or more embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 is a schematic flow chart of an interface simulation method according to an embodiment of the present application;

[0021] Figure 2 is a schematic flow chart of an interface simulation method according to another embodiment of the present application;

[0022] Figure 3 is a schematic flow chart of an interface simulation method according to yet another embodiment of the present application;

[0023] Figure 4 is a schematic scene diagram of a simulation interface system according to an embodiment of the present application;

[0024] Figure 5 is a schematic block diagram of a simulation server in a simulation interface system according to an embodiment of the present application;

[0025] Figure 6 is a schematic block diagram of a simulation agent terminal in a simulation interface system according to an embodiment of the present application;

[0026] Figure 7 is a schematic block diagram of an interface simulation device according to an embodiment of the present application;

[0027] Figure 8 It is a schematic block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] The embodiments of the present application provide an interface simulation method, device and electronic device for improving the specificity and accuracy of interface simulation in scenarios of various test environments.

[0029] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0030] The so-called simulation (i.e. Mock) test is a test method that uses a virtual object to create a test for some objects that are not easy to construct or obtain during the test process. Generally, a certain interface of the mock test environment is needed for development or testing. For example, if a certain interface service is unavailable, a mock interface is needed to call it. Therefore, it is very important to provide an efficient and convenient mock method.

[0031] At present, the simulation test method usually implements the front-end and back-end joint debugging test and the joint debugging test between the back-ends separately, that is, different devices are used to handle the front-end and back-end joint debugging test and the joint debugging test between the back-ends respectively. This is because the front-end and back-end joint debugging test and the joint debugging test between the back-ends are different. The front-end and back-end joint debugging test is the interaction between the front-end page and the server, while the joint debugging test between the back-ends is the joint debugging test between the two servers, which leads to the hardware cost of testing based on Mock is very high and the efficiency is low. In addition, the current simulation test method does not consider the scenario where there are multiple test environments for the front-end and back-end, that is, for applications with multiple test environments for the front-end and back-end, the response results of the interface simulation of the application are the same, and the differences in interface simulation in different test environments cannot be reflected. The interface simulation method provided by the present application receives a first interface simulation request of a first application, the first interface simulation request includes request information, interface information of the first interface and simulation environment information, and then obtains a target simulation template matching the simulation environment information, the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request and the correspondence between the response rules; then, according to the target simulation template, the interface information of the first interface and the request information, the target response rule of the first interface simulation request is determined, and the target response data of the first interface simulation request is generated according to the target response rule, and the target response data is used to test the first application. Since in the field of application testing, each application usually has multiple test environments, and the request information and response rules in different test environments are different, therefore, by obtaining a target simulation template matching the simulation environment information, the simulation environment information is used to characterize the current test environment, so that the first application can select a matching template based on the current test environment of the first application for simulation response in the scenario of multiple test environments, so that the same application can have different simulation response results in different test environments, ensuring the specificity and accuracy of interface simulation in different test environments.

[0032] The first application can be any application, which refers to a computer program running on a server to implement a certain type of business function. Usually, the first application consists of an API that provides external services, each application has multiple APIs, and each API consists of the processing process of "request-processing-response". The application simulated by the first application can be called the target application, that is, the target application refers to an application that needs to use simulation (i.e. Mock) technology to simulate the external service, and can also be called a Mock application. The test environment is a general term for a set of servers and network topologies on which the application runs. In software development, due to multiple requirements for parallel development and testing, there are usually multiple sets of test environments coexisting. Simulation (i.e. Mock) technology refers to the technology of simulating the business request or processing logic of the target application, usually because the business request of the target application is too complex, or cannot be completed in the test environment, or the processing cycle is too long and does not have good testability. The interface simulation method provided by the present application is described in detail below.

[0033] The interface simulation method provided in the embodiment of the present application can be executed by an electronic device, or by software installed in the electronic device. Specifically, the electronic device can be a terminal device or a server device. Among them, the terminal device can include a smart phone, a laptop computer, a smart wearable device, a vehicle terminal, etc., and the server device can include an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.

[0034] Figure 1 is a schematic flow chart of an interface simulation method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0035] S102, receiving a first interface simulation request of a first application, where the first interface simulation request includes request information, interface information of a first interface, and simulation environment information.

[0036] The first interface simulation request may be a first simulation request from a backend server of the first application or a second simulation request from an application frontend of the first application.

[0037] Optionally, the first interface simulation request may further include application identification information of the first application, and the application identification information may be at least one of an application name, an application type, an application function, an application code serving as a unique identification, etc. of the first application.

[0038] The simulation environment information refers to the environment information of the test environment where the back-end server or application front-end that initiates the first interface simulation request is currently located.

[0039] There may be multiple backend servers for the first application, and the multiple backend servers may be deployed in different test environments, and one or more backend servers may be deployed in each test environment. The application frontend of the first application may be understood as a frontend page.

[0040] The interface simulation method can be implemented through a simulation interface system. If the initiator of the first interface simulation request is different, the component that receives the first interface simulation request in the simulation interface system is different. Optionally, if the first interface simulation request is initiated by the back-end server of the first application, the simulation interface system can receive the first interface simulation request through a simulation agent deployed therein, and the simulation agent is deployed in the back-end server of the first application. If the first interface simulation request is initiated by the application front-end of the first application, the simulation interface system can receive the first interface simulation request through a simulation server therein.

[0041] S104, obtaining a target simulation template that matches the simulation environment information; the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request, and the correspondence between the response rules.

[0042] The first application may include multiple application interfaces, the first interface may be any one of the multiple application interfaces, and the interface information may include at least one of the interface name, interface type, interface request mode, etc. Each application interface may have multiple request modes, so in the target simulation template, each application request may correspond to one or more interface simulation requests. Each interface simulation request corresponds to a unique response rule.

[0043] The first application may rely on one or more other target applications when running, and the one or more target applications need to be simulated (i.e., Mock). The set of simulation rules of the one or more target applications constitutes a template, i.e., a target simulation template. The target simulation template can be configured in the form of simulation rules. For example, the target simulation template includes multiple simulation rules, each simulation rule corresponds to the correspondence between one or more request information and response rules. The target simulation template can be distributed to one or more test environments of the first application for use.

[0044] S106: Determine a target response rule for the first interface simulation request according to the target simulation template, the interface information of the first interface, and the request information of the first interface simulation request.

[0045] Among them, according to the interface information of the first interface, multiple interface simulation requests corresponding to the interface information of the first interface in the target simulation template can be determined, and then according to the request information of the first interface simulation request, a response rule corresponding to the request information of the first interface simulation request can be determined from the multiple interface simulation requests corresponding to the interface information of the first interface as the target response rule.

[0046] S108, generating target response data of the first interface simulation request according to the target response rule, wherein the target response data is used to test the first application.

[0047] According to the technical solution of the embodiment of the present application, by receiving the first interface simulation request of the first application, the first interface simulation request includes request information, interface information of the first interface and simulation environment information, and then obtaining a target simulation template matching the simulation environment information, the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request and the correspondence between the response rules; then, according to the target simulation template, the interface information of the first interface and the request information, the target response rule of the first interface simulation request is determined, and the target response data of the first interface simulation request is generated according to the target response rule, and the target response data is used to test the first application. Since in the field of application testing, each application usually has multiple test environments, and the request information and response rules in different test environments are different, therefore, by obtaining a target simulation template matching the simulation environment information, the simulation environment information is used to characterize the current test environment, so that the first application can select a matching template for simulation response based on the current test environment of the first application in the scenario of multiple test environments, so that the same application can have different simulation response results in different test environments, ensuring the specificity and accuracy of interface simulation in different test environments.

[0048] In one embodiment, the first interface simulation request is a first simulation request initiated by the backend server of the first application. When obtaining a target simulation template matching the simulation environment information, the target simulation template can be obtained through a simulation agent in the simulation interface system. The simulation agent is deployed in the backend server of the first application.

[0049] In this embodiment, when a first simulation request is received from the back-end server of the first application, only the simulation agent deployed in the back-end server of the simulation interface system needs to respond to and process the first simulation request without interacting with the simulation server located at the back end. This not only improves the interface simulation efficiency, but also improves the testing efficiency of the first interface without occupying the resources of the simulation server.

[0050] In one embodiment, when the first interface simulation request is a first simulation request initiated by a backend server of a first application, when obtaining the target simulation template through the simulation proxy in the simulation interface system, any of the following methods may be used to obtain the template:

[0051] Method 1: Obtain the target simulation template from the simulation server in the simulation interface system through the simulation agent.

[0052] When using method 1 to obtain the target simulation template, the first simulation request should also include the application identification information of the first application. The simulation server is pre-configured with at least one simulation template corresponding to the application. The simulation server determines the target simulation template corresponding to the first application and matching the simulation environment information based on the application identification information and simulation environment information of the first application included in the first simulation request.

[0053] Method 2: obtaining a pre-stored target simulation template from a designated space of a backend server of the first application through a simulation agent; the target simulation template is obtained in advance from a simulation server by the simulation agent and pre-stored in a designated space in the backend server.

[0054] In method 2, the designated space can be any storage space in the backend server. The simulation agent needs to obtain in advance from the simulation server a target simulation template corresponding to the first application and matching the simulation environment information. Optionally, the simulation server is pre-configured with at least one simulation template corresponding to an application, and each simulation template corresponding to an application includes simulation rules for one or more interfaces of the application. Each interface may have one or more simulation rules, and the simulation rules include the correspondence between request information and response rules. The simulation agent sends an acquisition request to the simulation server, and the acquisition request carries the application identification information of the first application. The simulation server searches for the target simulation template corresponding to the first application pre-configured by the simulation server based on the application identification information carried in the acquisition request. Optionally, the acquisition request also includes simulation environment information, so that the simulation server sends the target simulation template corresponding to the first application and matching the simulation environment information to the simulation agent based on the application identification information and simulation environment information of the first application.

[0055] In one embodiment, when the first interface simulation request is the first simulation request initiated by the back-end server of the first application, when generating the target response data of the first simulation request according to the target response rule, the target response rule can be parsed by the simulation data parsing engine deployed by the simulation agent, and the target response data can be generated according to the parsing result; or, the target response rule can be sent to the simulation server in the simulation interface system through the simulation agent, and the target response rule can be parsed by the simulation data parsing engine deployed by the simulation server, and the target response data can be generated according to the parsing result.

[0056] Optionally, if the logic in the target response rule is relatively simple, it can be directly parsed by the simulated data parsing engine deployed by the simulated proxy. If the logic in the target response rule is relatively complex (for example, it is necessary to encrypt and return certain data), and the simulated data parsing engine deployed by the simulated proxy cannot parse the response data, the target response rule can be parsed by the simulated data parsing engine deployed by the simulated server, and the parsing result can be returned.

[0057] In this embodiment, the target response rule is parsed by the simulation data parsing engine deployed by the simulation agent, without the need to interact with the simulation server at the back end, which can improve the efficiency of rule parsing and further improve the efficiency of interface simulation. If the simulation agent cannot parse, the target response rule is parsed by the simulation data parsing engine deployed by the simulation server to ensure the smooth progress of rule parsing, further ensure the smooth progress of interface simulation, and avoid the situation where the interface simulation fails due to the inability of the simulation agent to complete the parsing action.

[0058] In one embodiment, the first interface simulation request is a second simulation request initiated by an application front end of the first application. When acquiring a target simulation template that matches the simulation environment information, the target simulation template may be acquired through a simulation server in the simulation interface system.

[0059] Among them, the target simulation template is pre-configured and stored in the simulation server. Optionally, the simulation server pre-stores the simulation relationship information between the first application and the target application, and the simulation relationship information includes: the application identification information of the first application and the target simulation template. The target simulation template includes the application identification information of the target application, the interface information of the application interface of the first application, the request information of the interface simulation request, and the correspondence between the response rules. In the case where the first interface simulation request is the second simulation request, the second simulation request also includes the application identification information of the first application. The simulation server can determine the target simulation template corresponding to the first application and matching the simulation environment information based on the application identification information and simulation environment information of the first application carried in the second simulation request.

[0060] In one embodiment, when determining the target response rule of the first interface simulation request based on the target simulation template, the interface information of the first interface and the request information of the first interface simulation request, it is possible to first determine whether the first interface simulation request matches the target simulation template, and then, if the first interface simulation request matches the target simulation template, further determine the target response rule of the first interface simulation request based on the target simulation template, the interface information of the first interface and the request information of the first interface simulation request.

[0061] Optionally, it is determined whether the target simulation template contains the request information of the first interface simulation request. If so, it is determined that the first interface simulation request matches the target simulation template. Since the target simulation template includes the correspondence between the request information of the interface simulation request and the response rule, it is possible to determine whether the first interface simulation request matches the target simulation template by determining whether the request information in the target simulation template contains the request information of the first interface simulation request. In the case where the target simulation template contains the request information of the first interface simulation request, the target response rule for the first interface simulation request is further determined.

[0062] In one embodiment, simulation relationship information between the first application and the target application can be created in advance on the simulation server, and the simulation relationship information includes: application identification information of the first application and a target simulation template; the target simulation template includes: application identification information of the target application, interface information of the application interface of the first application, and a correspondence between request information of the interface simulation request and a response rule. The simulation relationship information is stored on the simulation server in the simulation interface system.

[0063] Based on the pre-created simulation relationship information, the simulation relationship information can be sent to the back-end server of the first application for storage in advance, or, when an acquisition request sent by the simulation agent is received (the acquisition request carries the application identification information of the first application), the simulation relationship information corresponding to the first application is sent to the back-end server of the first application.

[0064] In one embodiment, before receiving the first interface simulation request of the first application, the response data corresponding to the first application can be obtained in advance through the following steps A1-A2:

[0065] Step A1, through the simulation data parsing engine deployed on the simulation server, multiple response data corresponding to multiple interface simulation requests are generated according to multiple response rules in the target simulation template.

[0066] The response rules in the target simulation template can be understood as a method of parsing the response data, and each response rule corresponds to one response data.

[0067] Step A2: sending a plurality of response data to a backend server of the first application for storage according to the application identification information of the first application included in the simulation relationship information.

[0068] The simulation server can actively send the multiple response data obtained by parsing to the backend server of the first application, or send the multiple response data to the backend server of the first application after receiving the acquisition request sent by the simulation agent. Optionally, the simulation agent sends an acquisition request to the simulation server, and the acquisition request carries the application identification information of the first application. The simulation server sends the multiple response data corresponding to the first application to the backend server of the first application based on the application identification information of the first application carried in the acquisition request.

[0069] The simulation server may send multiple response data directly to the backend server of the first application, or may send multiple response data to the simulation proxy, which is then forwarded by the simulation proxy to the backend server of the first application.

[0070] After the simulation server sends the multiple response data obtained by parsing to the backend server of the first application, the stress test can be performed based on the multiple response data stored in the backend server. Optionally, when a stress test request initiated by the backend server of the first application is received, the simulation proxy deployed in the backend server obtains multiple response data from the backend server, and then the first application is stress tested based on the multiple response data.

[0071] In this embodiment, by pre-parsing the response data corresponding to the first application and pre-storing the response data in the back-end server of the first application, when the first application is stress tested, the response data in the back-end server can be directly read without interacting with the simulation server located at the back end, thereby greatly reducing the pressure on the simulation server during the stress test, effectively reducing the situation where the simulation server may become a bottleneck during the stress test, and improving the efficiency of the stress test.

[0072] Figure 2 is a schematic flow chart of an interface simulation method according to another embodiment of the present application, such as Figure 2 As shown, the method is applied to an analog interface system and includes the following steps:

[0073] S201, creating simulation relationship information between a first application and a target application, and storing the simulation relationship information in a simulation server.

[0074] The simulation relationship information includes: application identification information of the first application and a target simulation template. The target simulation template includes the application identification information of the target application, the interface information of the application interface of the first application, the request information of the interface simulation request, and the corresponding relationship between the response rules. The application identification information of the first application may be at least one of the application name, application type, application function, and application code that serves as a unique identification of the first application. The application identification information of the target application may be at least one of the application name, application type, application function, and application code that serves as a unique identification of the target application.

[0075] S202: Associate the application identification information of the first application, the target simulation template, and the test environment information corresponding to the first application and store them in the simulation server.

[0076] Among them, the test environment information corresponding to the first application may include multiple simulation environment information, that is, the environment information of the test environment. The test environment information corresponding to the first application refers to the collective name of the set of servers and network topologies on which the first application can run. The same application can usually have multiple test environments. Optionally, at least one back-end server of the first application is deployed in each test environment, and a simulation agent is deployed in each back-end server, and the test environment information (i.e., simulation environment information) where the simulation agent is located is bound to the back-end server.

[0077] When the target simulation template and the test environment information corresponding to the first application are stored in association, each simulation rule in the target simulation template (i.e., the correspondence between the request information and the response rule) can be stored in association with the corresponding simulation environment information, because the same service interface of the target application has different response data to the request in different simulation environment information. For example, in environment A corresponding to a certain simulation environment information, the interface of the target application returns a normal value, and in environment B corresponding to another simulation environment information, the same interface of the target application returns an abnormal value.

[0078] It should be noted that the execution order of steps S201 and S202 is not limited.

[0079] S203, the simulation proxy receives a first simulation request sent by a backend server of the first application.

[0080] The first simulation request includes request information, interface information of the first interface and simulation environment information. The simulation environment information refers to the environment information of the test environment where the backend server of the first application currently resides.

[0081] S204: The simulation agent obtains a target simulation template that matches the simulation environment information according to the first simulation request.

[0082] Optionally, the simulation agent can obtain the target simulation template from the simulation server. The simulation agent sends an acquisition request to the simulation server, and the acquisition request carries the application identification information of the first application and the simulation environment information bound to the simulation agent. The simulation server sends the target simulation template corresponding to the first application and matching the simulation environment information to the simulation agent based on the acquisition request.

[0083] Optionally, the simulation agent can obtain the target simulation template from the backend server of the first application. In this case, the simulation server needs to send the target simulation template to the backend server in advance for storage, so that the simulation agent can obtain the target simulation template from the backend server after receiving the first simulation request.

[0084] Since each simulation rule in the target simulation template (i.e., the correspondence between the request information and the response rule) is stored in association with the corresponding simulation environment information, when the simulation agent obtains the target simulation template, it can obtain all simulation rules in the target simulation template, and then match the simulation environment information bound to the simulation agent with all simulation rules to match the target simulation rule that matches the simulation environment information. Alternatively, the simulation agent can only obtain the simulation rules that match the simulation environment information based on the simulation environment information bound to it, and does not obtain other simulation rules in the target simulation template.

[0085] S205, the simulation agent determines whether the first simulation request matches the target simulation template; if so, execute S206; if not, execute S208.

[0086] Among them, since the target simulation template includes the application identification information of the target application, the interface information of the application interface of the first application, the request information of the interface simulation request and the correspondence between the response rules, it is possible to determine whether the request information in the target simulation template contains the request information of the first simulation request. If so, it is determined that the first simulation request matches the target simulation template.

[0087] In this step, if the simulation agent obtains all simulation rules in the target simulation template, then when determining whether the first simulation request matches the target simulation template, the request information of the first simulation request can be matched with the request information in each simulation rule. If the simulation agent obtains only the simulation rules in the target simulation template that match the simulation environment information, then when determining whether the first simulation request matches the target simulation template, the request information of the first simulation request can be matched with the request information in the obtained simulation rules.

[0088] S206, the simulation proxy intercepts the first simulation request, and determines a target response rule for the first simulation request according to the target simulation template, the interface information of the first interface, and the request information of the first simulation request.

[0089] S207, parsing the target response rule through the simulation data parsing engine deployed by the simulation proxy end, obtaining the target response data corresponding to the first simulation request, and testing the first application using the target response data.

[0090] S208: The simulation proxy terminal does not process the first simulation request.

[0091] If the first simulation request is not processed, the simulation proxy terminal may issue a notification message for indicating that the first simulation request is not processed. Based on the notification message, the first application requests the corresponding service interface in the target application according to its original business logic, for example, using a related protocol to request the corresponding service interface.

[0092] Figure 3 is a schematic flow chart of an interface simulation method according to another embodiment of the present application, such as Figure 3 As shown, the method is applied to an analog interface system and includes the following steps:

[0093] S301, creating simulation relationship information between a first application and a target application, and storing the simulation relationship information in a simulation server.

[0094] The simulation relationship information includes: application identification information of the first application and a target simulation template. The target simulation template includes: application identification information of the target application, interface information of the application interface of the first application, request information of the interface simulation request, and a correspondence between response rules. The application identification information of the first application may be at least one of the application name, application type, application function, and application code that serves as a unique identification of the first application. The application identification information of the target application may be at least one of the application name, application type, application function, and application code that serves as a unique identification of the target application.

[0095] S302: Associate the application identification information of the first application, the target simulation template, and the test environment information corresponding to the first application and store them in the simulation server.

[0096] Among them, the test environment information corresponding to the first application may include multiple simulation environment information, that is, the environment information of the test environment. The test environment information corresponding to the first application refers to the collective name of the set of servers and network topologies on which the first application can run. The same application can usually have multiple test environments. Optionally, at least one back-end server of the first application is deployed in each test environment, and a simulation agent is deployed in each back-end server, and the test environment information (i.e., simulation environment information) where the simulation agent is located is bound to the back-end server.

[0097] When the target simulation template and the test environment information corresponding to the first application are stored in association, each simulation rule in the target simulation template (i.e., the correspondence between the request information and the response rule) can be stored in association with the corresponding simulation environment information, because the same service interface of the target application has different response data to the request in different simulation environment information. For example, in environment A corresponding to a certain simulation environment information, the interface of the target application returns a normal value, and in environment B corresponding to another simulation environment information, the same interface of the target application returns an abnormal value.

[0098] It should be noted that the execution order of steps S301 and S302 is not limited.

[0099] S303, the simulation server receives a second simulation request sent by the application front end of the first application.

[0100] The second simulation request includes request information, interface information of the first interface, application identification information of the first application, and simulation environment information. The simulation environment information refers to the environment information of the test environment where the application front end (ie, the front end page) of the first application currently resides.

[0101] S304: The simulation server obtains a target simulation template corresponding to the first application and matching the simulation environment information according to the second simulation request.

[0102] Since the simulation server has pre-stored the target simulation template corresponding to the first application, the simulation server can directly obtain the target simulation template locally. Since each simulation rule in the target simulation template (i.e., the correspondence between the request information and the response rule) is associated with the corresponding simulation environment information and stored, when the simulation server obtains the target simulation template, it can obtain all simulation rules in the target simulation template, and then match the simulation environment information carried in the second simulation request with all simulation rules to match the simulation rules that match the simulation environment information. Alternatively, the simulation server can only obtain the simulation rules that match the simulation environment information based on the simulation environment information carried in the second simulation request, and does not obtain other simulation rules in the target simulation template.

[0103] S305, the simulation server determines a target response rule for the second simulation request according to the target simulation template, the interface information of the first interface, and the request information of the second simulation request.

[0104] S306, parsing the target response rule through the simulation data parsing engine deployed on the simulation server, obtaining the target response data corresponding to the second simulation request, and testing the first application using the target response data.

[0105] Depend on Figure 2 and Figure 3 It can be seen from the illustrated embodiment that no matter the interface simulation request is the first simulation request from the back-end server of the first application, or the second simulation request from the application front-end of the first application, the simulation interface system can respond to and process the interface simulation request, thus achieving the effect of using the same device (i.e., the simulation interface system) to solve the simulation test problem between the front-end and the back-end, and improving the efficiency of application testing. In addition, since the pre-configured target simulation template corresponding to the first application is associated with the test environment information of the first application, that is, it has environmental attributes, by obtaining the target simulation template matching the simulation environment information, the first application can select a matching template for simulation response based on the current test environment of the first application in a variety of test environment scenarios, so that the same application can have different simulation response results in different test environments, ensuring the specificity and accuracy of interface simulation in different test environments. In addition, by managing the simulation rules corresponding to the first application (i.e., the corresponding relationship between the request information and the response rules) and the simulation environment information respectively (i.e., storing them in different components), for example, the simulation rules corresponding to the first application are stored in the simulation rule component of the simulation server, and the simulation environment information corresponding to the first application and the target simulation template are associated and stored in the simulation injection component of the simulation server. Therefore, it is possible to achieve the effect of applying the same simulation rule to multiple test environments, and different simulation rules can be applied to different test environments. The test environment is the environment corresponding to the simulation environment information.

[0106] In summary, specific embodiments of the present subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recorded in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing can be advantageous.

[0107] The above is an interface simulation method provided in an embodiment of the present application. Based on the same idea, an embodiment of the present application also provides a simulation interface system.

[0108] Figure 4is a schematic scene diagram of a simulation interface system according to an embodiment of the present application, such as Figure 4 As shown, the simulation interface system includes a simulation server 410 and a simulation agent 420, and the simulation agent 420 is deployed in the backend server of the first application.

[0109] The simulation server 410 is used to obtain a target simulation template that matches the simulation environment information when receiving a first simulation request initiated by the back-end server of the first application; the first simulation request includes request information, interface information of the first interface and simulation environment information; the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request and the correspondence between the response rules; according to the target simulation template, the interface information of the first interface and the request information, the target response rule of the first simulation request is determined; according to the target response rule, the target response data of the first simulation request is generated, and the target response data is used to test the first application.

[0110] The simulation agent 420 is used to obtain a target simulation template that matches the simulation environment information when receiving a second simulation request initiated by the application front end of the first application; the second simulation request includes request information, interface information of the first interface and simulation environment information; the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request and the correspondence between the response rules; according to the target simulation template, the interface information of the first interface and the request information, the target response rule of the second simulation request is determined; according to the target response rule, the target response data of the second simulation request is generated, and the target response data is used to test the first application.

[0111] In the embodiment of the present application, since the interface simulation request can be a first simulation request from the back-end server of the first application or a second simulation request from the application front-end of the first application, that is, no matter whether the interface simulation request comes from the back-end server or the application front-end, the interface simulation system can respond to and process the interface simulation request, thereby achieving the effect of using the same device (i.e., the interface simulation system) to solve the simulation test problems between the front-end and the back-end, thereby improving the efficiency of application testing. In addition, since the pre-configured target simulation template corresponding to the first application has environmental attributes, by obtaining the target simulation template that matches the simulation environment information, the first application can select a matching template based on the current test environment of the first application for simulation response in the scenario of multiple test environments, thereby enabling the same application to have different simulation response results in different test environments, thereby ensuring the specificity and accuracy of interface simulation in different test environments.

[0112] In one embodiment, Figure 5As shown, the simulation server 410 includes a simulation injection component 411 , a simulation rule component 412 , a first simulation data parsing engine 413 , a simulation application management component 414 and a simulation core service component 415 .

[0113] The simulation injection component 411 is used to create and store simulation relationship information between the first application and the target application; the simulation relationship information includes the application identification information of the first application and the target simulation template; the target simulation template includes the application identification information of the target application and multiple simulation rules, each simulation rule includes the corresponding relationship between the request information of the interface simulation request and the response rule.

[0114] The simulation rule component 412 is used to store multiple simulation rules.

[0115] The first simulation data parsing engine 413 is used to parse the target response rule to obtain the target response data corresponding to the first simulation request.

[0116] The simulated application management component 414 is used to manage the creation, deletion or modification of applications. Optionally, the simulated application management component 414 creates an association relationship between the first application and the target application, and associates and stores the application identification information of the first application and the application identification information of the target application. After the association is stored, the simulated application management component 414 can delete or modify the first application and / or the target application.

[0117] The simulation core service component 415 is used to receive the first simulation request initiated by the backend server of the first application. Based on the first simulation request, the target simulation template matching the simulation environment information is obtained from the simulation injection component 411; according to the target simulation template, the interface information of the first interface and the request information of the first simulation request, the target response rule of the first simulation request is determined, and the target response rule is sent to the first simulation data parsing engine 413, which parses the target response rule and returns the parsing result.

[0118] In one embodiment, Figure 6 As shown, the simulation proxy terminal 420 includes a second simulation data parsing engine 422, and the second simulation data parsing engine 422 is used to parse the target response rule to obtain the target response data corresponding to the second simulation request.

[0119] In the above embodiment, the simulation interface system isolates the underlying logic and interaction logic of the simulation through the simulation injection component, the simulation rule component, the first simulation data parsing engine and the simulation application management component, wherein the underlying logic of the simulation is achieved by the cooperation between the components in the simulation server, and the interaction logic of the simulation (i.e., the interaction with the front end or the back end) is implemented by the simulation agent or the simulation core service component, thereby solving the simulation test problem between the front end and the back end through the same device (i.e., the simulation interface system). In addition, by deploying an independent second simulation data parsing engine inside the simulation agent, some simple rule parsing operations can be implemented with the help of the second simulation data parsing engine without requesting the simulation server, thereby greatly reducing the pressure on the simulation server.

[0120] Based on the same idea, an embodiment of the present application also provides an interface simulation device.

[0121] Figure 7 is a schematic block diagram of an interface simulation device according to an embodiment of the present application, such as Figure 7 As shown, the device comprises:

[0122] The receiving module 71 is used to receive a first interface simulation request of a first application; the first interface simulation request includes request information, interface information of the first interface and simulation environment information;

[0123] An acquisition module 72, configured to acquire a target simulation template that matches the simulation environment information; the target simulation template includes a correspondence between an interface of an application interface of the first application, request information of an interface simulation request, and a response rule;

[0124] A determination module 73, configured to determine a target response rule for the first interface simulation request according to the target simulation template, the interface information of the first interface and the request information;

[0125] The generating module 74 is used to generate target response data of the first interface simulation request according to the target response rule; the target response data is used to test the first application.

[0126] In one embodiment, the first interface simulation request is a first simulation request initiated by a backend server of the first application;

[0127] When acquiring the target simulation template that matches the simulation environment information, the acquisition module 72 performs the following steps:

[0128] The target simulation template is obtained through the simulation agent in the simulation interface system; the simulation agent is deployed in the back-end server.

[0129] In one embodiment, when acquiring the target simulation template through the simulation agent in the simulation interface system, the acquisition module 72 performs the following steps:

[0130] Obtain the target simulation template from the simulation server in the simulation interface system through the simulation proxy;

[0131] or,

[0132] The target simulation template is obtained from the designated space of the back-end server through the simulation agent. The target simulation template is obtained from the simulation server in advance by the simulation agent and is stored in the designated space of the back-end server.

[0133] In one embodiment, when generating target response data for the first interface simulation request according to the target response rule, the generating module 74 performs the following steps:

[0134] Parsing the target response rule through a simulation data parsing engine deployed on the simulation agent, and generating the target response data according to the parsing result;

[0135] or,

[0136] The target response rule is sent to the simulation server in the simulation interface system through the simulation proxy, the target response rule is parsed by the simulation data parsing engine deployed by the simulation server, and the target response data is generated according to the parsing result.

[0137] In one embodiment, the first interface simulation request is a second simulation request initiated by an application front end of the first application;

[0138] When acquiring the target simulation template that matches the simulation environment information, the acquisition module 72 performs the following steps:

[0139] Get the target simulation template through the simulation server in the simulation interface system.

[0140] In one embodiment, when determining the target response rule of the first interface simulation request according to the target simulation template, the interface information of the first interface and the request information, the determination module 73 performs the following steps:

[0141] In a case where the target simulation template includes request information of the first interface simulation request, a target response rule of the first interface simulation request is determined according to the target simulation template, the interface information of the first interface and the request information.

[0142] In one embodiment, the apparatus further comprises:

[0143] A creation module, used for creating simulation relationship information between the first application and the target application before receiving the first interface simulation request of the first application; the simulation relationship information includes application identification information of the first application and a target simulation template; the target simulation template includes the application identification information of the target application, the interface information of the application interface of the first application, the request information of the interface simulation request and the corresponding relationship between the response rules;

[0144] The storage module is used to store the simulation relationship information in the simulation server in the simulation interface system.

[0145] The device of the embodiment of the present application is adopted, by receiving the first interface simulation request of the first application, the first interface simulation request includes request information, interface information of the first interface and simulation environment information, and then obtaining a target simulation template matching the simulation environment information, the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request and the correspondence between the response rules; then according to the target simulation template, the interface information of the first interface and the request information, the target response rule of the first interface simulation request is determined, and the target response data of the first interface simulation request is generated according to the target response rule, and the target response data is used to test the first application. Since in the field of application testing, each application usually has multiple test environments, and the request information and response rules in different test environments are different, therefore, by obtaining a target simulation template matching the simulation environment information, the simulation environment information is used to characterize the current test environment, so that the first application can select a matching template based on the current test environment of the first application for simulation response in the scenario of multiple test environments, so that the same application can have different simulation response results in different test environments, ensuring the specificity and accuracy of interface simulation in different test environments.

[0146] Those skilled in the art should understand that Figure 7 The interface simulation device in can be used to implement the interface simulation method described above, and the detailed description thereof should be similar to the description of the method part above. To avoid tediousness, it will not be repeated here.

[0147] Based on the same idea, the embodiment of the present application also provides an electronic device, such as Figure 8As shown. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 801 and memory 802, and the memory 802 may store one or more storage applications or data. Among them, the memory 802 can be a temporary storage or a permanent storage. The application stored in the memory 802 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 801 can be configured to communicate with the memory 802 to execute a series of computer executable instructions in the memory 802 on the electronic device. The electronic device may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input and output interfaces 805, and one or more keyboards 806.

[0148] Specifically in this embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the electronic device, and the one or more programs are configured to be executed by one or more processors, including the following computer executable instructions:

[0149] Receiving an interface simulation request of a first application; the interface simulation request includes request information, interface information of the first interface and simulation environment information;

[0150] Acquire a target simulation template that matches the simulation environment information; the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request, and the correspondence between the response rules;

[0151] Determining a target response rule for the interface simulation request according to the target simulation template, the interface information of the first interface, and the request information;

[0152] According to the target response rule, target response data of the first interface simulation request is generated; the target response data is used to test the first application.

[0153] According to the technical solution of the embodiment of the present application, by receiving the first interface simulation request of the first application, the first interface simulation request includes request information, interface information of the first interface and simulation environment information, and then obtaining a target simulation template matching the simulation environment information, the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request and the correspondence between the response rules; then, according to the target simulation template, the interface information of the first interface and the request information, the target response rule of the first interface simulation request is determined, and the target response data of the first interface simulation request is generated according to the target response rule, and the target response data is used to test the first application. Since in the field of application testing, each application usually has multiple test environments, and the request information and response rules in different test environments are different, therefore, by obtaining a target simulation template matching the simulation environment information, the simulation environment information is used to characterize the current test environment, so that the first application can select a matching template for simulation response based on the current test environment of the first application in the scenario of multiple test environments, so that the same application can have different simulation response results in different test environments, ensuring the specificity and accuracy of interface simulation in different test environments.

[0154] The embodiment of the present application further proposes a computer-readable storage medium, which stores one or more computer programs, wherein the one or more computer programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to perform each process of the above-mentioned interface simulation method embodiment, and are specifically used to perform:

[0155] Receiving an interface simulation request of a first application; the interface simulation request includes request information, interface information of the first interface and simulation environment information;

[0156] Acquire a target simulation template that matches the simulation environment information; the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request, and the correspondence between the response rules;

[0157] Determining a target response rule for the interface simulation request according to the target simulation template, the interface information of the first interface, and the request information;

[0158] According to the target response rule, target response data of the first interface simulation request is generated; the target response data is used to test the first application.

[0159] According to the technical solution of the embodiment of the present application, by receiving the first interface simulation request of the first application, the first interface simulation request includes request information, interface information of the first interface and simulation environment information, and then obtaining a target simulation template matching the simulation environment information, the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request and the correspondence between the response rules; then, according to the target simulation template, the interface information of the first interface and the request information, the target response rule of the first interface simulation request is determined, and the target response data of the first interface simulation request is generated according to the target response rule, and the target response data is used to test the first application. Since in the field of application testing, each application usually has multiple test environments, and the request information and response rules in different test environments are different, therefore, by obtaining a target simulation template matching the simulation environment information, the simulation environment information is used to characterize the current test environment, so that the first application can select a matching template for simulation response based on the current test environment of the first application in the scenario of multiple test environments, so that the same application can have different simulation response results in different test environments, ensuring the specificity and accuracy of interface simulation in different test environments.

[0160] An embodiment of the present application provides a computer program product, including a computer program, which is executed by a processor to implement the various processes of the above-mentioned interface simulation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0161] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0162] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0163] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0164] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0165] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0166] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0167] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0168] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0169] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0170] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0171] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0172] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0173] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. An interface simulation method, characterized in that: The method comprises: Receiving a first interface simulation request of a first application; the first interface simulation request includes request information, interface information of the first interface and simulation environment information; Acquire a target simulation template that matches the simulation environment information; the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request, and the correspondence between the response rules; Determine a target response rule for the first interface simulation request according to the target simulation template, the interface information of the first interface, and the request information; According to the target response rule, target response data of the first interface simulation request is generated; the target response data is used to test the first application.

2. The method according to claim 1, characterized in that The first interface simulation request is a first simulation request initiated by a backend server of the first application; The step of acquiring a target simulation template that matches the simulation environment information includes: The target simulation template is obtained through the simulation agent in the simulation interface system; the simulation agent is deployed in the back-end server.

3. The method according to claim 2, characterized in that The step of obtaining the target simulation template through the simulation agent in the simulation interface system includes: Obtaining the target simulation template from the simulation server in the simulation interface system through the simulation proxy; or The pre-stored target simulation template is obtained from the designated space of the back-end server through the simulation agent. The target simulation template is obtained from the simulation server in advance by the simulation agent and pre-stored in the designated space of the back-end server.

4. The method according to claim 2, characterized in that: Generating target response data of the first interface simulation request according to the target response rule includes: The target response rule is parsed by a simulation data parsing engine deployed by the simulation agent, and the target response data is generated according to the parsing result; or, The target response rule is sent to the simulation server in the simulation interface system through the simulation proxy, the target response rule is parsed by the simulation data parsing engine deployed by the simulation server, and the target response data is generated according to the parsing result.

5. The method according to claim 1, characterized in that The first interface simulation request is a second simulation request initiated by the application front end of the first application; The step of acquiring a target simulation template that matches the simulation environment information includes: The target simulation template is obtained through the simulation server in the simulation interface system.

6. The method according to claim 1, characterized in that The determining, according to the target simulation template, the interface information of the first interface, and the request information, a target response rule for the first interface simulation request includes: In a case where the target simulation template includes the request information of the first interface simulation request, the target response rule of the first interface simulation request is determined according to the target simulation template, the interface information of the first interface and the request information.

7. The method according to claim 1, characterized in that Before receiving the first interface simulation request of the first application, the method further includes: Creating simulation relationship information between the first application and the target application; the simulation relationship information includes application identification information of the first application and the target simulation template, the target simulation template includes the application identification information of the target application, interface information of the application interface of the first application, and the correspondence between request information of the interface simulation request and response rules; The simulation relationship information is stored in the simulation service end in the simulation interface system.

8. An interface simulation device, characterized in that: The device comprises: A receiving module, configured to receive a first interface simulation request of a first application; the first interface simulation request includes request information, interface information of the first interface and simulation environment information; An acquisition module, used to acquire a target simulation template matching the simulation environment information; the target simulation template includes the interface information of the application interface of the first application, the request information of the interface simulation request, and the correspondence between the response rules; A determination module, configured to determine a target response rule for the first interface simulation request according to the target simulation template, the interface information of the first interface and the request information; A generation module is used to generate target response data of the first interface simulation request according to the target response rule; the target response data is used to test the first application.

9. An electronic device, characterized in that: The method comprises a processor and a memory electrically connected to the processor, wherein the memory stores a computer program, and the processor is used to call and execute the computer program from the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The storage medium is used to store a computer program, and the computer program can be executed by a processor to implement the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The method comprises a computer program which is executed by a processor to implement the method according to any one of claims 1 to 7.