CN116089002A - Data simulation method, device, system, equipment and storage medium - Google Patents

Data simulation method, device, system, equipment and storage medium Download PDF

Info

Publication number
CN116089002A
CN116089002A CN202211589423.2A CN202211589423A CN116089002A CN 116089002 A CN116089002 A CN 116089002A CN 202211589423 A CN202211589423 A CN 202211589423A CN 116089002 A CN116089002 A CN 116089002A
Authority
CN
China
Prior art keywords
target
interface
simulation
server
response
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211589423.2A
Other languages
Chinese (zh)
Inventor
程浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202211589423.2A priority Critical patent/CN116089002A/en
Publication of CN116089002A publication Critical patent/CN116089002A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Abstract

The embodiment of the invention discloses a data simulation method, a device, a system, equipment and a storage medium. The method is applied to a background server and comprises the following steps: acquiring the current running environment of a background server; if the current running environment is a preset simulation environment, starting a monitoring interface calling operation, and intercepting a target service request to be sent by a target calling interface; and sending the target calling interface identification information and the target service request to the simulation server so that the simulation server determines target simulation switch configuration information based on the target calling interface identification information and the simulation switch configuration information corresponding to each interface, and if the target simulation switch configuration information is simulation starting identification information, performing response simulation processing on the target service request to obtain target response simulation data and returning. By the technical scheme of the embodiment of the invention, the response simulation can be carried out on the interface in the background server, the original code is not required to be modified, and the simulation efficiency of the interface response is improved.

Description

