CN115208951B - Request processing method, request processing device, electronic equipment and computer readable storage medium - Google Patents

Request processing method, request processing device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN115208951B
CN115208951B CN202210750806.7A CN202210750806A CN115208951B CN 115208951 B CN115208951 B CN 115208951B CN 202210750806 A CN202210750806 A CN 202210750806A CN 115208951 B CN115208951 B CN 115208951B
Authority
CN
China
Prior art keywords
data
test data
local server
client
acquisition request
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.)
Active
Application number
CN202210750806.7A
Other languages
Chinese (zh)
Other versions
CN115208951A (en
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202210750806.7A priority Critical patent/CN115208951B/en
Publication of CN115208951A publication Critical patent/CN115208951A/en
Application granted granted Critical
Publication of CN115208951B publication Critical patent/CN115208951B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a request processing method, a request processing device, electronic equipment and a computer readable storage medium, wherein the request processing method comprises the following steps: generating a data acquisition request in response to an acquisition operation for test data; transmitting the data acquisition request to the local server based on a pre-configured target local host file, so that the local server determines target test data from the test data configuration file based on the data acquisition request; and receiving the target test data fed back by the local server. The invention can obviously reduce the workload required by maintaining the shared data and can effectively improve the reliability of the test data.

Description

Request processing method, request processing device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and apparatus for processing a request, an electronic device, and a computer readable storage medium.
Background
Currently, mock tools can be utilized to aid in testing and constructing data and the like during front-end and back-end development. In practical application, a plurality of test items can share the data constructed by the Mock tool and the Mock tool, and different test items may need to modify the shared data under different requirements of test scenes, so when the plurality of test items need to use the same shared data, the shared data needs to be maintained again, resulting in higher workload required by maintaining the data, and in the test process of a certain test item, the shared data used by the test items are modified by staff of other test items, so that the test failure of the test item is caused, that is, the problem of poor reliability of the shared data in the test process is solved.
Disclosure of Invention
In view of the foregoing, an object of the present invention is to provide a request processing method, apparatus, electronic device, and computer-readable storage medium, which can significantly reduce the workload required for maintaining common data, and can effectively improve the reliability of test data.
In a first aspect, an embodiment of the present invention provides a method for processing a request, where the method is applied to a client, where the client is communicatively connected to a local server, and the local server stores a test data configuration file corresponding to the client, and the method includes:
generating a data acquisition request in response to an acquisition operation for test data;
transmitting the data acquisition request to the local server based on a pre-configured target local host file, so that the local server determines target test data from the test data configuration file based on the data acquisition request;
and receiving the target test data fed back by the local server.
Further, before the step of sending the data acquisition request to the local server based on the preconfigured destination local host file, the method further includes:
acquiring an initial local host file stored by the client and address information corresponding to the local server; wherein the address information comprises domain name information and/or IP information of the local server;
and modifying the initial local host file based on the address information to obtain a target host file.
In a second aspect, an embodiment of the present invention further provides a method for processing a request, where the method is applied to a local server, where the local server is communicatively connected to a client, and the local server stores a test data configuration file corresponding to the client, and the method includes:
receiving a data acquisition request sent by the client; wherein the data acquisition request is sent to the local server by the client based on a pre-configured destination local host file;
determining target test data from the test data configuration file based on the data acquisition request;
and feeding the target test data back to the client.
Further, the local server is configured with a plurality of candidate interfaces, each candidate interface corresponds to a test data configuration file, and the step of determining target test data from the test data configuration files based on the data acquisition request includes:
analyzing the data acquisition request to obtain a first designated field and a data description parameter contained in the data acquisition request;
determining a target interface from the candidate interfaces based on the first specified field;
and determining target test data matched with the data description parameters from the test data configuration file corresponding to the target interface.
Further, the step of feeding back the target test data to the client includes:
and generating a feedback data packet based on a second preset designated field and the target test data, and sending the feedback data packet to the client.
Further, the method further comprises:
acquiring Mock data stored in a designated data sharing platform;
responding to configuration operation aiming at the Mock data, and determining a test data configuration file corresponding to each candidate interface;
and storing each candidate interface and the test data configuration file corresponding to each candidate interface in a correlation way.
In a third aspect, an embodiment of the present invention further provides a request processing apparatus, where the apparatus is applied to a client, where the client is communicatively connected to a local server, and the local server stores a test data configuration file corresponding to the client, and the apparatus includes:
the request generation module is used for responding to the acquisition operation aiming at the test data and generating a data acquisition request;
the request interception module is used for sending the data acquisition request to the local server based on a pre-configured target specimen local host file so that the local server can determine target test data from the test data configuration file based on the data acquisition request;
and the data receiving module is used for receiving the target test data fed back by the local server.
In a fourth aspect, an embodiment of the present invention further provides a request processing apparatus, where the apparatus is applied to a local server, where the local server is communicatively connected to a client, and the local server stores a test data configuration file corresponding to the client, and the apparatus includes:
the request receiving module is used for receiving a data acquisition request sent by the client; wherein the data acquisition request is sent to the local server by the client based on a pre-configured destination local host file;
the data determining module is used for determining target test data from the test data configuration file based on the data acquisition request;
and the data feedback module is used for feeding back the target test data to the client.
In a fifth aspect, embodiments of the present invention also provide an electronic device comprising a processor and a memory storing computer-executable instructions executable by the processor to implement the method of any one of the first aspects or to implement the method of any one of the second aspects.
In a sixth aspect, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement any of the methods provided in the first aspect, or cause the processor to implement any of the methods provided in the second aspect.
The request processing method, the request processing device, the electronic equipment and the computer readable storage medium are applied to a client, the client is in communication connection with a local server, the local server stores a test data configuration file corresponding to the client, firstly, a data acquisition request is generated in response to acquisition operation aiming at test data, then the data acquisition request is sent to the local server based on a pre-configured target local host file, so that the local server determines target test data from the test data configuration file based on the data acquisition request, and finally, the target test data fed back by the local server is received. According to the method, the target test data can be confirmed and fed back from the test data configuration file by directly intercepting the data acquisition request to the local server by utilizing the target specimen local host file, and compared with the method in the prior art that the common data is revised and fed back through the common Mock tool, the method and the device for revising the target test data by using the local server corresponding to the client can avoid other clients from revising the test data configuration file stored in the local server corresponding to the client, so that the workload required for maintaining the data can be remarkably reduced, and the reliability of the test data can be effectively improved.
The request processing method, the request processing device, the electronic equipment and the computer readable storage medium provided by the embodiment of the invention are applied to a local server, the local server is in communication connection with a client, and the local server stores a test data configuration file corresponding to the client. And if the data acquisition request sent by the client is received, determining target test data from the test data configuration file based on the data acquisition request, and feeding the target test data back to the client, wherein the data acquisition request is sent to the local server by the client based on a pre-configured target local host file. Compared with the prior art that the shared data is modified and fed back through the shared Mock tool, the method can be used for feeding back the required target test data through the local server corresponding to the client, so that other clients can be prevented from modifying the test data configuration file stored in the local server corresponding to the client, workload required for maintaining the data can be remarkably reduced, and reliability of the test data can be effectively improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a request processing method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating another method for processing a request according to an embodiment of the present invention;
FIG. 3 is an overall framework of a request processing method according to an embodiment of the present invention;
FIG. 4 is an interactive schematic diagram of a request processing method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a request processing device according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of another request processing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described in conjunction with the embodiments, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
At present, a plurality of test items generally use a unified public Mock platform and public Mock data, the public Mock data is identified and modified through marked interfaces, but the same set of Mock data is read by calling the same interface, and after the Mock data is modified, the modified Mock data needs to be maintained before other test items are used. In summary, the existing Mock tool has the problems of higher data maintenance workload, poor data reliability and the like. Based on the above, the embodiment of the invention provides a request processing method, a request processing device, an electronic device and a computer readable storage medium, which can remarkably reduce the workload required for maintaining common data and can effectively improve the reliability of test data.
For the sake of understanding the present embodiment, first, a detailed description will be given of a request processing method disclosed in the present embodiment, where the method is applied to a client, where the client may include a terminal device such as a smart phone, a tablet PC, a PC (Personal Computer, a personal computer), etc., the client may also be referred to as a front end, and the client is communicatively connected to a local server, where the local server stores a test data configuration file corresponding to the client, and referring to a flow diagram of a request processing method shown in fig. 1, the method mainly includes steps S102 to S106 below:
step S102, in response to the acquisition operation for the test data, a data acquisition request is generated. The data acquisition request carries a first designated field and a data description parameter, the first designated field is used for determining a target interface from a plurality of candidate interfaces configured by the local server, and the data description parameter is used for determining required target test data from a test data configuration file corresponding to the target interface. In one embodiment, a graphical user interface may be provided through the client and a test page may be displayed through the graphical user interface where a user may configure a data acquisition request.
Step S104, based on the pre-configured target specimen local host file, a data acquisition request is sent to the local server, so that the local server determines target test data from the test data configuration file based on the data acquisition request. The destination local host file stores address information of a local server, the address information includes domain name information and/or IP (Internet Protocol ) information, the test data configuration file is obtained based on Mock data in a designated data sharing platform, and the designated data sharing platform can be a public Mock platform. In practical application, if the data acquisition request is not intercepted by the destination specimen local host file, the data acquisition request is sent to a public Mock platform, and the public Mock platform modifies the Mock data based on the data acquisition request and feeds back the modified Mock data; in the embodiment of the invention, the data acquisition request is intercepted to the local server through the target local host file, and the local server determines the target test data matched with the data description parameters from the test data configuration file corresponding to the target interface.
And step S106, receiving target test data fed back by the local server. In one embodiment, the local server sends the target test data to the client, and the client may perform a corresponding test item based on the target test data.
According to the request processing method provided by the embodiment of the invention, the target test data can be determined and fed back from the test data configuration file by directly intercepting the data acquisition request to the local server by using the target specimen local host file.
In one embodiment, a corresponding local server can be deployed for each client, so that when a certain test item is performed by the client, required target test data can be obtained from the corresponding local server.
In order to intercept the data acquisition request to the local server, the initial local host file stored by the client needs to be modified in advance, in a specific embodiment, the initial local host file stored by the client and address information corresponding to the local server may be acquired, and the initial local host file is modified based on the address information to obtain the target host file. The initial local host file stores address information of a designated data sharing platform. Optionally, the address information of the designated data sharing platform may be replaced with address information corresponding to the local server to obtain the target host file, the data obtaining request is marked as an HttpServletRequest object, and before the HttpServletRequest object is sent to the designated data sharing platform, the HttpServletRequest object may be blocked to the local server by using the target host file.
In one embodiment, after the HttpServletRequest object is sent to the local server, the local server may parse the HttpServletRequest object to obtain a first specified field and a data description parameter in the HttpServletRequest object, the local server further determines a target interface according to the first specified field, determines target test data from a test data configuration file corresponding to the target interface according to the data description parameter, and feeds back the target test data to the client, where the client may execute a corresponding test item using the target test data.
For the understanding of the foregoing embodiments, another request processing method is provided in the embodiments of the present invention, where the method is applied to a local server, alternatively, the local server may be understood as a simple server tool written by using tools such as Python, or a simple server tool implemented by an Android/IOS mobile terminal, where the local server is communicatively connected to a client, and the local server stores a test data configuration file corresponding to the client, and referring to a flow chart of another request processing method shown in fig. 2, the method mainly includes steps S202 to S206 below:
step S202, a data acquisition request sent by a client is received. Wherein the data acquisition request is sent to the local server by the client based on a pre-configured destination local host file. In one embodiment, the client generates a data acquisition request, and intercepts the data acquisition request to the local server through a target host file stored in the client before sending the data acquisition request to the designated data sharing platform, and the local server can receive the data acquisition request, wherein the data acquisition request is marked as an HttpServletRequest object.
Step S204, determining target test data from the test data configuration file based on the data acquisition request. In one embodiment, the HttpServletRequest object may be parsed to determine a target interface and a data description parameter corresponding to the object, so as to determine target test data matching the data description parameter from the test data corresponding to the target interface.
In step S206, the target test data is fed back to the client. In one embodiment, after feeding back the target test data to the client, the client may execute the corresponding test item using the target test data.
Compared with the prior art that common data is modified and fed back through a common Mock tool, the request processing method provided by the embodiment of the invention can avoid other clients from modifying the test data configuration file stored in the local server corresponding to the client, can obviously reduce the workload required for maintaining the data, and can effectively improve the reliability of the test data.
In one embodiment, before executing the foregoing step S202, a test data configuration file stored by the local server (may also be referred to as a local configuration file) needs to be configured, specifically, mock data stored in the designated data sharing platform may be obtained, a test data configuration file corresponding to each candidate interface is determined in response to a configuration operation for the Mock data, and finally each candidate interface and a test data configuration file corresponding to each candidate interface are associated and stored. In practice, the test data profile may be saved in the form of a INI (initialization) document and the interface and response (i.e., feedback data packet) distinguished by specified fields. Illustratively, with the key as the first specified field, different key values may correspond to different interfaces; section is taken as a second specified field. In particular implementations, mock data may be configured based on particular test items, which embodiments of the present invention are not limited to. In addition, by storing the candidate interface, the test data configuration file and the mapping relation between the candidate interface and the test data configuration file, the data acquisition request can be responded quickly, and therefore target test data can be fed back to the client side efficiently.
On the basis of the foregoing embodiment, the local server provided by the embodiment of the present invention is configured with a plurality of candidate interfaces, where each candidate interface corresponds to a test data configuration file, and on the basis of this embodiment, the embodiment of the present invention provides an implementation manner of determining target test data from the test data configuration files based on a data acquisition request, see the following steps 1 to 3:
and step 1, analyzing the data acquisition request to obtain a first designated field and a data description parameter contained in the data acquisition request. The first designated field may be set as a key, where different key values correspond to different candidate interfaces. Exemplary, the embodiment of the invention provides a code for analyzing an HttpServletRequest object, which is as follows:
a data acquisition request of a "# acquisition client;
request_data=client_socket.recv(1024);
print("request data:",request_data);
request_lines=request_data.splitlines();
for line in request_lines:
print(line);
analyzing the message of the data acquisition request;
request_start_line=request_lines[0];
extracting target interface and data description parameters of the data acquisition request;
file_name=re.match(r"\w++(/[^]*)",
reque ststart line.decode("utf-8")).group(1);
method=re.match(r"(\w+)+/[^]*",
request_start_line.decode("utf-8")).group(1)”。
and step 2, determining a target interface from the candidate interfaces based on the first specified field. In one embodiment, the candidate interface corresponding to the key value in the first specified field may be used to determine the target interface.
And step 3, determining target test data matched with the data description parameters from the test data configuration file corresponding to the target interface. In an embodiment, each candidate interface may correspond to at least one test data configuration file, and in a specific implementation, the test data configuration file corresponding to the target interface may be determined based on the saved mapping relationship, and optionally, the data description parameter may be a data identifier, a data function, a data type, etc., so as to read target test data matched with the data description parameter from the test data configuration file.
For the foregoing step S206, the embodiment of the present invention further provides an implementation manner of feeding back the target test data to the client, where the feedback data packet may be generated based on the second preset specified field and the target test data, and the feedback data packet is sent to the client. The second specified field may be a section, and in combination with the first specified field key, the second specified field may be used to distinguish between an interface and a response.
In order to facilitate understanding of the request processing method provided by the foregoing embodiment, an overall framework of the request processing method shown in fig. 3 is provided in the embodiment of the present invention, where a front end, that is, the foregoing client, and an agent, that is, the foregoing local server, fig. 3 illustrates that a common Mock platform is preconfigured with Mock data, the agent may perform data interaction with the common Mock platform, the agent obtains Mock data stored in the common Mock platform, and configures the Mock data as a test data configuration file required for a front end test, where the test data configuration file is stored in the agent, the front end sends a data acquisition request to the agent, and the agent feeds back target test data for the data acquisition request.
On the basis of the foregoing fig. 3, the embodiment of the present invention further provides an interaction diagram of a request processing method shown in fig. 4, and fig. 4 further illustrates that the common Mock platform sends Mock data to the proxy, so that the proxy configures the Mock data as test data required by the front end. In one embodiment, the front end may send a data acquisition request to the agent, which will feed back corresponding target test data to the front end. In another embodiment, the front end may also send a data acquisition request to the common Mock platform, where the common Mock platform will modify the Mock data based on the data acquisition request to obtain target test data, and feed back the target test data to the front end.
In summary, according to the request processing method provided by the embodiment of the invention, the Mock tool can be directly operated locally through the local server, and the Mock data can be maintained by a client user and customized to test data required by the user by storing the Mock data in the local server, so that the use of other testers is not affected. In addition, the embodiments of the invention can directly run the Mock tool locally without deployment, thus effectively reducing the dependence required by the Mock operation, and the Mock tool can be started and used by local starting.
For the request processing method provided in the foregoing embodiment, the embodiment of the present invention provides a request processing device applied to a client, where the client is communicatively connected to a local server, and the local server stores a test data configuration file corresponding to the client, and referring to a schematic structural diagram of the request processing device shown in fig. 5, the device mainly includes the following parts:
a request generation module 502, configured to generate a data acquisition request in response to an acquisition operation for test data;
a request interception module 504, configured to send a data acquisition request to the local server based on a pre-configured target local host file, so that the local server determines target test data from the test data configuration file based on the data acquisition request;
the data receiving module 506 is configured to receive the target test data fed back by the local server.
According to the request processing device provided by the embodiment of the invention, the target specimen local host file can be directly utilized to intercept the data acquisition request to the local server, and the local server determines and feeds back the target test data from the test data configuration file.
In one embodiment, the device further includes a file configuration module, configured to obtain an initial local host file stored by the client and address information corresponding to the local server; the address information comprises domain name information and/or IP information of a local server; and modifying the initial local host file based on the address information to obtain a target host file.
For the request processing method provided in the foregoing embodiment, the embodiment of the present invention further provides a request processing device, where the request processing device is applied to a local server, and the local server is communicatively connected to a client, and the local server stores a test data configuration file corresponding to the client, and referring to a schematic structural diagram of a request processing device shown in fig. 6, the device mainly includes the following parts:
a request receiving module 602, configured to receive a data acquisition request sent by a client; the data acquisition request is sent to the local server by the client based on a pre-configured target local host file;
a data determining module 604, configured to determine target test data from the test data configuration file based on the data acquisition request;
the data feedback module 606 is configured to feed back the target test data to the client.
Compared with the prior art that the shared data is modified and fed back through the shared Mock tool, the request processing device provided by the embodiment of the invention feeds back the required target test data through the local server corresponding to the client, can avoid other clients from modifying the test data configuration file stored in the local server corresponding to the client, not only can remarkably reduce the workload required for maintaining the data, but also can effectively improve the reliability of the test data.
In one embodiment, the local server is configured with a plurality of candidate interfaces, each candidate interface corresponding to a test data configuration file, and the data determining module 604 is further configured to: analyzing the data acquisition request to obtain a first designated field and a data description parameter contained in the data acquisition request; determining a target interface from the candidate interfaces based on the first specified field; and determining target test data matched with the data description parameters from the test data configuration file corresponding to the target interface.
In one embodiment, the data feedback module 606 is further configured to: and generating a feedback data packet based on the second preset designated field and the target test data, and sending the feedback data packet to the client.
In one embodiment, the device further includes a data configuration module, configured to obtain Mock data stored in the designated data sharing platform; responding to configuration operation aiming at the Mock data, and determining a test data configuration file corresponding to each candidate interface; and storing each candidate interface and the test data configuration file corresponding to each candidate interface in a correlation way.
The device provided by the embodiment of the present invention has the same implementation principle and technical effects as those of the foregoing method embodiment, and for the sake of brevity, reference may be made to the corresponding content in the foregoing method embodiment where the device embodiment is not mentioned.
The embodiment of the invention provides electronic equipment, which comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method of any of the embodiments described above.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 100 includes: a processor 70, a memory 71, a bus 72 and a communication interface 73, said processor 70, communication interface 73 and memory 71 being connected by bus 72; the processor 70 is arranged to execute executable modules, such as computer programs, stored in the memory 71.
The memory 71 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the system network element and the at least one other network element is achieved via at least one communication interface 73 (which may be wired or wireless), which may use the internet, a wide area network, a local network, a metropolitan area network, etc.
Bus 72 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 7, but not only one bus or type of bus.
The memory 71 is configured to store a program, and the processor 70 executes the program after receiving an execution instruction, where the method executed by the apparatus for flow defining disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 70 or implemented by the processor 70.
The processor 70 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware or instructions in software in the processor 70. The processor 70 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal processor (Digital Signal Processing, DSP for short), application specific integrated circuit (Application Specific Integrated Circuit, ASIC for short), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA for short), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory 71 and the processor 70 reads the information in the memory 71 and in combination with its hardware performs the steps of the method described above.
The computer program product of the readable storage medium provided by the embodiment of the present invention includes a computer readable storage medium storing a program code, where the program code includes instructions for executing the method described in the foregoing method embodiment, and the specific implementation may refer to the foregoing method embodiment and will not be described herein.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. The method is applied to a client, the client is in communication connection with a local server, the local server stores a test data configuration file corresponding to the client, the test data configuration file is obtained by a client user based on Mock data configuration in a designated data sharing platform, and the method comprises the following steps:
generating a data acquisition request in response to an acquisition operation for test data;
transmitting the data acquisition request to the local server based on a pre-configured target local host file so that the local server determines target test data from the test data configuration files based on the data acquisition request, wherein the local server is configured with a plurality of candidate interfaces, each candidate interface corresponds to a test data configuration file respectively, and determining target test data from the test data configuration files based on the data acquisition request comprises: analyzing the data acquisition request to obtain a first designated field and a data description parameter contained in the data acquisition request; determining a target interface from the candidate interfaces based on the first specified field; determining target test data matched with the data description parameters from the test data configuration file corresponding to the target interface;
and receiving the target test data fed back by the local server.
2. The method of claim 1, wherein prior to the step of sending the data acquisition request to the local server based on the preconfigured destination local host file, the method further comprises:
acquiring an initial local host file stored by the client and address information corresponding to the local server; wherein the address information comprises domain name information and/or IP information of the local server;
and modifying the initial local host file based on the address information to obtain a target host file.
3. The method is applied to a local server, the local server is in communication connection with a client, the local server stores a test data configuration file corresponding to the client, the test data configuration file is obtained by a client user based on Mock data configuration in a designated data sharing platform, and the method comprises the following steps:
receiving a data acquisition request sent by the client; wherein the data acquisition request is sent to the local server by the client based on a pre-configured destination local host file;
determining target test data from the test data configuration file based on the data acquisition request;
feeding back the target test data to the client;
the step of determining target test data from the test data configuration file based on the data acquisition request comprises the following steps:
analyzing the data acquisition request to obtain a first designated field and a data description parameter contained in the data acquisition request;
determining a target interface from the candidate interfaces based on the first specified field;
and determining target test data matched with the data description parameters from the test data configuration file corresponding to the target interface.
4. A method according to claim 3, wherein the step of feeding back the target test data to the client comprises:
and generating a feedback data packet based on a second preset designated field and the target test data, and sending the feedback data packet to the client.
5. A method according to claim 3, characterized in that the method further comprises:
acquiring Mock data stored in a designated data sharing platform;
responding to configuration operation aiming at the Mock data, and determining a test data configuration file corresponding to each candidate interface;
and storing each candidate interface and the test data configuration file corresponding to each candidate interface in a correlation way.
6. The device is applied to a client, the client is in communication connection with a local server, the local server stores a test data configuration file corresponding to the client, the test data configuration file is configured by a client user based on Mock data in a designated data sharing platform, and the device comprises:
the request generation module is used for responding to the acquisition operation aiming at the test data and generating a data acquisition request;
a request interception module, configured to send the data acquisition request to the local server based on a preconfigured destination local host file, so that the local server determines target test data from the test data configuration files based on the data acquisition request, where the local server is configured with a plurality of candidate interfaces, each candidate interface corresponds to a test data configuration file, and determining, by the local server, target test data from the test data configuration files based on the data acquisition request includes: analyzing the data acquisition request to obtain a first designated field and a data description parameter contained in the data acquisition request; determining a target interface from the candidate interfaces based on the first specified field; determining target test data matched with the data description parameters from the test data configuration file corresponding to the target interface;
and the data receiving module is used for receiving the target test data fed back by the local server.
7. The device is applied to a local server, the local server is in communication connection with a client, the local server stores a test data configuration file corresponding to the client, the test data configuration file is obtained by configuring a client user based on Mock data in a designated data sharing platform, and the device comprises:
the request receiving module is used for receiving a data acquisition request sent by the client; wherein the data acquisition request is sent to the local server by the client based on a pre-configured destination local host file;
the data determining module is used for determining target test data from the test data configuration file based on the data acquisition request;
the data feedback module is used for feeding back the target test data to the client;
the local server is configured with a plurality of candidate interfaces, each candidate interface is respectively corresponding to a test data configuration file, and the data determining module is further used for: analyzing the data acquisition request to obtain a first designated field and a data description parameter contained in the data acquisition request; determining a target interface from the candidate interfaces based on the first specified field; and determining target test data matched with the data description parameters from the test data configuration file corresponding to the target interface.
8. An electronic device comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor to implement the method of any one of claims 1 to 2 or to implement the method of any one of claims 3 to 5.
9. A computer readable storage medium storing computer executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 2 or the method of any one of claims 3 to 5.
CN202210750806.7A 2022-06-28 2022-06-28 Request processing method, request processing device, electronic equipment and computer readable storage medium Active CN115208951B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210750806.7A CN115208951B (en) 2022-06-28 2022-06-28 Request processing method, request processing device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210750806.7A CN115208951B (en) 2022-06-28 2022-06-28 Request processing method, request processing device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN115208951A CN115208951A (en) 2022-10-18
CN115208951B true CN115208951B (en) 2024-03-15

