CN115576711A - Method and system for simulating returned data and computing equipment - Google Patents

Method and system for simulating returned data and computing equipment Download PDF

Info

Publication number
CN115576711A
CN115576711A CN202211177323.9A CN202211177323A CN115576711A CN 115576711 A CN115576711 A CN 115576711A CN 202211177323 A CN202211177323 A CN 202211177323A CN 115576711 A CN115576711 A CN 115576711A
Authority
CN
China
Prior art keywords
data
return data
client
service interface
real
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
CN202211177323.9A
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 Chezhiying Technology Co ltd
Original Assignee
Beijing Chezhiying 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 Chezhiying Technology Co ltd filed Critical Beijing Chezhiying Technology Co ltd
Priority to CN202211177323.9A priority Critical patent/CN115576711A/en
Publication of CN115576711A publication Critical patent/CN115576711A/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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a system and a computing device for simulating return data, wherein the method is executed in a simulation server to simulate a service interface to return data, the simulation server is respectively in communication connection with a client and a real server, the real server comprises the service interface, and the method comprises the following steps: receiving a calling request of a client to the service interface based on a module to be tested, and acquiring request data from the calling request; the service interface is called based on request data simulation so as to obtain real return data returned by the service interface; generating snapshot data based on the real return data, and analyzing the real return data into a corresponding data structure through a data model; and returning the snapshot data and/or the data structure to the client as simulation return data. According to the technical scheme of the invention, the simulated return data is automatically generated based on the real return data, so that manual setting is not needed, the difficulty of simulating the return data is reduced, and the reliability of the simulated return data is improved.

Description