Data simulation method, device, system, equipment and storage medium
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a data simulation method, apparatus, system, device, and storage medium.
Background
With the rapid development of computer technology, it is important to develop a simulation of interface response data in the joint debugging test phase so that the front end (e.g., client, browser, etc.) and the back end (i.e., background server) of the test can be independently developed.
Currently, data simulation of interface responses in the front-end can be performed using analog data generators, such as mock. Js, apilox, etc.
However, the existing interface response simulation mode is only directed at response simulation of the front-end interface, cannot be suitable for response simulation of the rear-end interface, and the simulation operation of the interface response can be completed only by manually modifying the original code, so that time and labor are wasted, and the simulation efficiency and test experience of the interface response are reduced.
Disclosure of Invention
The embodiment of the invention provides a data simulation method, a device, a system, equipment and a storage medium, which are used for performing response simulation on an interface in a background server, and an original code is not required to be modified, so that the simulation efficiency of interface response is improved, and the test experience is improved.
In a first aspect, an embodiment of the present invention provides a data simulation method, applied to a background server, including:
responding to the starting operation of a background server, and acquiring the current running environment of the background server;
If the current running environment is a preset simulation environment, starting interface calling operation in the background server, and intercepting a target service request to be sent by the target calling interface based on a target request intercepting mode corresponding to the current monitored target calling interface;
transmitting the target calling interface identification information and the intercepted target service request to a simulation server, so that the simulation server determines target simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and preset simulation switch configuration information corresponding to each interface, and if the target simulation switch configuration information is simulation starting identification information, performing response simulation processing on the target service request to obtain target response simulation data corresponding to the target calling interface;
and receiving the target response simulation data sent by the simulation server.
In a second aspect, an embodiment of the present invention provides an interface data simulation method, applied to a simulation server, including:
receiving target call interface identification information and a currently intercepted target service request sent by a background server, wherein the target service request is obtained by intercepting the background server in a target request intercepting mode, and the target request intercepting mode is a request intercepting mode corresponding to a currently intercepted target call interface;
Determining target analog switch configuration information corresponding to a target calling interface based on the target calling interface identification information and the analog switch configuration information corresponding to each pre-configured interface;
and if the configuration information of the target simulation switch is the simulation starting identification information, performing response simulation processing on the target service request to obtain target response simulation data corresponding to a target calling interface, and sending the target response simulation data to the background server.
In a third aspect, an embodiment of the present invention further provides a data simulation device, integrated in a background server, including:
the current running environment acquisition module is used for responding to the starting operation of the background server and acquiring the current running environment of the background server;
the target service request interception module is used for starting interface call operation in the background server if the current running environment is a preset simulation environment, and intercepting a target service request to be sent by the target call interface based on a target request interception mode corresponding to the current monitored target call interface;
the target service request sending module is used for sending target calling interface identification information and the intercepted target service request to the simulation server so that the simulation server determines target simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and preset simulation switch configuration information corresponding to each interface, and if the target simulation switch configuration information is simulation starting identification information, response simulation processing is carried out on the target service request to obtain target response simulation data corresponding to the target calling interface;
And the target response simulation data receiving module is used for receiving the target response simulation data sent by the simulation server.
In a fourth aspect, an embodiment of the present invention further provides a data simulation device, integrated in a simulation server, including:
the target service request receiving module is used for receiving target call interface identification information and a currently intercepted target service request sent by a background server, wherein the target service request is obtained by intercepting the background server in a target request intercepting mode, and the target request intercepting mode is a request intercepting mode corresponding to a currently intercepted target call interface;
the target simulation switch configuration information determining module is used for determining target simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and the preset simulation switch configuration information corresponding to each interface;
and the target response simulation data transmitting module is used for performing response simulation processing on the target service request if the configuration information of the target simulation switch is simulation starting identification information, obtaining target response simulation data corresponding to a target calling interface and transmitting the target response simulation data to the background server.
In a fifth aspect, an embodiment of the present invention further provides a data simulation system, including: a background server and an analog server;
wherein the background server is used for realizing the data simulation method provided by the first aspect;
the simulation server is for implementing the data simulation method as provided in the second aspect.
In a sixth aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data simulation method as provided by any embodiment of the present invention.
In a seventh aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a data simulation method as provided by any of the embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits:
by adding the simulation server, the simulation switch configuration information corresponding to each interface is pre-configured in the simulation server, so that whether each interface in the background server responds to simulation or not is dynamically controlled, and personalized requirements are met. After the background server is started, when the current running environment is a preset simulation environment, a monitoring function of interface calling operation in the background server can be automatically started, a target service request to be sent by a target calling interface is automatically intercepted based on a target request interception mode corresponding to the target calling interface which is monitored currently, and target calling interface identification information and the target service request are sent to the simulation server. When the configuration information of the target analog switch corresponding to the target calling interface is analog starting identification information, the analog server carries out response analog processing on the target service request and returns the obtained target response analog data, so that response analog of each interface in the background server is realized, original codes are not required to be modified, the analog efficiency of interface response is improved, and the test experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the prior art descriptions, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a data simulation method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a data simulation method according to an embodiment of the present invention;
FIG. 3 is a block diagram of a data modeling system in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data simulator according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a data simulator according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a data simulation system according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Fig. 1 is a flowchart of a data simulation method according to an embodiment of the present invention, where the embodiment is applicable to a case of simulating response data of an interface in a background server. The method can be performed by a data simulation device, which can be implemented in software and/or hardware, and integrated in a background server. As shown in fig. 1, the method specifically includes the following steps:
s110, responding to the starting operation of the background server, and acquiring the current running environment of the background server.
The background server may be a device for providing application services to the front end. The background server can call interfaces outwards or interfaces among micro services in the process of providing application services, such as calling interfaces of other servers to send service requests, obtaining intermediate response data and the like. The current operating environment may refer to the actual environment in which the background server is located after it is started. For example, the current operating environment may include: a production environment, a testing environment, or an on-line environment. The background servers are in different operating environments during different development phases.
Specifically, the background server may access and install a simulation SDK (Software Development Kit ) developed in advance, so that an interface of the background server implementing automation through the accessed simulation SDK responds to the simulation operation. The simulation SDK is only required to be accessed and installed in the background server, other operations are not required to be deployed, original codes are not required to be modified, and convenience in interface response simulation of the background server is greatly improved. When the background server integrates the simulation SDK, the simulation SDK can monitor the starting operation of the background server, for example, when the starting start event is monitored, the current running environment of the background server can be obtained, so that whether the simulation operation of interface response to the background server is needed or not can be determined based on the current running environment.
And S120, if the current running environment is a preset simulation environment, starting interface calling operation in the monitoring background server, and intercepting a target service request to be sent by the target calling interface based on a target request intercepting mode corresponding to the target calling interface which is monitored currently.
The preset simulation environment may be a preset environment in which interface response simulation operation is required. For example, the preset simulation environment may include a production environment, a test environment, and other non-online environments. The target call interface may be a service interface currently invoked by the background server. An interface may refer broadly to an abstract compound (which may be another entity) that an entity presents itself to the outside world, for purposes of separating external communication methods from internal operations, such that they can be modified internally without affecting the way other entities interact with it. For example, the back-office server call may interface to include: at least one remote procedure call RPC (Remote Procedure Call) interface and at least one hypertext transfer protocol HTTP (Hyper Text Transfer Protocol) interface. The target request interception mode is a request interception mode corresponding to the target call interface. The request interception modes corresponding to different kinds of interfaces are different. The target service request may refer to a service request that the background server invokes an interface to send.
Specifically, when the simulated SDK in the background server detects that the current running environment is the preset simulated environment, the simulated SDK indicates that the simulation operation of interface response is needed to be carried out on the background server, at this time, the simulated SDK can automatically start the interface calling operation in the monitoring background server, and automatically intercept the target service request to be sent by the target calling interface in a target request intercepting mode corresponding to the target calling interface which is monitored currently.
It should be noted that, if the current running environment is not the preset simulation environment, the monitoring operation of the calling interface is not required to be started, and at this time, the response logic can be called according to the normal interface, and the service request is sent to perform response processing. The simulation SDK in the background server can dynamically control whether the interface response simulation operation is performed or not by detecting whether the current running environment is a preset simulation environment or not, so that normal interface call response logic is compatible, personalized requirements are met, and convenience is improved.
Illustratively, "initiate interface call operation in listening background server" in S120 may include: the global simulation filter is mounted in the proxy object filter of each RPC interface in a reflection mode; and modifying the request interaction object in the request processing function of each HTTP interface into a simulation server by modifying the bottom layer byte code.
The byte code can refer to code recognized by a Java virtual machine, and is usually present in a file ending with a class file, which is the basis of Java cross-platform. It is a software-simulated CPU instruction system.
Specifically, for the RPC interface in the background server, the simulation SDK can dynamically mount the global simulation Filter in the SDK to all proxy object filters of the RPC interface in a reflection mode, so that when the proxy object of the RPC interface receives a service request, the service request passes through the global simulation Filter, and call monitoring of the RPC interface is realized. For the HTTP interfaces in the background server, the simulation SDK can logically enhance the request processing function (namely the HTTP excute function) of the bottom layer, namely, the function enhancement is carried out on the original HTTP bottom layer request by modifying the bottom layer byte code, and the request interaction object in the request processing function of each HTTP interface is modified from the original response server to the simulation server, so that the call monitoring of the HTTP interface is realized. The interface calling operation in the monitoring background server can be automatically started through simulating the SDK, the original code does not need to be manually modified, and the convenience of interface response simulation is improved.
For example, the "intercept a target service request to be sent by a target call interface based on a target request intercept mode corresponding to the target call interface that is currently monitored" in S120 may include: if the currently monitored target calling interface is an RPC interface, intercepting a target service request to be sent by the currently monitored target calling interface through a global simulation filter; if the current monitored target call interface is an HTTP interface, intercepting a target service request to be sent by the current monitored target call interface through the modified request processing function.
Specifically, after monitoring is started, if the target calling interface currently called by the background server is an RPC interface, a target service request to be sent by the target calling interface can be intercepted through the global simulation Filter, and at the moment, the global simulation Filter performs data interaction with the simulation server. If the current target calling interface of the background server is an HTTP interface, the target service request to be sent by the target calling interface can be intercepted by executing the modified request processing function, and at the moment, the background server and the simulation server perform data interaction.
S130, sending the target calling interface identification information and the intercepted target service request to a simulation server, so that the simulation server determines target simulation switch configuration information corresponding to the target calling interface based on the target calling interface identification information and the preset simulation switch configuration information corresponding to each interface, and if the target simulation switch configuration information is simulation starting identification information, performing response simulation processing on the target service request to obtain target response simulation data corresponding to the target calling interface.
The target call interface identification information may be information for uniquely identifying the target call interface so as to distinguish between different call interfaces. The simulation server may be a device for simulating interface response data in the background server. The target analog switch configuration information can be dynamically configured based on service requirements and is used for representing whether a response analog function of the target call interface is started currently or not. The target analog switch configuration information may include: simulated open identification information and simulated closed identification information. The analog unlock identification information may be information for characterizing an unlock interface response analog function, such as true. The analog shutdown identification information may be information, such as false, that characterizes the shutdown interface in response to analog functions.
Specifically, the analog switch configuration information corresponding to each interface can be preconfigured in the analog server based on the service requirement, so that whether each interface in the background server responds to the simulation or not can be controlled independently, and the personalized requirement is met. When the target calling interface is an RPC interface, the background server can send the target calling interface identification information and the target service request to the simulation server through the global simulation Filter. When the target calling interface is an HTTP interface, the background server can send the target calling interface identification information and the target service request to the simulation server by executing the modified request processing function. The simulation server can determine the target simulation switch configuration information corresponding to the target calling interface identification information based on the received target calling interface identification information and the preset simulation switch configuration information corresponding to each interface. If the configuration information of the target simulation switch is detected to be the simulation start identification information, the interface is indicated to need to be subjected to response simulation, at the moment, response simulation processing can be performed on the target service request based on a request response document corresponding to the interface, target response simulation data corresponding to the target service request are determined, and the target response simulation data are sent to a background server.
If the detected configuration information of the target analog switch is analog closing identification information, it indicates that response simulation is not needed for the interface, and at this time, a normal response instruction may be sent to the background server. After receiving the normal response instruction, the background server can stop the interception operation and send the target service request to the actual server for normal response processing.
If the simulation server supports interface response simulation of multiple background servers at the same time, the simulation server sends the target calling interface identification information and the target service request to the simulation server, and further needs to send the target IP address corresponding to the current background server to the simulation server, so that the simulation server can determine the target simulation switch configuration information corresponding to the target calling interface in the current background server based on the target IP address, the target calling interface identification information and the simulation switch configuration information corresponding to each interface configured for each background server in advance, and when the target simulation switch configuration information is the simulation start identification information, response simulation processing is performed on the target service request.
S140, receiving target response simulation data sent by the simulation server.
Specifically, the background server receives the target response simulation data sent by the simulation server, and completes response simulation of the target call interface in the background server, so that the response simulation of each interface in the background server can be realized, original codes are not required to be modified, the simulation efficiency of interface response is improved, and the test experience is improved.
The simulation server can directly respond to the target service request after determining the target simulation switch configuration information corresponding to the target call interface to obtain target response simulation data corresponding to the target call interface, and send the target response simulation data and the target simulation switch configuration information to the background server to detect whether the target simulation switch configuration information is simulation start identification information or simulation close identification information in the background server, if the target simulation switch configuration information is simulation start identification information, the background server allows the interface to respond to simulation, and the received target response simulation data is used as final response data of the target service request to perform subsequent service operation; if the closing identification information is simulated, the background server prohibits interface response simulation, ignores the received target response simulation data, and sends a target service request to the actual server for normal response processing.
According to the technical scheme, the simulation server is added, and the simulation switch configuration information corresponding to each interface is pre-configured in the simulation server, so that whether each interface in the background server is subjected to response simulation or not is dynamically controlled, and personalized requirements are met. After the background server is started, when the current running environment is a preset simulation environment, a monitoring function of interface calling operation in the background server can be automatically started, a target service request to be sent by a target calling interface is automatically intercepted based on a target request interception mode corresponding to the target calling interface which is monitored currently, and target calling interface identification information and the target service request are sent to the simulation server. When the configuration information of the target analog switch corresponding to the target calling interface is analog starting identification information, the analog server responds to the target service request, and returns the obtained target response analog data, so that the requirement of interface response simulation in the background server is effectively met, the original code is not required to be modified, the interface response simulation efficiency is improved, and the test experience is improved.
Based on the above technical solution, before "monitor interface call operation in background server" in S120, the method may further include: acquiring interface identification information and current interface configuration item information corresponding to each interface in a background server, and sending the interface identification information and the current interface configuration item information to a simulation server for interface registration; and sending an interface configuration item acquisition request corresponding to each interface to the simulation server through an asynchronous thread, carrying out configuration updating on the corresponding current interface configuration item information based on the current newly configured target interface configuration item information corresponding to each interface returned by the simulation server, and carrying out request response processing on each interface based on the updated interface configuration item information.
Wherein the interface configuration item may refer to a configurable interface parameter. For example, the interface configuration items may include: interface aliases, interface response packets, retry times, and timeout times. The interface configuration item information may refer to parameter value information of the interface configuration item. The current interface configuration item information may refer to interface configuration item information configured by each interface in the background server at the current time. The target interface configuration item information may refer to interface configuration item information newly configured for each interface in the simulation server.
Specifically, after each time the background server is started, the analog SDK may automatically acquire interface identification information and current interface configuration item information of each interface in the background server, and encapsulate and register the data into the analog server. For example, the emulated SDK may read the configuration item of the proxy object (i.e., current interface configuration item information) and the identification information of the current proxy object (i.e., interface identification information) for each RPC interface. The simulation server can determine whether the interface is registered currently or not based on the interface identification information, if so, the currently stored interface configuration item information can be updated into the received current interface configuration item information, and if not, the interface configuration information is newly added, so that automatic registration of the interface can be completed, manual one-to-one registration is omitted, and research and measurement time is saved. After each interface is successfully registered, the user can perform configuration operation on any registered interface in the simulation server. For example, the simulation server may display the current interface configuration item information corresponding to each registered interface to the simulation configuration end, so that the user may be prompted about the current interface configuration item information of each interface in the background server. The personnel with the configuration authority can modify the displayed information of the current interface configuration item based on the service requirement, so that the dynamic configuration of the interface configuration item can be realized.
After the interface identification information and the current interface configuration item information corresponding to each interface are sent to the simulation server, the simulation SDK can start an asynchronous thread, and send an interface configuration item acquisition request corresponding to each interface to the simulation server through the started asynchronous thread, so that whether the current interface configuration item information of each interface is consistent with the current latest configured target interface configuration item information in the simulation server or not is inquired in a polling mode, if not, the background server can reinitialize the proxy object of the interface according to the current latest configured target interface configuration item information, and therefore request response processing can be carried out on the interface according to the latest interface configuration item information. When configuration modification exists in the simulation server, the simulation SDK can automatically refresh interface configuration, so that higher-order simulation requirements are supported.
Fig. 2 is a flowchart of a data simulation method according to an embodiment of the present invention, where the embodiment is applicable to a case of simulating response data of an interface in a background server. The method may be performed by a data simulation device, which may be implemented in software and/or hardware, integrated in a simulation server. As shown in fig. 2, the method specifically includes the following steps:
S210, receiving target call interface identification information and a currently intercepted target service request sent by a background server, wherein the target service request is obtained by intercepting the background server in a target request intercepting mode, and the target request intercepting mode is a request intercepting mode corresponding to a currently intercepted target call interface.
The background server may be a device for providing application services to the front end. The simulation server may be a device for simulating interface response data in the background server. The target call interface identification information may be information for uniquely identifying the target call interface in order to distinguish between different call interfaces.
Specifically, fig. 3 shows an architecture diagram of a data simulation system. As shown in fig. 3, the background server may access and install a pre-developed analog SDK, after the background server is started, when the analog SDK monitors the starting operation of the background server, the analog SDK obtains the current running environment of the background server, and when the current running environment is a preset analog environment, the analog SDK may automatically start the interface calling operation in the monitoring background server, and automatically intercept, by using a target request intercepting mode corresponding to the target calling interface that is currently monitored, a target service request to be sent by the target calling interface, and send target calling interface identification information and the target service request to the analog server, so that the analog server receives the target service request currently intercepted by the background server and the target calling interface identification information currently invoked.
S220, determining target analog switch configuration information corresponding to the target calling interface based on the target calling interface identification information and the analog switch configuration information corresponding to each pre-configured interface.
The target simulation switch configuration information can be dynamically configured based on service requirements and is used for representing whether a response simulation function of the target call interface is started currently. The target analog switch configuration information may include: simulated open identification information and simulated closed identification information. The analog unlock identification information may be information for characterizing an unlock interface response analog function, such as true. The analog shutdown identification information may be information, such as false, that characterizes the shutdown interface in response to analog functions.
Specifically, as shown in fig. 3, the configuration information of the analog switch corresponding to each interface in the background server can be preconfigured based on the service requirement through the analog configuration end of the analog server, so that whether each interface in the background server performs response simulation or not can be controlled independently, and personalized requirements are met. The simulation server can determine the target simulation switch configuration information corresponding to the target calling interface identification information based on the received target calling interface identification information and the preset simulation switch configuration information corresponding to each interface. If the detected target simulation switch configuration information is the simulation closing identification information, the interface is not required to be subjected to response simulation, and a normal response instruction can be sent to a background server. After receiving the normal response instruction, the background server can stop the interception operation and send the target service request to the actual server for normal response processing.
It should be noted that, the interface responds to the analog operation of the data, and the analog function can be turned on or off only by operating a switch in the analog configuration end of the analog server, without restarting the original service, so as to support the more complex analog combination requirement.
For example, if the simulation server supports interface response simulation of multiple background servers at the same time, the background server sends the target calling interface identification information and the target service request to the simulation server, and further needs to send the target IP address corresponding to the current background server to the simulation server, so that the simulation server can determine the target simulation switch configuration information corresponding to the target calling interface in the current background server based on the target IP address, the target calling interface identification information and the simulation switch configuration information corresponding to each interface configured for each background server in advance.
And S230, if the configuration information of the target analog switch is analog starting identification information, performing response analog processing on the target service request to obtain target response analog data corresponding to the target calling interface, and sending the target response analog data to the background server.
Specifically, if the simulation server detects that the configuration information of the target simulation switch is the simulation start identification information, the simulation server indicates that response simulation is required for the interface, at the moment, response simulation processing can be performed on the target service request based on a request response document corresponding to the interface, target response simulation data corresponding to the target service request is determined, and the target response simulation data is sent to the background server, so that response simulation of a target call interface in the background server is completed, original codes in the background server are not required to be modified, the simulation efficiency of interface response in the background server is improved, and test experience is improved.
The simulation server can directly respond to the target service request after determining the target simulation switch configuration information corresponding to the target call interface to obtain target response simulation data corresponding to the target call interface, and send the target response simulation data and the target simulation switch configuration information to the background server to detect whether the target simulation switch configuration information is simulation start identification information or simulation close identification information in the background server, if the target simulation switch configuration information is simulation start identification information, the background server allows the interface to respond to simulation, and the received target response simulation data is used as final response data of the target service request to perform subsequent service operation; if the closing identification information is simulated, the background server prohibits interface response simulation, ignores the received target response simulation data, and sends a target service request to the actual server for normal response processing.
According to the technical scheme, the simulation server is added, and the simulation switch configuration information corresponding to each interface is pre-configured in the simulation server, so that whether each interface in the background server is subjected to response simulation or not is dynamically controlled, and personalized requirements are met. After the background server is started, when the current running environment is a preset simulation environment, a monitoring function of interface calling operation in the background server can be automatically started, a target service request to be sent by a target calling interface is automatically intercepted based on a target request interception mode corresponding to the target calling interface which is monitored currently, and target calling interface identification information and the target service request are sent to the simulation server. When the configuration information of the target analog switch corresponding to the target calling interface is analog starting identification information, the analog server responds to the target service request, and returns the obtained target response analog data, so that the requirement of interface response simulation in the background server is effectively met, the original code is not required to be modified, the interface response simulation efficiency is improved, and the test experience is improved.
Based on the above technical solution, the "performing response simulation processing on the target service request to obtain target response simulation data corresponding to the target call interface" in S230 may include: acquiring current request parameter information corresponding to target request parameters in a target service request based on pre-configured target request parameters; and if the current request parameter information is detected to be matched with the pre-configured target request parameter information, performing response simulation processing on the target service request to obtain target response simulation data corresponding to the target calling interface.
The target request parameter may be a request parameter that is pre-specified and included in the service request that allows the response simulation. For example, the target request parameter may refer to a user account. The target request parameter information may be a specific parameter value corresponding to the target request parameter so that response simulation is performed only on requests satisfying the parameter information.
Specifically, as shown in fig. 3, the configuration of the designated parameters may be performed in the simulation configuration end, so that the simulation server obtains the configured target request parameters and corresponding target request parameter information. After receiving the target service request, the simulation server can obtain current request parameter information corresponding to the target request parameter in the target service request, and detect whether the current request parameter information is matched with the target request parameter information, for example, whether the current request parameter information is equal to the target request parameter information, or whether the current request parameter information meets configured condition information, for example, whether the current request parameter information is larger than a configuration value, and the like. If the matching is successful, the target service request can be allowed to be subjected to response simulation to obtain target response simulation data, and if the matching is failed, the target service request can be forbidden to be subjected to response simulation, so that simulation of specified parameters is realized, namely, only the service request meeting the conditions is subjected to response simulation, the actual application scene is more met, the original service is not required to be restarted, and the convenience of interface response simulation is improved.
Based on the above technical solution, the "performing response simulation processing on the target service request to obtain target response simulation data corresponding to the target call interface" in S230 may further include: determining target abnormal simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and the preset abnormal simulation switch configuration information corresponding to each interface; and if the configuration information of the target abnormal simulation switch is abnormal simulation starting identification information, taking the preset response abnormal data as target response simulation data corresponding to the target calling interface.
The configuration information of the abnormal simulation switch can be dynamically configured based on service requirements and is used for representing whether an interface abnormal simulation function is started currently. The anomaly simulation switch configuration information may include: abnormal simulation start identification information and abnormal simulation close identification information. The abnormal simulation start identification information may be information for characterizing an abnormal simulation function of the start interface, such as true. The analog shutdown identification information may be information, such as false, used to characterize shutdown interface anomaly simulation functions. The preset response anomaly data may be a response anomaly result configured in advance based on the service requirement, such as response timeout, etc.
Specifically, as shown in fig. 3, the configuration of the abnormal analog switch may be performed in the analog configuration terminal, so that the analog server obtains the configuration information of the abnormal analog switch corresponding to each interface. When the configuration information of the target analog switch is analog starting identification information, whether the configuration information of the target abnormal analog switch corresponding to the target calling interface is the abnormal analog starting identification information or the abnormal analog closing identification information can be detected, if the configuration information of the target analog switch is the abnormal analog starting identification information, the interface is required to be subjected to abnormal response simulation, and preset response abnormal data corresponding to the target calling interface can be directly returned as target response simulation data at the moment, so that response abnormality can be directly thrown out, various interface response data return conditions can be more conveniently simulated, and test experience is further improved. If the abnormal simulation closes the identification information, the interface is not required to be simulated in abnormal response, and at the moment, normal response simulation can be performed according to the original response simulation mode.
Based on the technical scheme, the method further comprises the following steps: receiving interface identification information and current interface configuration item information corresponding to each interface sent by a background server, and performing interface registration based on the interface identification information and the current interface configuration item information; the control simulation configuration end displays the current interface configuration item information corresponding to each registered interface, and determines the target interface configuration item information which is currently configured up to date based on information updating operation triggered by the displayed current interface configuration item information by a user.
The simulation configuration end may refer to a background management device of the simulation server, and is configured to perform a configuration operation on simulation information in the background server. The interface configuration item may refer to an interface parameter configurable in the background server. For example, the interface configuration items may include: interface aliases, interface response packets, retry times, and timeout times. The interface configuration item information may refer to parameter value information of the interface configuration item. The current interface configuration item information may refer to interface configuration item information configured by each interface in the background server at the current time. The target interface configuration item information may refer to interface configuration item information newly configured for each interface.
Specifically, after each time the background server is started, the analog SDK may automatically acquire interface identification information and current interface configuration item information of each interface in the background server, and encapsulate and register the data into the analog server. The simulation server can determine whether the interface is registered currently or not based on the interface identification information, if so, the currently stored interface configuration item information can be updated into the received current interface configuration item information, and if not, the interface configuration information is newly added, so that automatic registration of the interface can be completed, manual one-to-one registration is omitted, and research and measurement time is saved. After each interface is successfully registered, the simulation server can display the current interface configuration item information corresponding to each successfully registered interface on the simulation configuration terminal. The personnel with the configuration authority can modify the displayed current interface configuration item information based on the service requirement so as to configure the latest target interface configuration item information, so that the background server can perform request response processing based on the latest configured target interface configuration item information, and the dynamic configuration of the interface configuration items is realized.
It should be noted that, the user can perform personalized configuration on the interface simulation flow in the background server in the simulation configuration terminal, so that the data simulation can be easily managed, and complex data simulation requirements can be easily met. From access to use, the original codes in the background server do not need to be modified, and the interface can be dynamically and freely controlled to return results, so that the research experience is greatly improved.
The following is an embodiment of a data simulation device integrated in a background server, where the device and the data simulation method applied in the background server in the foregoing embodiments belong to the same inventive concept, and details of the embodiment of the data simulation device are not described in detail, and reference may be made to the embodiment of the foregoing data simulation method.
Fig. 4 is a schematic structural diagram of a data simulation device according to an embodiment of the present invention, where the embodiment is applicable to a case of performing data simulation on an interface response in a background server. As shown in fig. 4, the device is integrated in a background server, and specifically includes: the system comprises a current running environment acquisition module 410, a target service request interception module 420, a target service request sending module 430 and a target response simulation data receiving module 440.
The current running environment obtaining module 410 is configured to obtain a current running environment of a background server in response to a starting operation of the background server; the target service request interception module 420 is configured to, if the current operating environment is a preset simulation environment, start to monitor an interface call operation in the background server, and intercept a target service request to be sent by the target call interface based on a target request interception mode corresponding to the target call interface that is monitored currently; the target service request sending module 430 is configured to send the target calling interface identification information and the intercepted target service request to a simulation server, so that the simulation server determines target simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and simulation switch configuration information corresponding to each pre-configured interface, and if the target simulation switch configuration information is simulation start identification information, performs response simulation processing on the target service request to obtain target response simulation data corresponding to the target calling interface; and a target response simulation data receiving module 440, configured to receive the target response simulation data sent by the simulation server.
Optionally, the interface called by the background server includes: at least one remote procedure call RPC interface and at least one hypertext transfer protocol HTTP interface.
Optionally, the target service request interception module 420 is specifically configured to:
the global simulation filter is mounted in the proxy object filter of each RPC interface in a reflection mode; and modifying the request interaction object in the request processing function of each HTTP interface into the simulation server by modifying the bottom layer byte code.
Optionally, the target service request interception module 420 is specifically configured to:
if the currently monitored target calling interface is an RPC interface, intercepting a target service request to be sent by the currently monitored target calling interface through the global simulation filter;
if the current monitored target call interface is an HTTP interface, intercepting a target service request to be sent by the current monitored target call interface through the modified request processing function.
Optionally, the apparatus further comprises:
the configuration item information sending module is used for acquiring interface identification information and current interface configuration item information corresponding to each interface in the background server before monitoring interface calling operation in the background server, and sending the interface identification information and the current interface configuration item information to the simulation server for interface registration;
And the interface configuration item information updating module is used for sending an interface configuration item acquisition request corresponding to each interface to the simulation server through an asynchronous thread, carrying out configuration updating on the corresponding current interface configuration item information based on the current newly configured target interface configuration item information corresponding to each interface returned by the simulation server, and carrying out request response processing on each interface based on the updated interface configuration item information.
The data simulation device provided by the embodiment of the invention can execute the data simulation method applied to the background server and has the corresponding functional modules and beneficial effects of executing the data simulation method.
The following is an embodiment of a data simulation device integrated in a simulation server, which belongs to the same inventive concept as the data simulation method applied to the simulation server in the above embodiments, and details of the embodiment of the data simulation device, which are not described in detail, may refer to the embodiment of the above data simulation method.
Fig. 5 is a schematic structural diagram of a data simulation device according to an embodiment of the present invention, where the embodiment is applicable to a case of performing data simulation on an interface response in a background server. As shown in fig. 5, the device is integrated in an analog server, and specifically includes: a target service request receiving module 510, a target analog switch configuration information determining module 520, and a target response analog data transmitting module 530.
The target service request receiving module 510 is configured to receive target call interface identification information and a currently intercepted target service request sent by a background server, where the target service request is obtained by intercepting the background server in a target request intercepting manner, and the target request intercepting manner is a request intercepting manner corresponding to a currently monitored target call interface; the target analog switch configuration information determining module 520 is configured to determine target analog switch configuration information corresponding to a target calling interface based on the target calling interface identification information and analog switch configuration information corresponding to each pre-configured interface; and the target response simulation data sending module 530 is configured to, if the target simulation switch configuration information is simulation start identification information, perform response simulation processing on the target service request, obtain target response simulation data corresponding to a target call interface, and send the target response simulation data to the background server.
Optionally, the target response analog data transmitting module 530 includes: a target response simulation data determining unit;
the target response simulation data determining unit is specifically configured to: acquiring current request parameter information corresponding to the target request parameter in the target service request based on a pre-configured target request parameter; and if the current request parameter information is detected to be matched with the pre-configured target request parameter information, performing response simulation processing on the target service request to obtain target response simulation data corresponding to a target calling interface.
Optionally, the target response simulation data determining unit is further specifically configured to:
determining target abnormal simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and the preset abnormal simulation switch configuration information corresponding to each interface; and if the configuration information of the target abnormal simulation switch is abnormal simulation starting identification information, taking preset response abnormal data as target response simulation data corresponding to a target calling interface.
Optionally, the apparatus further comprises:
the interface registration module is used for receiving the interface identification information and the current interface configuration item information corresponding to each interface sent by the background server, and carrying out interface registration based on the interface identification information and the current interface configuration item information;
the interface configuration item information display module is used for controlling the simulation configuration end to display the current interface configuration item information corresponding to each registered interface, and determining the target interface configuration item information of the current latest configuration based on the information updating operation triggered by the user on the displayed current interface configuration item information.
The data simulation device provided by the embodiment of the invention can execute the data simulation method applied to the simulation server and has the corresponding functional modules and beneficial effects of executing the data simulation method.
Fig. 6 is a schematic structural diagram of a data simulation system according to an embodiment of the present invention, where the embodiment is applicable to a case of performing data simulation on an interface response in a background server. As shown in fig. 6, the system specifically includes: a background server 610 and a simulation server 620.
The background server 610 is configured to implement the data simulation method applied to the background server as provided above; the simulation server 620 is used to implement the data simulation method applied to the simulation server as provided above.
According to the data simulation system in the embodiment of the disclosure, the simulation server is added, and the simulation switch configuration information corresponding to each interface is pre-configured in the simulation server, so that whether each interface in the background server is subjected to response simulation or not is dynamically controlled, and personalized requirements are met. After the background server is started, when the current running environment is a preset simulation environment, a monitoring function of interface calling operation in the background server can be automatically started, a target service request to be sent by a target calling interface is automatically intercepted based on a target request interception mode corresponding to the target calling interface which is monitored currently, and target calling interface identification information and the target service request are sent to the simulation server. When the configuration information of the target analog switch corresponding to the target calling interface is analog starting identification information, the analog server carries out response analog processing on the target service request and returns the obtained target response analog data, so that response analog of each interface in the background server is realized, original codes are not required to be modified, the analog efficiency of interface response is improved, and the test experience is improved.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Fig. 7 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 7 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 7, the electronic device 12 is in the form of a general purpose computing device. Components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard disk drive"). Although not shown in fig. 7, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 over the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing any of the data simulation methods provided by the embodiments of the present invention.
Of course, those skilled in the art will understand that the processor may also implement the technical solution of the data simulation method provided in any embodiment of the present invention.
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements any one of the data simulation methods provided by the embodiments of the present invention.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
It will be appreciated by those of ordinary skill in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed over a network of computing devices, or they may alternatively be implemented in program code executable by a computer device, such that they are stored in a memory device and executed by the computing device, or they may be separately fabricated as individual integrated circuit modules, or multiple modules or steps within them may be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (14)