Family

ID=83578701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210750806.7A Active CN115208951B (en) 2022-06-28 2022-06-28 Request processing method, request processing device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115208951B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116208529A (en) * 2022-12-05 2023-06-02 中信银行股份有限公司 HTTP transaction interface testing method and system based on offline feedback
CN117909248B (en) * 2024-03-18 2024-07-02 易方信息科技股份有限公司 Dynamic forwarding method based on interface test platform and related device
CN118041824B (en) * 2024-04-12 2024-07-23 杭州优云科技股份有限公司 Method and device for testing bypass mirror function, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368405A (en) * 2016-05-11 2017-11-21 腾讯科技(北京)有限公司 Test system, method of testing, mock platforms, blocker and client
CN107547312A (en) * 2017-09-21 2018-01-05 广州四三九九信息科技有限公司 Applied program testing method and system
CN111782535A (en) * 2020-06-30 2020-10-16 京东数字科技控股股份有限公司 Test method and device
CN112637254A (en) * 2019-09-24 2021-04-09 拉扎斯网络科技(上海)有限公司 Data processing method and device, electronic equipment and computer readable storage medium
CN114448857A (en) * 2022-01-29 2022-05-06 北京字节跳动网络技术有限公司 Method, device, storage medium and system for processing Mock service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368405A (en) * 2016-05-11 2017-11-21 腾讯科技(北京)有限公司 Test system, method of testing, mock platforms, blocker and client
CN107547312A (en) * 2017-09-21 2018-01-05 广州四三九九信息科技有限公司 Applied program testing method and system
CN112637254A (en) * 2019-09-24 2021-04-09 拉扎斯网络科技(上海)有限公司 Data processing method and device, electronic equipment and computer readable storage medium
CN111782535A (en) * 2020-06-30 2020-10-16 京东数字科技控股股份有限公司 Test method and device
CN114448857A (en) * 2022-01-29 2022-05-06 北京字节跳动网络技术有限公司 Method, device, storage medium and system for processing Mock service