Method and system for simulating returned data and computing equipment
Technical Field
The invention relates to the technical field of software development, in particular to a return data simulation method, a return data simulation system and computing equipment.
Background
In the software development process, there are some scenarios that require service simulation, for example, including: the front-end developer logically compiles data returned by the dependence back-end interface, so that the front-end development work cannot be synchronously carried out with the back-end development work before the back-end interface is delivered; the test environment has a large number of conditions that systems depend on each other and influence each other, and the focus of each test is only on a certain service, and the tested service is often influenced by the states of other services during the test and cannot be dedicated to the individual test of a certain system or module; when testing complex logic, the problems of difficult construction of test data and high cost are caused due to the complex logic or complex system structure.
At present, the Mock service can be used for replacing a real back-end service to return data to the front end, so that the development can be carried out under the condition that the back-end service is not delivered, and the dependence on the development progress of the back end is avoided. In the prior art, the setting of the Mock service return result mainly comprises the following modes: mock return data are simulated and returned by using a manually set static json string; mock return data are simulated and returned by using a manually set static json string; mock return data simulated return was performed using manually set data object model generation data. The above scheme has the following drawbacks: the setting step is complicated, and related interface documents need to be consulted to obtain related return formats; the returned data structure is not based on the fact, the accuracy of the configuration is based on the correctness of the interface document, and if the document is wrong, the configuration is also wrong; the maintenance cost is high, the change of the interface return format cannot be sensed by the Mock system, and if the change cannot be updated in time, the change can cause the spurious results of the test results.
For this reason, a return data simulation method is needed to solve the problems in the above technical solutions.
Disclosure of Invention
To this end, the present invention provides a return data simulation method, a return data simulation system and a computing device to solve or at least alleviate the above-existing problems.
According to one aspect of the present invention, a method for simulating return data is provided, which is executed in a simulation server for simulating return data by a service interface, wherein the simulation server is respectively connected with a client and a real server in communication, the real server comprises the service interface, and the method comprises the following steps: receiving a calling request of the client to the service interface based on a module to be tested, and acquiring request data from the calling request; simulating and calling the service interface based on the request data to acquire real return data returned by the service interface; generating snapshot data based on the real return data, and analyzing the real return data into a corresponding data structure through a data model; and returning the snapshot data and/or the data structure to the client as simulation return data.
Optionally, in the method for simulating returned data according to the present invention, the simulating and calling the service interface based on the request data includes: establishing a timing task; and by executing the timing task, the service interface is regularly simulated and called based on the request data so as to regularly acquire the latest real return data returned by the service interface, the latest snapshot data and the latest data structure are generated based on the latest real return data, and the latest snapshot data and/or the latest data structure are/is returned to the client as the latest simulated return data.
Optionally, in the method for simulating returned data according to the present invention, returning the snapshot data and/or the data structure to the client as simulated returned data includes: and according to the configuration information of the client on the return data, taking the snapshot data and/or the data structure as simulated return data, and returning the simulated return data to the client.
Optionally, in the method for simulating return data according to the present invention, the method further includes: and receiving the configuration information of the client to the return data.
Optionally, in the returned data simulation method according to the present invention, the client includes a module to be tested, and before receiving a call request of the client to the service interface based on the module to be tested, the method includes: and providing proxy service for the module to be tested.
Optionally, in the return data simulation method according to the present invention, the client is adapted to: and responding to the trigger operation of the module to be tested, and sending a calling request to the service interface based on the request data.
Optionally, in the returned data simulation method according to the present invention, before receiving a call request of the client to the service interface based on the module to be tested, the method further includes: and starting a return data recording mode so as to record real return data returned by the service interface, snapshot data generated based on the real return data and a data structure.
According to an aspect of the present invention, there is provided a return data simulation system including: the client comprises a module to be tested; a real server comprising a service interface; and the simulation server is respectively in communication connection with the client and the real server and is suitable for executing the method to simulate the service interface to return data.
According to an aspect of the invention, there is provided a computing device comprising: at least one processor; a memory storing program instructions configured to be executed by the at least one processor, the program instructions comprising instructions for performing the return data simulation method as described above.
According to an aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform a return data simulation method as described above.
According to the technical scheme of the invention, the return data simulation method is provided, a simulation server is established between the client and the real server, and the back-end service interface is simulated to return data through the simulation server. Specifically, the simulation server receives a call request of the client to the service interface based on the module to be tested, acquires request data from the call request, and simulates the call service interface based on the request data to acquire real return data returned by the service interface. Then, snapshot data is generated based on the real return data, and the real return data is parsed into corresponding data structures through a data model. And finally, returning the snapshot data and/or the data structure to the client as simulation return data. Therefore, according to the method, the real return data are obtained by calling the service interface of the real server, and the simulated return data are automatically generated based on the real return data, so that manual setting is not needed, the difficulty of simulating the return data is reduced, and the reliability of the simulated return data is improved.
Further, by creating and executing a timing task, the service interface can be regularly and artificially called based on the request data, and the latest real return data returned by the service interface can be regularly acquired. Therefore, real-time automatic updating of the simulated return data can be realized, and the real-time performance and the accuracy of the simulated return data are improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a schematic diagram of a return data simulation system 100 according to one embodiment of the invention;
FIG. 2 shows a schematic diagram of a computing device 200, according to one embodiment of the invention;
FIG. 3 shows a flow diagram of a return data simulation method 300 according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 shows a schematic diagram of a return data simulation system 100 according to one embodiment of the invention.
As shown in fig. 1, the return data simulation system 100 includes a client 110, a simulation server 120, and a real server 130. The simulation server 120 is communicatively connected to the client 110 and the real server 130, respectively, and may be connected to the network in a wired or wireless manner, for example.
The client 110 may be a terminal device used by a user, and may specifically be a personal computer such as a desktop computer and a notebook computer, or may also be a mobile phone, a tablet computer, a multimedia device, an intelligent wearable device, and the like, but is not limited thereto. The client 110 may also be an application program resident in the terminal device.
The simulation server 120 is used to provide an interface return data simulation service for the client, and may be implemented as any computing device capable of providing a return data simulation service for the client in the prior art, and the invention is not limited to the specific kind of server. For example, the simulation server 120 may be implemented as a desktop computer, a notebook computer, a processor chip, a mobile phone, a tablet computer, etc., but is not limited thereto. The server may also be a service program resident in the computing device.
In one implementation, the simulation server 120 may be implemented as a Mock service.
The real server 130 may be implemented as any one of servers for providing services to clients in the prior art, and the invention is not limited to the specific type of service provided by the real server 130.
The simulation server 120 may receive a call request for the service interface of the real server, which is sent by the client based on the module to be tested, and obtain request data when the service interface is called from the call request. Subsequently, the simulation server 120 simulates and calls the service interface of the simulation server 130 based on the request data to obtain the real return data returned by the service interface. Further, the simulation server 120 may generate snapshot data based on the real return data and parse the real return data into corresponding data structures through the data model. Here, the snapshot data, the data structure generated based on the real return data may be used as the simulation return data. Finally, simulation server 120 can treat the snapshot data and/or data structures as simulation return data and return the simulation return data to client 110.
The simulation return data is: the simulation server 120 is used for simulating data returned to the client by the service interface of the real server 130. And the data returned by the service interface of the real server 130 is real return data.
Thus, according to the return data simulation system 100 of the present invention, the real service interface can be called by the simulation server 120, the real return data can be obtained, the simulation return data can be automatically generated based on the real return data, and the simulation return data can be returned to the client, so as to test the module to be tested based on the simulation return data.
In an embodiment of the present invention, the simulation server 120 is adapted to perform the return data simulation method 300. The return data simulation method 300 of the present invention will be described in detail below.
In one embodiment, the simulation server 120 and the real server 130 of the present invention may each be implemented as a computing device, such that the return data simulation method 300 of the present invention may be executed in the computing device.
FIG. 2 shows a block diagram of a computing device 200, according to one embodiment of the invention. As shown in FIG. 2, in a basic configuration 202, computing device 200 typically includes system memory 206 and one or more processors 204. A memory bus 208 may be used for communication between the processor 204 and the system memory 206.
Depending on the desired configuration, the processor 204 may be any type of processing, including but not limited to: a microprocessor (μ P), a microcontroller (μ C), a digital information processor (DSP), or any combination thereof. The processor 204 may include one or more levels of cache, such as a level one cache 210 and a level two cache 212, a processor core 214, and registers 216. Example processor cores 214 may include Arithmetic Logic Units (ALUs), floating Point Units (FPUs), digital signal processing cores (DSP cores), or any combination thereof. The example memory controller 218 may be used with the processor 204, or in some implementations the memory controller 218 may be an internal part of the processor 204.
Depending on the desired configuration, system memory 206 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 106 may include an operating system 220, one or more applications 222, and program data 224. The application 222 is actually a plurality of program instructions that direct the processor 204 to perform corresponding operations. In some implementations, the application 222 can be arranged to cause the processor 204 to operate with the program data 224 on an operating system.
Computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to the basic configuration 202 via the bus/interface controller 230. The example output device 242 includes a graphics processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 252. Example peripheral interfaces 244 can include a serial interface controller 254 and a parallel interface controller 256, which can be configured to facilitate communications with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 258. An example communication device 246 may include a network controller 260, which may be arranged to facilitate communications with one or more other computing devices 262 over a network communication link via one or more communication ports 264.
A network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media, such as carrier waves or other transport mechanisms, in a modulated data signal. A "modulated data signal" may be a signal that has one or more of its data set or its changes made in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or private-wired network, and various wireless media such as acoustic, radio Frequency (RF), microwave, infrared (IR), or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
In a computing device 200 according to the present invention, the application 222 of the computing device 200 includes therein a plurality of program instructions that execute the return data simulation method 300, which may instruct the processor 204 to perform the return data simulation method 300 of the present invention such that the computing device 200 simulates service interface return data by executing the return data simulation method 300 of the present invention.
FIG. 3 shows a flow diagram of a return data simulation method 300 according to one embodiment of the invention. The method 300 is suitable for execution in a simulation server 120, such as the aforementioned computing device 200.
According to the embodiment of the invention, the simulation server 120 is respectively connected with the client 110 and the real server 130 in a communication way. The real server 130 is provided with a service interface. Client 110 includes a module under test (i.e., a module under test).
In one implementation, the simulation server 120 may be implemented as a Mock service.
As shown in FIG. 3, method 300 includes steps S310-S40.
In step S310, the receiving client 110 obtains request data for calling the service interface from the call request based on the call request for the service interface of the real server 130 sent by the module to be tested.
Specifically, the client 110 may send a call request for a service interface based on the request data in response to a trigger operation of a user (tester) on the module under test.
Here, the client 110 includes a page and can display the page (front page), and the user can operate on the page to trigger the module to be tested to call the service interface. For example, in an implementation manner, the module to be tested may be an interface of a payment page, and when a user performs a payment operation to trigger the interface of the payment page, the service interface of the server needs to be called to obtain a payment result returned by the service interface, and a corresponding payment result page is displayed at the client according to the payment result. If the payment result is successful, displaying a successful payment page at the client; and if the payment result is payment failure, displaying a payment failure page at the client.
Subsequently, in step S320, the simulation server simulates and calls the service interface of the simulation server based on the request data to obtain the real return data returned by the service interface.
Subsequently, in step S330, snapshot data is generated based on the real return data, and the real return data is parsed into a corresponding data structure by the data model. Here, the snapshot data, the data structure generated based on the real return data may be used as the simulation return data.
The simulation return data is: the simulation server 120 is used for simulating data returned to the client by the service interface of the real server 130. And the data returned by the service interface of the real server 130 is real return data.
Finally, in step S340, the snapshot data and/or the data structure is returned to the client 110 as the simulation return data.
Thus, according to the method of the present invention, real return data is obtained based on real interface calls (called real service interfaces), and simulated return data is automatically generated based on the real return data, so as to test the module to be tested based on the simulated return data.
According to an embodiment of the present invention, in step S320, a timing task may be created, and the timing task is executed to implement timing based on the request data to simulate invoking the service interface, so that the latest real return data returned by the service interface may be obtained at regular time. With the latest real return data obtained at regular time, the simulation server 120 may generate the latest snapshot data and the latest data structure based on the latest real return data, and specifically, parse the latest real return data into the latest data structure according to the data model. The simulation server 120 can then treat the snapshot data and/or data structure as the most recent simulation return data and return the most recent simulation return data to the client. Therefore, real-time automatic updating of the simulated return data is realized, and the real-time performance and the accuracy of the simulated return data are improved.
In addition, in other embodiments, the return data can be automatically updated in a Webhook manner. Specifically, after the return data is updated, the service interface of the real server 130 may automatically send the latest real return data to the simulation server, that is, the real server 130 actively pushes the updated latest real return data to the simulation server.
According to an embodiment of the present invention, in step S340, the snapshot data and/or the data structure may be used as the simulation return data specifically according to the configuration information of the client on the return data, and the simulation return data is returned to the client.
Specifically, the simulation server 120 may receive the configuration information of the client for the return data before performing step S340. Here, the client includes a configuration platform where the user can edit and select the returned data to generate configuration information for the returned data, and submit the configuration information to the simulation server 120. In this way, in step S340, the simulation server 120 may determine the format of the returned data required by the module to be tested according to the configuration information of the client on the returned data, and further determine whether the simulation returned data that needs to be returned to the client is snapshot data or a data structure generated based on the data model (taking the snapshot data or the data structure as the simulation returned data) according to the format of the returned data. That is, the snapshot data and/or the data structure is returned to the client as simulated return data based on the configuration information of the client for the return data.
According to an embodiment of the present invention, before performing step S310, the module under test is first proxied to the simulation server 120, so that the simulation server 120 provides proxy service for the module under test, and the service interface is called by proxying the client through the simulation server 120. In this way, the simulation server 120 may execute step S310, intercept a request data when the client terminal calls the service interface from a call request sent by the module to be tested to the service interface of the real server 130. Further, step S320 is executed to simulate and call the service interface of the real server 130 based on the request data, and obtain real return data returned by the service interface.
According to an embodiment of the present invention, after the module under test is proxied to the simulation server 120, before step S310 is executed, the return data recording mode may be started, so as to record the real return data returned by the service interface, the snapshot data generated based on the real return data, and the data structure generated based on the real return data and the data model, and record the real return data returned by the service interface, the snapshot data generated based on the real return data, and the data structure generated based on the real return data and the data model for use in testing the module under test.
According to the method 300 for simulating the returned data, the simulation server is established between the client and the real server, and the back-end service interface returned data is simulated through the simulation server. Specifically, the simulation server receives a call request of the client to the service interface based on the module to be tested, acquires request data from the call request, and simulates the call service interface based on the request data to acquire real return data returned by the service interface. Then, snapshot data is generated based on the real return data, and the real return data is parsed into corresponding data structures through a data model. And finally, returning the snapshot data and/or the data structure to the client as simulation return data. Therefore, according to the method, the real return data are obtained by calling the service interface of the real server, and the simulated return data are automatically generated based on the real return data, so that manual setting is not needed, the difficulty of simulating the return data is reduced, and the reliability of the simulated return data is improved.
Further, by creating and executing a timing task, the service interface can be regularly and artificially called based on the request data, and the latest real return data returned by the service interface can be regularly acquired. Therefore, real-time automatic updating of the simulated return data can be realized, and the real-time performance and the accuracy of the simulated return data are improved.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the mobile terminal generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the return data simulation method of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system is apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Moreover, those skilled in the art will appreciate that although some embodiments described herein include some features included in other embodiments, not others, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as disclosed herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed in an illustrative rather than a restrictive sense with respect to the scope of the invention, as defined in the appended claims.