1. The data simulation method is characterized by being applied to a background server and comprising the following steps of:
responding to the starting operation of a background server, and acquiring the current running environment of the background server;
if the current running environment is a preset simulation environment, starting interface calling operation in the background server, and intercepting a target service request to be sent by the target calling interface based on a target request intercepting mode corresponding to the current monitored target calling interface;
transmitting the target calling interface identification information and the intercepted target service request to a simulation server, so that the simulation server determines target simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and preset simulation switch configuration information corresponding to each interface, and if the target simulation switch configuration information is simulation starting identification information, performing response simulation processing on the target service request to obtain target response simulation data corresponding to the target calling interface;
and receiving the target response simulation data sent by the simulation server.
2. The method of claim 1, wherein the interface invoked by the background server comprises: at least one remote procedure call RPC interface and at least one hypertext transfer protocol HTTP interface.
3. The method of claim 2, wherein the initiating a snoop interface call operation in the background server comprises:
the global simulation filter is mounted in the proxy object filter of each RPC interface in a reflection mode;
and modifying the request interaction object in the request processing function of each HTTP interface into the simulation server by modifying the bottom layer byte code.
4. The method according to claim 3, wherein the intercepting the target service request to be sent by the target call interface based on the target request intercepting manner corresponding to the target call interface that is currently monitored includes:
if the currently monitored target calling interface is an RPC interface, intercepting a target service request to be sent by the currently monitored target calling interface through the global simulation filter;
if the current monitored target call interface is an HTTP interface, intercepting a target service request to be sent by the current monitored target call interface through the modified request processing function.
5. The method of claim 1, further comprising, prior to listening for an interface call operation in the background server:
Acquiring interface identification information and current interface configuration item information corresponding to each interface in the background server, and sending the interface identification information and the current interface configuration item information to the simulation server for interface registration;
and sending an interface configuration item acquisition request corresponding to each interface to the simulation server through an asynchronous thread, carrying out configuration updating on corresponding current interface configuration item information based on the current newly configured target interface configuration item information corresponding to each interface returned by the simulation server, and carrying out request response processing on each interface based on the updated interface configuration item information.
6. An interface data simulation method, which is applied to a simulation server, comprises the following steps:
receiving target call interface identification information and a currently intercepted target service request sent by a background server, wherein the target service request is obtained by intercepting the background server in a target request intercepting mode, and the target request intercepting mode is a request intercepting mode corresponding to a currently intercepted target call interface;
determining target analog switch configuration information corresponding to a target calling interface based on the target calling interface identification information and the analog switch configuration information corresponding to each pre-configured interface;
And if the configuration information of the target simulation switch is the simulation starting identification information, performing response simulation processing on the target service request to obtain target response simulation data corresponding to a target calling interface, and sending the target response simulation data to the background server.
7. The method of claim 6, wherein the performing response simulation processing on the target service request to obtain target response simulation data corresponding to a target call interface includes:
acquiring current request parameter information corresponding to the target request parameter in the target service request based on a pre-configured target request parameter;
and if the current request parameter information is detected to be matched with the pre-configured target request parameter information, performing response simulation processing on the target service request to obtain target response simulation data corresponding to a target calling interface.
8. The method of claim 6, wherein the performing response simulation processing on the target service request to obtain target response simulation data corresponding to a target call interface includes:
determining target abnormal simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and the preset abnormal simulation switch configuration information corresponding to each interface;
And if the configuration information of the target abnormal simulation switch is abnormal simulation starting identification information, taking preset response abnormal data as target response simulation data corresponding to a target calling interface.
9. The method of claim 6, wherein the method further comprises:
receiving interface identification information and current interface configuration item information corresponding to each interface sent by the background server, and carrying out interface registration based on the interface identification information and the current interface configuration item information;
the control simulation configuration end displays the current interface configuration item information corresponding to each registered interface, and determines the target interface configuration item information which is currently configured up to date based on information updating operation triggered by the displayed current interface configuration item information by a user.
10. A data simulation device integrated in a background server, comprising:
the current running environment acquisition module is used for responding to the starting operation of the background server and acquiring the current running environment of the background server;
the target service request interception module is used for starting interface call operation in the background server if the current running environment is a preset simulation environment, and intercepting a target service request to be sent by the target call interface based on a target request interception mode corresponding to the current monitored target call interface;
The target service request sending module is used for sending target calling interface identification information and the intercepted target service request to the simulation server so that the simulation server determines target simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and preset simulation switch configuration information corresponding to each interface, and if the target simulation switch configuration information is simulation starting identification information, response simulation processing is carried out on the target service request to obtain target response simulation data corresponding to the target calling interface;
and the target response simulation data receiving module is used for receiving the target response simulation data sent by the simulation server.
11. A data simulation device integrated in a simulation server, comprising:
the target service request receiving module is used for receiving target call interface identification information and a currently intercepted target service request sent by a background server, wherein the target service request is obtained by intercepting the background server in a target request intercepting mode, and the target request intercepting mode is a request intercepting mode corresponding to a currently intercepted target call interface;
The target simulation switch configuration information determining module is used for determining target simulation switch configuration information corresponding to a target calling interface based on the target calling interface identification information and the preset simulation switch configuration information corresponding to each interface;
and the target response simulation data transmitting module is used for performing response simulation processing on the target service request if the configuration information of the target simulation switch is simulation starting identification information, obtaining target response simulation data corresponding to a target calling interface and transmitting the target response simulation data to the background server.
12. A data simulation system, the system comprising: a background server and an analog server;
wherein the background server is used for realizing the data simulation method according to any one of claims 1-5;
the simulation server is configured to implement the data simulation method according to any one of claims 6-9.
13. An electronic device, the electronic device comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, causes the one or more processors to implement the data simulation method of any of claims 1-9.
14. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a data simulation method according to any of claims 1-9.
CN202211589423.2A 2022-12-09 2022-12-09 Data simulation method, device, system, equipment and storage medium Pending CN116089002A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211589423.2A CN116089002A (en) 2022-12-09 2022-12-09 Data simulation method, device, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211589423.2A CN116089002A (en) 2022-12-09 2022-12-09 Data simulation method, device, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116089002A true CN116089002A (en) 2023-05-09