Also Published As

Publication number Publication date
CN115208951A (en) 2022-10-18

Similar Documents

Publication Publication Date Title
CN115208951B (en) Request processing method, request processing device, electronic equipment and computer readable storage medium
CN107665233B (en) Database data processing method and device, computer equipment and storage medium
CN104580406B (en) A kind of method and apparatus of synchronous logging state
CN107784552B (en) Information push task execution method and device, computer equipment and storage medium
US11907700B2 (en) Upgrading method and system, server, and terminal device
CN111008211B (en) Visual interface creating method and device, readable storage medium and electronic equipment
US20140019957A1 (en) Method, apparatus, and system for sharing software among terminals
CN111193817B (en) Method and device for automatically registering equipment serial number, computer equipment and storage medium
CN106656998B (en) server communication method and device
WO2014008864A1 (en) Method, apparatus, and system for sharing software among terminals
CN110830280A (en) Micro-service gateway device and method and electronic equipment
CN105554136B (en) Backup Data restoring method, apparatus and system
CN108062714B (en) Annuity data sending method and device, computer equipment and storage medium
CN112887451A (en) Domain name resolution method and device and computer equipment
CN112866193A (en) Equipment deployment method, device, equipment and storage medium
CN108989365B (en) Information processing method, server, terminal equipment and storage medium
CN105068926A (en) Program test method and device thereof
CN109327499B (en) Service interface management method and device, storage medium and terminal
CN112052267B (en) Data query method, equipment, server and storage medium
CN113609147A (en) Data sharing method and device and electronic equipment
CN111158716B (en) Version upgrade calling method and device, computer system and readable storage medium
CN109951549B (en) Network page access method and device and computer readable storage medium
CN114915565B (en) Network debugging method and system
CN103326892B (en) The operating method and device of web interface
CN106411891B (en) File processing method and device, server and equipment

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
GR01 Patent grant
GR01 Patent grant