Claims (10)

1. A return data simulation method executed in a simulation server for simulating a service interface to return data, the simulation server being communicatively connected to a client and a real server respectively, the real server including the service interface, the method comprising:
receiving a calling request of the client to the service interface based on a module to be tested, and acquiring request data from the calling request;
simulating and calling the service interface based on the request data to acquire real return data returned by the service interface;
generating snapshot data based on the real return data, and analyzing the real return data into a corresponding data structure through a data model;
and returning the snapshot data and/or the data structure to the client as simulation return data.
2. The method of claim 1, wherein simulating invocation of the service interface based on the request data comprises:
creating a timing task;
and by executing the timing task, the service interface is regularly simulated and called based on the request data so as to regularly acquire the latest real return data returned by the service interface, the latest snapshot data and the latest data structure are generated based on the latest real return data, and the latest snapshot data and/or the latest data structure are/is returned to the client as the latest simulated return data.
3. The method of claim 1 or 2, wherein returning the snapshot data and/or the data structure to the client as simulated return data comprises:
and according to the configuration information of the client on the returned data, taking the snapshot data and/or the data structure as simulated returned data, and returning the simulated returned data to the client.
4. The method of any one of claims 1-3, wherein the method further comprises:
and receiving the configuration information of the client to the return data.
5. The method of any one of claims 1-4, wherein the client includes a module under test, and prior to receiving a request for invocation of the service interface by the client based on the module under test, comprises:
and providing proxy service for the module to be tested.
6. The method of any one of claims 1-5, wherein the client is adapted to:
and responding to the trigger operation of the module to be tested, and sending a calling request to the service interface based on the request data.
7. The method of any one of claims 1-6, wherein prior to receiving the request by the client to invoke the service interface based on the module under test, further comprising:
and starting a return data recording mode so as to record real return data returned by the service interface, snapshot data generated based on the real return data and a data structure.
8. A return data simulation system, comprising:
the client comprises a module to be tested;
a real server comprising a service interface;
a simulation server, communicatively connected to the client and the real server, respectively, adapted to perform the method of any one of claims 1-7 to simulate a service interface return data.
9. A computing device, comprising:
at least one processor; and
a memory storing program instructions configured to be suitable for processing by the at least one processor, the program instructions comprising instructions for processing the method according to any one of claims 1-7.
10. A readable storage medium storing program instructions that, when read and processed by a computing device, cause the computing device to process the method of any of claims 1-7.
CN202211177323.9A 2022-09-26 2022-09-26 Method and system for simulating returned data and computing equipment Pending CN115576711A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211177323.9A CN115576711A (en) 2022-09-26 2022-09-26 Method and system for simulating returned data and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211177323.9A CN115576711A (en) 2022-09-26 2022-09-26 Method and system for simulating returned data and computing equipment