Family

ID=86209311

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211589423.2A Pending CN116089002A (en) 2022-12-09 2022-12-09 Data simulation method, device, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116089002A (en)

Similar Documents

Publication Publication Date Title
US11509505B2 (en) Method and apparatus for operating smart network interface card
US11457108B2 (en) Cloud integration to desktop-based emergency service applications
CN110647739A (en) Software installation detection method, device, terminal and storage medium
CN112769876B (en) Method, device, equipment and medium for acquiring equipment channel information
CN110677307B (en) Service monitoring method, device, equipment and storage medium
CN110881224B (en) Network long connection method, device, equipment and storage medium
CN113220342A (en) Centralized configuration method and device, electronic equipment and storage medium
CN110995538B (en) Network data acquisition method, device, system, equipment and storage medium
CN116089002A (en) Data simulation method, device, system, equipment and storage medium
CN113296911B (en) Cluster calling method, cluster calling device, electronic equipment and readable storage medium
CN114785861A (en) Service request forwarding system, method, computer equipment and storage medium
CN113434384B (en) Pressure testing method and device
CN114490266A (en) Data acquisition method, device, equipment and storage medium
CN109756393B (en) Information processing method, system, medium, and computing device
CN111382057B (en) Test case generation method, test method and device, server and storage medium
US10516767B2 (en) Unifying realtime and static data for presenting over a web service
CN116389194B (en) VPN service generation method, system, equipment and medium based on cloud computing platform
CN110554942A (en) method and device for monitoring code execution
CN115242658B (en) Open system access method, device, computer equipment and storage medium
CN110011767B (en) Method and apparatus for TCP connection backup
CN113050956A (en) Method, apparatus, medium, and program product for automatically installing application
CN114461261A (en) System increment synchronization method and device, storage medium and electronic equipment
CN116974685A (en) Method and related device for detecting abnormal system call in container
CN115686573A (en) Cloud desktop client and software upgrading method thereof
CN114915651A (en) Websocket management method and device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination