Virtual simulation method, device, computer equipment and program product
Through the virtual simulation method, the initialization linked list and persistence mirroring technology are used to obtain and restore the response information of the interface call request, solving the problems of insufficient hardware resources and limited debugging time, and real restoration of on-machine test details is achieved.
Patent Information
- Application Number
- CN202411273340.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2044-09-12
AI Technical Summary
In large-scale software and hardware testing system projects, hardware resources are insufficient, software debugging time is limited, and customized hardware virtual data scenarios are single, so it is impossible to truly restore the on-machine testing details.
A virtual simulation method is provided, by obtaining client interface call request and request identification information, querying the initialized linked list to obtain the response information address, and obtaining the real simulation data of the persistent mirror based on this address, real restoration of interface operation data and running time details.
It realizes that the interface running data and run time details in on-machine testing can be restored without relying on the hardware environment, and improves debugging efficiency and simulation effect.
Smart Images

Figure CN118797964B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of simulation technology, and particularly to a virtual simulation method, apparatus, computer device, and computer program product. Background Art
[0002] During the joint debugging process of large-scale software and hardware test system projects, hardware resources are often insufficient due to high costs. Software debugging is often allocated less time and cannot be fully tested. On the other hand, the scenarios simulated by custom-developed hardware virtual data are often very single.
[0003] In traditional technologies, to perform debugging without a hardware environment, one often has to use methods such as fabricating hardware data in the program or writing configuration files. However, this method can only debug a single scenario and requires modifying the code logic to rewrite the hardware access interface, and cannot truly and completely restore the details in the on-machine test. Summary of the Invention
[0004] Based on this, to address the above technical problems, it is necessary to provide a virtual simulation method, apparatus, computer device, and computer program product that can truly and completely restore the details in the on-machine test.
[0005] In a first aspect, this application provides a virtual simulation method, which includes:
[0006] Obtain an interface call request initiated by a client and the request identification information of the interface call request;
[0007] Query an initialization linked list to obtain the response information address corresponding to the request identification information. Each node in the initialization linked list is used to store first call information and a response information address obtained based on persistent mirroring of simulation data. The first call information includes the request identification information;
[0008] Obtain response information based on the response information address, where the response information is obtained by performing persistent mirroring on the original call result information of the interface.
[0009] In one embodiment, the method further includes:
[0010] Record the start time of the interface call request;
[0011] Query the request response time corresponding to the request identification information;
[0012] Perform a delay operation based on the request response time and the start time;
[0013] After the delay operation ends, return the response information.
[0014] In one embodiment, the delaying operation based on the request response time and the start time includes:
[0015] Calculating a delay time based on the request response time and the loading time of the response information;
[0016] When the delay time is greater than a preset time length, performing a delaying operation based on the start time and the delay time;
[0017] When the delay time is less than or equal to the preset time length, continue to execute the step of returning the response information.
[0018] In one embodiment, before querying the initialization linked list to obtain the response information address corresponding to the request identification information, it further includes:
[0019] Receiving an initialization request, where the initialization request carries a file identifier;
[0020] Creating the initialization linked list in the cache based on the initialization request;
[0021] Querying each file corresponding to the file identifier;
[0022] Determining first call information, the response information address corresponding to each first call information, and the next node address corresponding to each first call information based on each file, and storing the first call information, the response information address and the next node address corresponding to each first call information into the corresponding nodes of the initialization linked list.
[0023] In one embodiment, the determining first call information, the response information address corresponding to each first call information, and the next node address corresponding to each first call information based on each file, and storing the first call information, the response information address and the next node address corresponding to each first call information into the corresponding nodes of the initialization linked list includes:
[0024] Determining the current file, reading the first call information of the current node in the current file, and storing the first call information into the corresponding node of the initialization linked list;
[0025] Based on the start address and the size of the first call information, determining the response information address of the current node in the current file, and storing the response information address into the corresponding node of the initialization linked list;
[0026] When it is determined that there are unread nodes in the current file based on the response information address, determine the next node address based on the start address of the first call information, the size of the first call information, and the size of the response information;
[0027] Obtain the next node from the current file as the current node based on the next node address, and continue to execute the step of reading the first call information of the current node in the current file;
[0028] When it is determined that there are no unread nodes in the current file based on the response information address and the file corresponding to the file identifier is not fully loaded, obtain the next file as the current file based on the file identifier, and continue to execute the step of reading the first call information of the current node in the current file until all the files corresponding to the file identifier are fully loaded.
[0029] In one embodiment, the method further includes:
[0030] When the mirror data collection thread receives an interface call request from a new client, query whether the initial identification information corresponding to the interface call request of the client has been cached;
[0031] When the initial identification information corresponding to the interface call request has been cached, update the execution sequence number of the interface call request;
[0032] Generate request identification information based on the initial identification information and the execution sequence number;
[0033] Generate second call information based on the request identification information, and store the second call information and the original call result information corresponding to the interface call request as simulation data in the cache.
[0034] In one embodiment, the cache includes a target linked list, and each node in the target linked list is used to store second call information, original call result information, and the next node address, and the next node address is obtained based on the size of the second call information and the size of the original call result information.
[0035] In one embodiment, the method further includes:
[0036] When the initial identification information corresponding to the interface call request has not been cached, add the initial identification information corresponding to the interface call request to the cache, update the execution sequence number of the interface call request, and then continue to execute the step of generating request identification information based on the initial identification information and the execution sequence number.
[0037] In one embodiment, after associatively storing the second call information and the original call result information corresponding to the interface call request in the cache, the method further includes:
[0038] When the mirror data collection thread receives an instruction indicating the end of mirror data storage, generate a new file based on the second call information in the cache and the original call result information corresponding to the interface call request, and store the new file in a persistent medium;
[0039] Empty the cache and terminate the mirror data collection thread.
[0040] In one embodiment, after storing the second call information and the original call result information corresponding to the interface call request as simulation data in the cache, the method further includes:
[0041] Update the size of the simulation data stored in the cache based on the size of the second call information and the size of the original call result information;
[0042] When an instruction indicating the end of mirror data storage is not received, detect whether the size of the simulation data stored in the cache is greater than or equal to a threshold;
[0043] When the size of the simulation data stored in the cache is greater than or equal to the threshold, generate a new file based on the simulation data in the cache and store the new file in a persistent medium;
[0044] Empty the cache and continue to wait for the next instruction indicating the end of mirror data storage through the mirror data collection thread.
[0045] In one embodiment, the method further includes:
[0046] When the mirror data collection thread receives an instruction indicating the start of an interface call request, record the current request time of the interface call request;
[0047] When the mirror data collection thread receives an instruction indicating the end of an interface call request, obtain the reception time of the instruction indicating the end of the interface call request, and obtain the request response time of the interface call request based on the reception time and the current request time;
[0048] Add the request response time to the second call information.
[0049] In one embodiment, the method further includes:
[0050] Determine the simulation state in the form of a configuration file or a configuration function;
[0051] In the case where the simulation state is the simulation mode, continue to execute the step of obtaining the interface call request initiated by the client and the request identification information of the interface call request;
[0052] In the case where the simulation state is the mirror data collection mode, continue to execute the step of querying whether the initial identification information corresponding to the interface call request of the client has been cached when a new interface call request of the client is received by the mirror data collection thread.
[0053] In a second aspect, the present application further provides a virtual simulation device, and the device includes:
[0054] A call request acquisition module, configured to obtain an interface call request initiated by a client and the request identification information of the interface call request;
[0055] A response information address acquisition module, configured to query an initialization linked list to obtain a response information address corresponding to the request identification information, where each node in the initialization linked list is used to store first call information and a response information address obtained based on simulation data of a persistent mirror, and the first call information includes request identification information;
[0056] A response information acquisition module, configured to obtain response information based on the response information address, where the response information is obtained by performing persistent mirroring on the original call result information of the interface.
[0057] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.
[0058] In a fourth aspect, the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0059] For the above virtual simulation method, device, computer device, and computer program product, the interface call request initiated by the client and the request identification information of the interface call request are obtained, so that the response information address corresponding to the request identification information can be queried from the initialization linked list. Each node in the initialization linked list is used to store the first call information and the response information address obtained based on the simulation data of the persistent mirror, and the first call information includes the request identification information. In this way, the real simulation data of the persistent mirror can be obtained based on the response address, so that the details of the interface operation data in the on-machine test can be truly and completely restored. Description of the Drawings
[0060] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the accompanying drawings required for the description of the embodiments of the present application or related technologies. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related accompanying drawings can also be obtained based on these drawings.
[0061] Figure 1 It is an application environment diagram of the virtual simulation method in an embodiment;
[0062] Figure 2 It is a schematic flowchart of the virtual simulation method in an embodiment;
[0063] Figure 3 It is a flowchart of the simulation steps in an embodiment;
[0064] Figure 4 It is a schematic diagram of initializing a linked list in an embodiment;
[0065] Figure 5 It is a flowchart of the preloading step in an example;
[0066] Figure 6 It is a flowchart of the processing steps of the client during the mirror data collection in an embodiment;
[0067] Figure 7 It is a flowchart of the mirror data collection step in an embodiment;
[0068] Figure 8 It is a schematic diagram of the target linked list in an embodiment;
[0069] Figure 9 It is a flowchart of the operation mode switching step in an embodiment;
[0070] Figure 10 It is a structural block diagram of the virtual simulation device in an embodiment;
[0071] Figure 11 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0072] In order to make the purpose, technical solutions and advantages of the present application more clear, the following further details the present application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0073] The virtual simulation method provided by the embodiments of the present application can be applied to, for example Figure 1In the application environment shown. In large-scale test system supporting software, in order to avoid excessive load when a single instance runs the test program, a distributed architecture is usually used to split different components independently according to their responsibilities, thereby improving the operating efficiency of the software system. The interaction between different components usually uses remote procedure call technology, which usually encapsulates the original call through client stubs and server stubs. After the client program initiates a remote procedure call, it calls the client stub function, packages the target call data, transmits it to the server, and calls the server stub to unpack the data and call the service. After the service call is completed, the return value will be packaged and sent back to the client, and the client will unpack the data and return it to the user through the stub function.
[0074] Among them, in this application, the client pile function and the server stub are modified, and the data mirror function is pre-buried to store the operation data in the actual operation process as simulation data. Later, when simulation is needed, the client initiates the interface call request and the request identification information of the interface call request; the initialization linked list is queried to obtain the response information address corresponding to the request identification information, and each node in the initialization linked list is used to store the first call information and response information address obtained based on the simulation data of the persistent mirror, and the first call information includes the request identification information; based on the response information address, the response information is obtained by persistently mirroring the original call result information of the interface. In this way, the real simulation data of the persistent mirror can be obtained based on the response address, so that the details of the received operation data and the running time in the machine test can be truly and completely restored.
[0075] In an exemplary embodiment, Figure 2 As shown, a virtual simulation method is provided, which is applied to Figure 1 The client in the example is used to illustrate, including the following steps 202 to 206. Among them:
[0076] S202: Acquire the interface call request initiated by the client and the request identification information of the interface call request.
[0077] The interface call request is initiated by the client. After the client program initiates the remote procedure call, it is called to the client stub function. The data mirror function embedded in the client stub function forwards the interface call request to the mirror data collection thread. If the mirror data collection thread is not started, the mirror data collection thread is first requested to be started. After it is started, the mirror data collection thread can intercept the interface call request initiated by the client.
[0078] The request identification information of the interface call request can uniquely determine this interface call request. The request identification information includes the request thread identification, the request name, and the execution sequence number. Among them, the request thread identification is the thread identification of the request thread, the request name can be the service name, and the execution sequence number is the sequence number of the request.
[0079] S204: Query the initialization linked list to obtain the response information address corresponding to the request identification information. Each node in the initialization linked list is used to store the first call information and the response information address obtained from the simulation data based on the persistent image. The first call information includes the request identification information.
[0080] Each node in the initialization linked list is used to store the first call information and the response information address obtained from the simulation data based on the persistent image. The initialization linked list is obtained from the simulation data stored based on the persistent image. Among them, before the simulation, according to the type of simulation, the simulation data stored in the pre-loaded persistent image can be initialized into the linked list in the cache. It should be noted that during pre-loading, not all response information is pre-loaded into the cache, but only the response information address of the response information is pre-loaded, which can avoid occupying too much memory.
[0081] Among them, before the simulation, the initialization linked list is obtained by pre-loading based on the simulation data stored in the persistent image. The first call information in the initialization linked list corresponds to the second call information in the simulation data. The first call information and the second call information include the request identification information. The response information address in the initialization linked list is obtained based on the storage address of the original call result information in the simulation data. The initialization linked list can also include the next node address, which corresponds to the next node address in the simulation data.
[0082] In this way, after obtaining the request identification information, the request identification information can be compared with the request identification information included in the first call information in the initialization linked list, and the response information address corresponding to the first call information with successful comparison can be obtained.
[0083] S206: Obtain the response information based on the response information address, where the response information is obtained by performing a persistent image on the original call result information of the interface.
[0084] After obtaining the response information address, the corresponding original call result information is obtained from the simulation data of the persistent image as the response information based on the response information address. Subsequently, the client stub function performs deserialization processing on the response information, etc., to complete the simulation. In addition, the corresponding system parameters, simulation parameters, etc. can be collected during the entire simulation process as the simulation result, which can truly and completely restore the data details in the on-machine test and improve the simulation effect.
[0085] The above virtual simulation method obtains an interface call request initiated by a client and the request identification information of the interface call request, so that the response information address corresponding to the request identification information can be queried from the initialization linked list. Each node in the initialization linked list is used to store the first call information obtained from the simulation data of the persistent image and the response information address. The first call information includes the request identification information. Based on this response address, the real simulation data of the persistent image can be obtained, so that the details of the interface operation data in the on-machine test can be truly and completely restored.
[0086] In one optional embodiment, the method further includes: recording the start time of the interface call request; querying the request response time corresponding to the request identification information; performing a delay operation based on the request response time and the start time; and returning the response information after the delay operation ends.
[0087] In this embodiment, after the mirror data acquisition thread obtains the interface call request, it also records the start time of the interface call request, then queries the first call information in the initialization linked list to obtain the request response time corresponding to the request identification information, as well as the response information address mentioned above, and obtains the response information from the simulation data stored in the persistent image based on the response information address. And perform a delay operation based on the request response time and the start time, and return the response information after the delay operation ends to simulate the request response time in the actual call process.
[0088] Since the response information in this application is obtained from the simulation data stored in the persistent image based on the response information address, the acquisition of the response data also takes a certain amount of time. In the actual process, the processing of the interface call request also takes a certain amount of time, that is, the request response time. Therefore, it is possible to determine whether further delay is required based on the acquisition time of the response data and the request response time.
[0089] In one optional embodiment, performing a delay operation based on the request response time and the start time includes: calculating a delay time based on the request response time and the loading time of the response information; performing a delay operation based on the start time and the delay time when the delay time is greater than a preset time length; and continuing to execute the step of returning the response information when the delay time is less than or equal to the preset time length.
[0090] Specifically, the loading time of the response information is the time to obtain the response information from the simulation data stored in the persistent image. When the loading time of the response information is greater than the request response time, there is no need to perform a delay. Otherwise, the delay time is obtained based on the difference between the request response time and the loading time of the response information, and a delay operation is performed based on this delay time.
[0091] In actual applications, the difference between the request response time and the response information loading time is directly used as the delay time. If the delay time is greater than 0, the delay is based on the delay time. Otherwise, the response information is directly returned without delay.
[0092] In the above embodiment, by storing the request response time, the details of the running time in the on-machine test can be truly and completely restored.
[0093] Among them, for the convenience of understanding, combined Figure 3 As shown, Figure 3 The flow chart of the simulation step in one embodiment, in this embodiment, the client first initiates an interface call request, and calls the client pile function, records the request start time, and then the client pile function serializes the client request parameters, and the mirror simulation function starts, and the corresponding response information address is found from the preloaded initialization linked list according to the request identification information, and the response information is obtained from the simulation data stored in the hardware (persistent mirror) based on the response information address, and the delay time is calculated, wherein the delay time is the difference obtained by subtracting the loading time of the response information from the request response time, if the delay time is greater than 0, then the delay operation is performed based on the delay time, otherwise the response information is directly deserialized by the client pile function to complete the whole simulation process. Wherein, the simulation data stored in the hardware is the simulation data of the persistent mirror.
[0094] In one of the optional embodiments, before querying the initialization linked list to obtain the response information address corresponding to the request identification information, it also includes: receiving an initialization request, the initialization request carrying a file identification; creating an initialization linked list in the cache based on the initialization request; querying each file corresponding to the file identification; determining each first call information, the response information address corresponding to each first call information, and the next node address corresponding to each first call information based on each file, and storing each first call information, the response information address and the next node address corresponding to each first call information respectively in the corresponding node of the initialization linked list.
[0095] Among them, this embodiment is a process of preloading simulation data before the simulation starts. Specifically, in the simulation mode, it is possible to confirm whether the required simulation data has been collected and add the simulation data storage path by means of a configuration file or a configuration function. For the configuration file method, the user is required to modify the running mode in the configuration file, and confirm whether the required simulation data has been collected, and add the simulation data storage path in the configuration file; for the configuration function method, the user confirms whether the required simulation data has been collected and adds the simulation data storage path by modifying the configuration function; after the modification is completed and saved, a pop-up window will appear to remind the user that the software will enter the mirror simulation mode, and the user is required to click to confirm; after the user clicks to confirm, the client's pre-embedded data mirror simulation mode will be enabled, and the simulation data storage path will be obtained from the configuration file or based on the configuration function. At this time, the solidified simulation data information will be preloaded. In order to avoid the simulation data occupying the running memory, only the request identification information (RequestInfo) of each packet of data and the corresponding response information address are preloaded into the initialization linked list (DataList) through file mapping.
[0096] Among them, combined Figure 4 As shown, Figure 4 is a schematic diagram of an initialization linked list in an embodiment, each node of the initialization linked list includes first call information (such as Figure 4 Header, Header1, Header2...HeaderN in the first call information), the response information address corresponding to each first call information (such as Figure 4 DataPtr, DataPtr1, DataPtr2...DataPtrN) and the next node address corresponding to each first call information (such as Figure 4 NextPtr in the first call information), the first call information includes request identification information and other call information, wherein the limitation of the request identification information can be found above, other call information includes the size of the response information of the current request and the request response time, the response information address corresponding to each first call information is obtained based on the simulation data of the persistent image, and the next node data address is the starting address of the next node data.
[0097] In one of the optional embodiments, first call information, a response information address corresponding to each first call information, and a next node address corresponding to each first call information are determined based on each file, and the first call information, the response information address corresponding to each first call information, and the next node address are stored in the corresponding node of the initialization linked list, including: determining the current file, reading the first call information of the current node in the current file, and storing the first call information in the node corresponding to the initialization linked list; determining the response information address of the current node in the current file based on the first address of the first call information and the size of the first call information, and storing the response information address in the node corresponding to the initialization linked list; in the case where it is determined based on the response information address that there are unread nodes in the current file, determining the next node address based on the first address of the first call information, the size of the first call information, and the size of the response information; obtaining the next node from the current file as the current node based on the next node address, and continuing to execute the step of reading the first call information of the current node in the current file; in the case where it is determined based on the response information address that there are no unread nodes in the current file and the file corresponding to the file identifier has not been loaded, obtaining the next file as the current file based on the file identifier, and continuing to execute the step of reading the first call information of the current node in the current file until all files corresponding to the file identifier are loaded.
[0098] Among them, combined Figure 5 As shown, Figure 5 The flowchart of the preloading step in an example is shown. In this embodiment, the client initiates a request to create an initialization linked list, which is used to store the first call information, response information address and next node address loaded from the hard disk. Then, it is retrieved whether the above-mentioned data solidification path is in the solidified data file. If so, the identifier of the solidified data file corresponding to the solidified data path is saved, such as the name of the solidified data file. Then, the current file is determined and a memory mapping operation is performed on the current file. Specifically, the first call information of the current node in the current file is read, and the first call information is stored in the node corresponding to the initialization linked list. Then, based on the first address of the first call information and the size of the first call information, the response information address of the current node in the current file is determined (the response information address is also the address of the next node). Figure 5The data address), and determine whether there are unread nodes in the current file based on the response information address. For example, determine whether the response information address is the file tail address of the current file. If so, obtain the next file as the current file and continue to execute the above file reading steps until all the solidified data files corresponding to the solidified data path are read. If it is determined based on the response information address that there are still unread nodes in the current file, determine the next node address based on the start address of the first call information, the size of the first call information, and the size of the response information. The size of the first call information is generally fixed and known. For example, in this application, the size of the first call information is 100 bytes. The size of the response information is generally also fixed. Since the type of the call is determined, the size of the response information corresponding to the call type is also determined. Therefore, the next node address can be the sum of the start address of the first call information, the size of the first call information, and the size of the response information.
[0099] In the above embodiment, the solidified simulation data is pre-loaded. During the pre-loading process, only the request identification information (RequestInfo) of each packet of data and the corresponding response information address are pre-loaded into the initialization linked list by means of file mapping, avoiding the response information occupying memory and improving the processing efficiency. And in the subsequent simulation process, it is determined whether to delay based on the time of loading the response information and the request response time. In this way, there is a certain overlap between the time of loading the response information and the request response time, which can improve the processing efficiency.
[0100] In one optional embodiment, the method further includes: when the mirror data collection thread receives an interface call request from a new client, query whether the initial identification information corresponding to the interface call request of the client has been cached; when the initial identification information corresponding to the interface call request has been cached, update the execution sequence number of the interface call request; generate request identification information based on the initial identification information and the execution sequence number; generate second call information based on the request identification information, and store the second call information and the original call result information corresponding to the interface call request as simulation data in the cache.
[0101] Among them, this application involves the process of storing simulation data. In the actual process of processing the interface call request of the client, the storage of simulation data is realized. In this way, during the subsequent simulation, these simulation data can be obtained, so that the details of the interface operation data and operation time in the on-machine test can be truly and completely restored.
[0102] Specifically, a data mirror function is embedded in the client pile function, so that during the actual execution process of the client, the client initiates an interface call request, calls the client pile function, and informs the mirror data acquisition thread of the request start. The client then processes the interface call request normally, including serializing the client request parameters, packaging the request data information corresponding to the interface call request, including packaging the request name, request data size, request thread identifier, and communication connection number, and sending the packaged data to the server. The server calls the target hardware interface according to the request information, serializes the hardware acquisition data returned by the target hardware interface, packages the returned data, and transmits it to the client pile function, wherein the returned data includes the request name, return data size, request thread identifier (request thread number), and communication connection number, etc. After receiving the returned data, the client pile function notifies the mirror data acquisition thread, and the request processing ends. The subsequent client pile function deserializes the returned data, and ends the call processing after returning the data to the user. The specific process can be seen in Figure 6 shown.
[0103] The processing steps of the mirror data collection thread can be combined Figure 7 As shown, the mirror data acquisition thread obtains the interface call request initiated by the client and receives the request end instruction from the client. In this way, it is queried whether the initial identification information corresponding to the interface call request of the client has been cached. If it has been cached, the execution sequence number of the interface call request is updated, such as adding one. In one of the optional embodiments, when the initial identification information corresponding to the interface call request is not cached, the initial identification information corresponding to the interface call request is added to the cache, and after the execution sequence number of the interface call request is updated, the step of generating the request identification information based on the initial identification information and the execution sequence number is continued.
[0104] Subsequently, the second calling information is generated based on the request identification information. For the specific definition of the second calling information, please refer to the first calling information above, which will not be repeated here.
[0105] Subsequently, the second calling information and the original calling result information corresponding to the interface calling request are stored in the cache as simulation data.
[0106] In one of the optional embodiments, the cache includes a target linked list, each node in the target linked list is used to store the second call information, the original call result information and the next node address, and the next node address is obtained based on the size of the second call information and the size of the original call result information.
[0107] Specifically, combined Figure 8 As shown, Figure 8is a schematic diagram of a target linked list in an embodiment. In this embodiment, each node in the target linked list is used to store the second call information (such as Figure 8 Header, Header1, Header2...HeaderN in the original call result information (such as Figure 8 Data, Data1, Data2...DataN) and the next node address (such as Figure 8 NextPtr in the target list), where the original call result information is the response information mentioned above. Each node in the target list is used to store the above information corresponding to a call, so as to facilitate subsequent search. Specifically, combined with Figure 8 As shown, Figure 8 is a schematic diagram of a target linked list in an embodiment. In this embodiment, each node in the target linked list is used to store the second call information (such as Figure 8 Header, Header1, Header2...HeaderN in the original call result information (such as Figure 8 Data, Data1, Data2...DataN) and the next node address (such as Figure 8 NextPtr in the target list), where the original call result information is the response information mentioned above. Each node in the target list is used to store the above information corresponding to a call for subsequent search.
[0108] Continuing from the above, after the initial identification information corresponding to the interface call request has been included in the cache, the second call information is constructed, wherein optionally, the size of the second call information is fixed, the second call information is used as the node header of the current node, and the serialized return data returned by the server is stored as the original call result information in the current node to realize the storage of simulation data.
[0109] In one of the optional embodiments, after the second call information is associated with the original call result information corresponding to the interface call request and stored in the cache, it also includes: when the mirror data acquisition thread receives the mirror data storage end instruction, a new file is generated based on the cached second call information and the original call result information corresponding to the interface call request, and the new file is stored in a persistent medium; the cache is cleared, and the mirror data acquisition thread is ended.
[0110] The mirror data storage end instruction refers to the end instruction of the simulation data collection, or the call completion instruction, so there is no need to collect data. Figure 7As shown, after the data collection is completed, in order to avoid the loss of the original call result information stored in the cache, the original call result information is persistently stored, for example, stored in a persistent medium such as a hard disk. The persistent storage can store the simulation data stored in the cache as a new file, and the identifier of the file, such as the file name, can be the request identifier information in the second call information in the simulation data. After the simulation data is stored, the cache is cleared and the mirror data collection thread is ended.
[0111] In one alternative embodiment, after storing the second call information and the original call result information corresponding to the interface call request as simulation data in the cache, it further includes: updating the size of the simulation data stored in the cache based on the size of the second call information and the size of the original call result information; detecting whether the size of the simulation data stored in the cache is greater than or equal to a threshold value when no mirror data storage end instruction is received; when the size of the simulation data stored in the cache is greater than or equal to the threshold value, generating a new file based on the simulation data in the cache and storing the new file in the persistent medium; clearing the cache and continuing to wait for the next mirror data storage end instruction through the mirror data collection thread.
[0112] Among them, in this embodiment, if no mirror data storage end instruction is received, the simulation data is continuously stored in the cache at this time. In order to avoid occupying too much cache and affecting the normal operation of the system, after each storage of the second call information and the original call result information, the size of the simulation data is calculated, and when the size of the simulation data is greater than or equal to the threshold value, the simulation data stored in the cache is mapped to a new file in the persistent medium, and the simulation data stored in the cache is cleared.
[0113] The threshold value can be the size of the pre-allocated cache, and the pre-allocated cache can be determined based on different types of call requests, so as to store a certain amount of simulation data of interface call requests in the cache, avoid multiple IO reads, and improve system efficiency. In addition, the size of the cache can be selected through a configuration file to effectively reduce the impact on the efficiency of the embedded interface. The purpose of using the cache instead of directly storing to the hard disk is to reduce the time overhead of frequently saving data to the hard disk.
[0114] In one alternative embodiment, the method further includes: recording the current request time of the interface call request when the mirror data collection thread receives the interface call request start instruction; obtaining the reception time of the interface call request end instruction when the mirror data collection thread receives the interface call request end instruction, and obtaining the request response time of the interface call request based on the reception time and the current request time; adding the request response time to the second call information.
[0115] In this embodiment, the mirror data acquisition thread uses the current and initiating call time to record a complete interface execution time, and adds a request response time record in the second call information. Specifically, when the mirror data acquisition thread receives an interface call request start instruction, the current request time of the interface call request is recorded; when the mirror data acquisition thread receives an interface call request end instruction, the reception time of the interface call request end instruction is obtained, so that the request response time can be obtained by subtracting the current request time from the reception time.
[0116] Among them, for the convenience of understanding, combined Figure 7 As shown in the figure, the simulation data storage process is introduced in detail. This step is mainly to persistently mirror the simulation data on the computer. This step is used to obtain the original communication data and running time of the interface, which is the key information in the virtualization process. The first step is to open the simulation data storage step through the configuration function or configuration file. The method of configuring the function usually requires adding the configuration function and recompiling the code. The method of dynamically detecting the configuration file does not require modifying the code. After modifying the configuration file, the test project path is added to the configuration file at the same time. After the modification is completed and saved, a pop-up window will appear to remind the user that the software will enter the simulation data acquisition mode, and the user needs to click to confirm. After the user clicks to confirm, the embedded data mirror function in the client stub function and the server stub is enabled, and a larger memory is applied in the client system as a cache (buffer) for temporary storage of simulation data. A global target linked list manages all call related information. The cache (buffer) size can be selected to a suitable size through the configuration file, which can effectively reduce the efficiency impact of the embedded interface. The time overhead of frequent hard disk storage of data is reduced by caching (buffer) instead of directly storing it on the hard disk. The management of the buffer uses a linked list to store simulation data. The head of the linked list stores the necessary management information and simulation data. The management information contains the starting address of the next node, and the tail of the linked list marks itself as the termination node.
[0117] When the client initiates an interface call request, the mirror data collection thread embedded in the client is notified to record the currently executed thread information and the start time of the request.
[0118] First, lock the target linked list (InfoList) and accumulate the execution sequence number under the interface call request. Then add and record all the currently packaged information, including the request name, thread ID, and execution sequence number. At the same time, the client requests to send the simulation data to the server stub through a remote procedure call, execute the target service function, and pass the return value to the server stub after the target service function is executed. The server stub packages the data and returns it to the client stub function. After the client stub function receives the return information, it records the data as the original call result information and notifies the mirror data acquisition thread that the current request ends. The mirror data acquisition thread records the reception time of the call request end instruction, and records a complete request response time through the reception time and the call initiation time, and increases the request response time in the cache. Secondly, the management ownership of the simulation data is transferred to the cache. The management ownership refers to the release ownership of resources. When the available cache is sufficient, all information is flushed into the target linked list in the cache for management, and the data is copied or transferred to the cache by ownership transfer.
[0119] Then determine whether the mirror data storage end instruction is received and decide whether to save the file. The file is saved incrementally. If the mirror data storage end instruction is not received and the size of the simulation data reaches the target limit, a new file is re-stored with an increasing serial number index to avoid a single file being too large.
[0120] In the above embodiment, the data is collected through the background monitoring thread to minimize the impact on the operation of the main task. The simulation data that needs to be collected is managed through the pre-applied cache. The simulation data stored in the cache is stored in the hardware only when it meets certain conditions, reducing the efficiency loss caused by I / O operations. In addition, a request response time statistics function is embedded to perform request response time statistics, and the program operation process is restored to the greatest extent during simulation.
[0121] In one of the optional embodiments, the method also includes: determining the simulation state in the form of a configuration file or a configuration function; when the simulation state is the simulation mode, continuing to execute the step of obtaining the interface call request initiated by the client and the request identification information of the interface call request; when the simulation state is the mirror data acquisition mode, continuing to execute the step of querying whether the initial identification information corresponding to the client's interface call request has been cached when the mirror data acquisition thread receives a new client's interface call request.
[0122] Specifically, combined Figure 9 As shown, in this application, various modes are configured using a configuration file as an example. After startup, the client opens the configuration file and parses the configuration file to obtain the mirror mode flag. If it is a normal mode, that is, a normal client operation mode, the client runs normally to implement the interface call request.
[0123] If it is the mirror data acquisition mode, it outputs whether to enter the mirror data acquisition mode in the form of a pop-up window. After receiving the confirmation instruction, it parses the configuration file to obtain the test project path and verifies whether the test project path is valid. If the test project path is invalid, it returns an error; otherwise, it performs mirror data acquisition. The specific acquisition process can be combined with the above Figure 7 as shown. If it receives an instruction to reject entering the mirror data acquisition mode and the configuration parameters of the configuration file are default values, it processes according to the normal mode.
[0124] If it is the simulation mode, it outputs whether to enter the simulation mode in the form of a pop-up window. After receiving the confirmation instruction, it parses the configuration file to obtain the test project path and verifies whether the test project path is correct. If the test project path is invalid, it returns an error; otherwise, it performs the simulation steps. The simulation steps can be combined with the above Figure 3 , which will not be elaborated here.
[0125] It should be understood that although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the arrows, these steps do not necessarily execute in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily execute at the same time, but can execute at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps in other steps.
[0126] Based on the same inventive concept, the embodiments of the present application also provide a virtual simulation device for implementing the virtual simulation method involved above. The implementation solutions provided by this device to solve problems are similar to the implementation solutions recorded in the above method. Therefore, the specific limitations in one or more embodiments of the virtual simulation device provided below can refer to the limitations on the virtual simulation method in the above text, which will not be elaborated here.
[0127] In an exemplary embodiment, as Figure 10 shown, a virtual simulation device is provided, including: a call request acquisition module 1001, a response information address acquisition module 1002, and a response information acquisition module 1003, where:
[0128] The call request acquisition module 1001 is used to acquire the interface call request initiated by the client and the request identification information of the interface call request;
[0129] A response information address acquisition module 1002 is configured to query an initialization linked list to obtain a response information address corresponding to the request identification information. Each node in the initialization linked list is used to store first call information and a response information address obtained based on simulation data of a persistent mirror image. The first call information includes the request identification information.
[0130] A response information acquisition module 1003 is configured to obtain response information based on the response information address, where the response information is obtained by performing a persistent mirror image on the original call result information of the interface.
[0131] In one optional embodiment, the above device further includes: a delay module, configured to record the start time of the interface call request; query the request response time corresponding to the request identification information; perform a delay operation based on the request response time and the start time; and return the response information after the delay operation ends.
[0132] In one optional embodiment, the above delay module is specifically configured to calculate a delay time based on the request response time and the loading time of the response information; perform a delay operation based on the start time and the delay time when the delay time is greater than a preset time length; and continue to execute the step of returning the response information when the delay time is less than or equal to the preset time length.
[0133] In one optional embodiment, the above device further includes: an initialization module, configured to receive an initialization request, where the initialization request carries a file identifier; create an initialization linked list in a cache based on the initialization request; query each file corresponding to the file identifier; determine first call information, a response information address corresponding to each first call information, and a next node address corresponding to each first call information based on each file, and store the first call information, the response information address corresponding to each first call information, and the next node address in corresponding nodes of the initialization linked list.
[0134] In one optional embodiment, the above-mentioned initialization module is specifically configured to determine the current file, read the first call information of the current node in the current file, and store the first call information in the corresponding node of the initialization linked list; based on the start address and size of the first call information, determine the response information address of the current node in the current file, and store the response information address in the corresponding node of the initialization linked list; in the case that it is determined based on the response information address that there are unread nodes in the current file, determine the next node address based on the start address, size of the first call information, and size of the response information; obtain the next node from the current file as the current node based on the next node address, and continue to execute the step of reading the first call information of the current node in the current file; in the case that it is determined based on the response information address that there are no unread nodes in the current file and the file corresponding to the file identifier is not completely loaded, obtain the next file as the current file based on the file identifier, and continue to execute the step of reading the first call information of the current node in the current file until all the files corresponding to the file identifier are completely loaded.
[0135] In one optional embodiment, the above-mentioned device further includes: a simulation data acquisition module, configured to query whether the initial identification information corresponding to the interface call request of the client has been cached when the mirror data acquisition thread receives an interface call request from a new client; in the case that the initial identification information corresponding to the interface call request has been cached, update the execution sequence number of the interface call request; generate request identification information based on the initial identification information and the execution sequence number; generate second call information based on the request identification information, and store the second call information and the original call result information corresponding to the interface call request as simulation data in the cache.
[0136] In one optional embodiment, the cache includes a target linked list, and each node in the target linked list is used to store the second call information, the original call result information, and the next node address, and the next node address is obtained based on the size of the second call information and the size of the original call result information.
[0137] In one optional embodiment, the above-mentioned simulation data acquisition module is further specifically configured to, in the case that the initial identification information corresponding to the interface call request is not cached, add the initial identification information corresponding to the interface call request to the cache, and after updating the execution sequence number of the interface call request, continue to execute the step of generating request identification information based on the initial identification information and the execution sequence number.
[0138] In one alternative embodiment, the above simulation data acquisition module is further specifically configured to, when the mirror data acquisition thread receives an instruction indicating the end of mirror data storage, generate a new file based on the cached second call information and the original call result information corresponding to the interface call request, store the new file in a persistent medium, clear the cache, and end the mirror data acquisition thread.
[0139] In one alternative embodiment, the above simulation data acquisition module is further specifically configured to update the size of the simulation data stored in the cache based on the size of the second call information and the size of the original call result information; when not receiving an instruction indicating the end of mirror data storage, detect whether the size of the simulation data stored in the cache is greater than or equal to a threshold; when the size of the simulation data stored in the cache is greater than or equal to the threshold, generate a new file based on the cached simulation data, store the new file in a persistent medium, clear the cache, and continue to wait for the next instruction indicating the end of mirror data storage through the mirror data acquisition thread.
[0140] In one alternative embodiment, the above simulation data acquisition module is further specifically configured to record the current request time of the interface call request when the mirror data acquisition thread receives an instruction indicating the start of the interface call request; when the mirror data acquisition thread receives an instruction indicating the end of the interface call request, obtain the reception time of the instruction indicating the end of the interface call request, and obtain the request response time of the interface call request based on the reception time and the current request time; add the request response time to the second call information.
[0141] In one alternative embodiment, the above device further includes: a module for determining the simulation state in the form of a configuration file or a configuration function; when the simulation state is the simulation mode, continue to execute the step of obtaining an interface call request initiated by a client and the request identification information of the interface call request; when the simulation state is the mirror data acquisition mode, continue to execute the step of querying whether the initial identification information corresponding to the interface call request of the client has been cached when the mirror data acquisition thread receives an interface call request from a new client.
[0142] Each module in the above virtual simulation device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the above respective modules.
[0143] In an exemplary embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 11As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a virtual simulation method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0144] Those skilled in the art can understand that Figure 11 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0145] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0146] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0147] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0148] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0149] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in the present application.
[0150] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A virtual simulation method, characterized in that: The method comprises: Obtaining an interface call request initiated by a client and request identification information of the interface call request; recording a start time of the interface call request; Querying the preloaded initialization linked list in the cache to obtain the request response time and the response information address corresponding to the request identification information, each node in the initialization linked list is used to store the first call information, the response information address and the next node address corresponding to each first call information obtained based on the simulation data of the persistent image, the first call information includes the request identification information, and the next node address is determined based on the first address of the first call information, the size of the first call information and the size of the response information; Acquire response information based on the response information address, wherein the response information is obtained by persistently mirroring the original call result information of the interface, and acquire the loading time of the response information; Determine whether to delay based on the loading time of the response information and the request response time; If a delay is required, a delay operation is performed based on the request response time and the start time; After the delay operation is completed, the response information is returned.
2. The method according to claim 1, characterized in that: The determining whether to delay based on the loading time of the response information and the request response time includes: Calculate the delay time based on the request response time and the loading time of the response information; When the delay time is greater than a preset time length, determining that a delay is required; When the delay time is less than or equal to the preset time length, continue to execute the step of returning the response information; The delay operation based on the request response time and the start time includes: A delay operation is performed based on the start time and the delay time.
3. The method according to claim 1, characterized in that Before the query cache preloads the initialization linked list to obtain the request response time and the response information address corresponding to the request identification information, the following further includes: receiving an initialization request, wherein the initialization request carries a file identifier; Creating the initialization linked list in a cache based on the initialization request; Querying each file corresponding to the file identifier; Based on the files, the first call information, the response information address corresponding to each of the first call information, and the next node address corresponding to each of the first call information are determined, and the first call information, the response information address and the next node address corresponding to each of the first call information are stored in the corresponding nodes of the initialization linked list.
4. The method according to claim 3, characterized in that The determining, based on the files, first call information, response information addresses corresponding to each of the first call information, and next node addresses corresponding to each of the first call information, and storing the first call information, the response information addresses corresponding to each of the first call information, and the next node addresses respectively corresponding to the first call information in the corresponding nodes of the initialization linked list, includes: Determine a current file, read first call information of a current node in the current file, and store the first call information in a node corresponding to the initialization linked list; Determine the response information address of the current node in the current file based on the first address of the first call information and the size of the first call information, and store the response information address in the node corresponding to the initialization linked list; In the case where it is determined based on the response information address that the current file has an unread node, determining the next node address based on the first address of the first call information, the size of the first call information, and the size of the response information; Based on the next node address, a next node is obtained from the current file as the current node, and the step of reading the first call information of the current node in the current file is continued; When it is determined based on the response information address that there is no unread node in the current file and the file corresponding to the file identifier has not been loaded, the next file is obtained as the current file based on the file identifier, and the step of reading the first call information of the current node in the current file is continued until the files corresponding to the file identifier are all loaded.
5. The method according to claim 1, characterized in that The method further comprises: When the mirror data collection thread receives a new client interface call request, query whether the initial identification information corresponding to the client interface call request has been cached; If the initial identification information corresponding to the interface call request has been cached, updating the execution sequence number of the interface call request; Generate request identification information based on the initial identification information and the execution sequence number; Generate second call information based on the request identification information, and store the second call information and original call result information corresponding to the interface call request in a cache as simulation data.
6. The method according to claim 5, characterized in that The cache includes a target linked list, each node in the target linked list is used to store the second call information, the original call result information and the next node address, and the next node address is obtained based on the size of the second call information and the size of the original call result information.
7. The method according to claim 5, characterized in that The method further comprises: When the initial identification information corresponding to the interface call request is not cached, the initial identification information corresponding to the interface call request is added to the cache, and after the execution number of the interface call request is updated, the step of generating the request identification information based on the initial identification information and the execution number is continued.
8. The method according to claim 5, characterized in that After storing the second call information and the original call result information corresponding to the interface call request as simulation data in the cache, the method further includes: When the image data acquisition thread receives an image data storage end instruction, a new file is generated based on the cached second call information and the original call result information corresponding to the interface call request, and the new file is stored in a persistent medium; The cache is cleared and the mirror data acquisition thread is terminated.
9. The method according to claim 5, characterized in that After storing the second call information and the original call result information corresponding to the interface call request as simulation data in the cache, the method further includes: updating the size of the simulation data stored in the cache based on the size of the second call information and the size of the original call result information; In the case where the mirror data storage end instruction is not received, detecting whether the size of the simulation data stored in the cache is greater than or equal to a threshold; When the size of the simulation data stored in the cache is greater than or equal to the threshold, generating a new file based on the cached simulation data, and storing the new file in a persistent medium; The cache is cleared, and the mirror data acquisition thread continues to wait for the next mirror data storage end instruction.
10. The method according to claim 5, characterized in that The method further comprises: When the mirror data acquisition thread receives an interface call request start instruction, recording a current request time of the interface call request; When the mirror data acquisition thread receives an interface call request end instruction, obtain the reception time of the interface call request end instruction, and obtain the request response time of the interface call request based on the reception time and the current request time; The request response time is added to the second call information.
11. The method according to any one of claims 5 to 10, characterized in that: The method further comprises: Determine the simulation status through configuration files or configuration functions; When the simulation state is the simulation mode, continue to execute the step of obtaining the interface call request initiated by the client and the request identification information of the interface call request; When the simulation state is the mirror data acquisition mode, the step of querying whether the initial identification information corresponding to the interface call request of the client has been cached is continued when the mirror data acquisition thread receives a new interface call request of the client.
12. A virtual simulation device, characterized in that: The device comprises: A call request acquisition module, used to acquire an interface call request initiated by a client and request identification information of the interface call request; A response information address acquisition module, used for querying the initialization linked list preloaded in the cache to obtain the response information address corresponding to the request identification information, each node in the initialization linked list is used to store the first call information obtained based on the simulation data of the persistent image, the response information address and the next node address corresponding to each of the first call information, the first call information includes the request identification information, and the next node address is determined based on the first address of the first call information, the size of the first call information and the size of the response information; A response information acquisition module, used to acquire response information based on the response information address, wherein the response information is obtained by persistently mirroring the original call result information of the interface, and acquire the loading time of the response information; A delay module is used to record the start time of the interface call request; query the request response time corresponding to the request identification information; determine whether to delay based on the loading time of the response information and the request response time; if delay is required, perform a delay operation based on the request response time and the start time; after the delay operation is completed, return the response information.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Data caching method and device based on linked list, electronic equipment and storage medium
CN112860592A
Interface test system and method based on simulation scene use case
CN115269415A
Test environment building method and device, computer equipment and storage medium
CN116010268A
Mirror image test method and device
CN116743553A