Publications (1)

Publication Number Publication Date
CN115576711A true CN115576711A (en) 2023-01-06

Family

ID=84582692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211177323.9A Pending CN115576711A (en) 2022-09-26 2022-09-26 Method and system for simulating returned data and computing equipment

Country Status (1)

Country Link
CN (1) CN115576711A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116643902A (en) * 2023-07-27 2023-08-25 太平金融科技服务(上海)有限公司 Interface data simulation method, device, apparatus, storage medium, and program product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116643902A (en) * 2023-07-27 2023-08-25 太平金融科技服务(上海)有限公司 Interface data simulation method, device, apparatus, storage medium, and program product
CN116643902B (en) * 2023-07-27 2023-10-20 太平金融科技服务(上海)有限公司 Interface data simulation method, device, apparatus, storage medium, and program product

Similar Documents

Publication Publication Date Title
CN109325195B (en) Rendering method and system for browser, computer device and computer storage medium
CN110377462B (en) Interface testing method and device and terminal equipment
CN111597110B (en) Page test method and device, electronic equipment and storage medium
CN108111364B (en) Service system testing method and device
CN110196809B (en) Interface testing method and device
CN110531962A (en) Development process method, equipment and the computer readable storage medium of small routine
CN114691240A (en) Drive hardware configuration information loading method, device and system and computing equipment
CN113886162A (en) Computing equipment performance test method, computing equipment and storage medium
CN110795343A (en) Test system, test method and computing device
JP2023086678A (en) Method and apparatus for generating and applying deep learning model based on deep learning framework
CN113485927A (en) Test data generation method, device, equipment and storage medium
CN112363938A (en) Data processing method and device, electronic equipment and storage medium
CN115576711A (en) Method and system for simulating returned data and computing equipment
CN114189553A (en) Flow playback method, system and computing equipment
CN112988588A (en) Client software debugging method and device, storage medium and electronic equipment
CN111949510B (en) Test processing method, device, electronic equipment and readable storage medium
CN112256564B (en) Application program running method and device and electronic equipment
CN113821438A (en) Application response performance test method and system and computing equipment
CN114116244A (en) Data processing method, device and system, electronic equipment and storage medium
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN112181802A (en) Test method and device
CN114328273B (en) Debugging method and device for application program control and computing equipment
CN115145696B (en) Method, system and computing device for determining running difference of process virtual machine
CN112699017B (en) Sound testing method, device, electronic equipment and computer readable storage medium
CN117827636A (en) Method, system, medium and equipment for forwarding and simulating data processing based on Mock Server

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