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

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

Info

Publication number
CN115208951A
CN115208951A CN202210750806.7A CN202210750806A CN115208951A CN 115208951 A CN115208951 A CN 115208951A CN 202210750806 A CN202210750806 A CN 202210750806A CN 115208951 A CN115208951 A CN 115208951A
Authority
CN
China
Prior art keywords
data
test data
local server
client
target
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.)
Granted
Application number
CN202210750806.7A
Other languages
Chinese (zh)
Other versions
CN115208951B (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

Images

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: responding to the acquisition operation aiming at the test data, and generating a data acquisition request; sending 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 and 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 request processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
Currently, in the process of front-end and back-end development, a Mock tool can be used for assisting in testing, constructing data and the like. In practical application, a plurality of test items can share data constructed by a Mock tool and the Mock tool, and different test items may need to modify the shared data under different test scenes with different requirements, so that when a plurality of test items need to use the same shared data, the shared data needs to be maintained again, which results in higher workload required for maintaining the data, and the situation that in the test process of a certain test item, the used shared data is modified by the staff of other test items, which results in the test failure of the item, also easily occurs, namely, the problem that the reliability of the shared data in the test process is poor.
Disclosure of Invention
In view of the above, 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 effectively improve the reliability of test data.
In a first aspect, an embodiment of the present invention provides a request processing method, where the method is applied to a client, where the client is in communication connection with a local server, and the local server stores a test data configuration file corresponding to the client, and the method includes:
responding to the acquisition operation aiming at the test data, and generating a data acquisition request;
sending 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 target 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; 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 request processing method, where the method is 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, where the method includes:
receiving a data acquisition request sent by the client; the data acquisition request is sent to the local server by the client based on a pre-configured target local host file;
determining target test data from the test data configuration file based on the data acquisition request;
and feeding back the target test data to the client.
Further, the step of determining target test data from the test data configuration file based on the data acquisition request includes:
analyzing the data acquisition request to obtain a first designated field and data description parameters 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 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 specified 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 an associated manner.
In a third aspect, an embodiment of the present invention further provides a request processing apparatus, where the apparatus is applied to a client, the client is in communication connection with a local server, and the local server stores a test data configuration file corresponding to the client, and the apparatus includes:
the request generating module is used for responding to the acquisition operation aiming at the test data and generating a data acquisition request;
the request intercepting module is used for sending 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 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, 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 the apparatus includes:
the request receiving module is used for receiving a data acquisition request sent by the 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 determination module 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 the target test data back to the client.
In a fifth aspect, the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores computer-executable instructions capable of being executed by the processor, and the processor executes the computer-executable instructions to implement the method in any one of the first aspect, or executes the computer-executable instructions to implement the method in any one of the second aspect.
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 the method of any one of the first aspect, or cause the processor to implement the method of any one of the second aspect.
The request processing method, the device, the electronic equipment and the computer readable storage medium provided by the embodiment of the invention 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 responds to the acquisition operation aiming at the test data to generate a data acquisition request, then sends the data acquisition request to the local server based on a pre-configured target local host file, so that the local server determines the target test data from the test data configuration file based on the data acquisition request, and finally receives the target test data fed back by the local server. Compared with the prior art that the common data is modified and fed back through a common Mock tool, the method 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 by data maintenance, but also can effectively improve the reliability of the test data.
The request processing method, the request processing device, the electronic equipment and the computer readable storage medium are applied to a local server, the local server is in communication connection with a client, and a test data configuration file corresponding to the client is stored in the local server. And if a 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 common data is modified and fed back through a common Mock tool, the method for testing the data of the client-side of the mobile terminal can respond to the data acquisition request sent by the client-side through the local server, and can prevent other client-sides from modifying the test data configuration file stored in the local server corresponding to the client-side through feeding back the required target test data through the local server corresponding to the client-side, thereby not only remarkably reducing the workload required by data maintenance, but also effectively improving the reliability of the test data.
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 aforementioned and other objects, features and advantages of the present invention 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 used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a request processing method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another request processing method 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 interaction diagram of a request processing method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a request processing apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic structural 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
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present 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 by marking an interface, but the same set of Mock data can be 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 conclusion, the conventional Mock tool has the problems of high data maintenance workload, poor data reliability and the like. Based on the above, the present invention provides a request processing method, an apparatus, an electronic device, and a computer-readable storage medium, which can significantly reduce the workload required for maintaining common data and effectively improve the reliability of test data.
To facilitate understanding of the present embodiment, first, a request processing method disclosed in the embodiment of the present invention is described in detail, where the method is applied to a client, where the client may include a terminal device such as a smart phone, a tablet Computer, and a PC (Personal Computer), and the client may also be referred to as a front end, the client is in communication connection with a local server, and the local server stores a test data configuration file corresponding to the client, referring to a flowchart of the request processing method shown in fig. 1, the method mainly includes the following steps S102 to S106:
step S102, in response to the acquisition operation for the test data, generates a data acquisition request. The data acquisition request carries a first designated field and data description parameters, 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 parameters are 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 by the client and a test page may be displayed by the graphical user interface where a user may configure a data acquisition request.
And step S104, sending 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 target local host file stores address information of a local server, the address information includes domain name information and/or Internet Protocol (IP) information, the test data configuration file is obtained based on Mock data in a specified data sharing platform, and the specified data sharing platform can be a public Mock platform. In practical application, if the data acquisition request is not intercepted through the host file of the specimen, the data acquisition request is sent to the public Mock platform, and the 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.
Compared with the prior art that the target test data is modified and fed back through a common Mock tool, the method for processing the request provided by the embodiment of the invention can feed 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 by data maintenance, but also can effectively improve the reliability of the test data.
In an embodiment, each local server corresponding to each client can be deployed, so that when a client performs a certain test project, required target test data can be acquired from the corresponding local server, and by customizing dedicated test data in the corresponding local server, the embodiment of the invention does not need to access a common Mock platform and modify Mock data, and can remarkably reduce the workload required for maintaining data.
In a specific implementation manner, the initial local host file stored by the client and address information corresponding to the local server may be obtained, and the initial local host file is modified based on the address information to obtain a target host file. The initial local host file stores address information of a specified data sharing platform. Optionally, the address information of the specified data sharing platform may be replaced with the address information corresponding to the local server to obtain a target host file, the data obtaining request is marked as an http server object, and before the http server object is sent to the specified data sharing platform, the http server object may be intercepted to the local server by using the target host file.
In an embodiment, after the http server sends the http server object to the local server, the local server may parse the http server object to obtain a first designated field and a data description parameter in the http server object, the local server may further determine a target interface according to the first designated field, determine target test data from a test data configuration file corresponding to the target interface according to the data description parameter, feed the target test data back to the client, and the client may execute a corresponding test item using the target test data.
In order to facilitate understanding of the foregoing embodiment, another request processing method is provided in the embodiment of the present invention, where the method is applied to a local server, and optionally, the local server may be understood as a simple server tool written by using a tool such as Python, or a simple server tool implemented by an Android/IOS mobile terminal, where the local server is in communication connection with a client, and the local server stores a test data configuration file corresponding to the client, with reference to a flowchart of another request processing method shown in fig. 2, the method mainly includes the following steps S202 to S206:
step S202, receiving a data acquisition request sent by the client. The data acquisition request is sent to the local server by the client based on a preset target local host file. In one implementation mode, a client generates a data acquisition request, the data acquisition request is sent to a specified data sharing platform, the data acquisition request is intercepted to a local server through a target host file stored in the client, the local server can receive the data acquisition request, and the data acquisition request is marked as an http server object.
Step S204, determining target test data from the test data configuration file based on the data acquisition request. In one embodiment, the http server object may be parsed to determine a target interface and data description parameters corresponding to the object, so as to determine target test data matching the data description parameters in the test data corresponding to the target interface.
And step S206, feeding the target test data back to the client. In one embodiment, after the target test data is fed back to the client, the client may execute the corresponding test item using the target test data.
Compared with the prior art in which the common data is modified and fed back through a common Mock tool, the request processing method provided by the embodiment of the invention can respond to the data acquisition request sent by the client through the local server, and can feed back the required target test data through the local server corresponding to the client, thereby avoiding other clients from modifying the test data configuration file stored in the local server corresponding to the client, not only remarkably reducing the workload required for maintaining the data, but also effectively improving the reliability of the test data.
In an embodiment, before the foregoing step S202 is executed, a test data configuration file (also referred to as a local configuration file) stored by the local server needs to be configured, specifically, mock data stored in the specified 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 the test data configuration file corresponding to each candidate interface are stored in an associated manner. In practical applications, the test data configuration file may be stored in an INI (initialization) document form, and the interface and the response (i.e., the feedback data packet) are distinguished by the designated fields. For example, taking a key as a first designated field, different key values may correspond to different interfaces; section is taken as the second designated field. In a specific implementation, the Mock data may be configured based on a specific test item, which is not limited in this embodiment of the present invention. In addition, the candidate interface, the test data configuration file and the mapping relation between the candidate interface and the test data configuration file are saved, so that the data acquisition request can be responded quickly, and the target test data can be fed back to the client efficiently.
On the basis of the foregoing embodiment, the local server provided in the embodiment of the present invention is configured with a plurality of candidate interfaces, and each candidate interface corresponds to a test data configuration file, and on this basis, the embodiment of the present invention provides an implementation manner for determining target test data from the test data configuration files based on a data acquisition request, which refers to the following steps 1 to 3:
step 1, analyzing the data acquisition request to obtain a first designated field and data description parameters contained in the data acquisition request. The first designated field can be set to be key, and different key values correspond to different candidate interfaces. For example, an embodiment of the present invention provides a code for parsing an http serverequest object, as follows:
"# obtains a data acquisition request of the client;
request_data=client_socket.recv(1024);
print("request data:",request_data);
request_lines=request_data.splitlines();
for line in request_lines:
print(line);
# parse the data for the requested message;
request_start_line=request_lines[0];
extracting target interfaces and data description parameters of the data acquisition requests;
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 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 determined as the target interface.
And 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 stored mapping relationship, optionally, the data description parameter may be a data identifier, a data function, a data type, and the like, so as to read target test data matched with the data description parameter from the test data configuration file.
For the foregoing step S206, an embodiment of the present invention further provides an implementation manner of feeding back the target test data to the client, where a feedback data packet may be generated based on the second specified field configured in advance 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 an interface and a response.
In order to facilitate understanding of the request processing method provided in the foregoing embodiment, an embodiment of the present invention provides an overall framework of the request processing method shown in fig. 3, where a front end is also the foregoing client, and an agent is also the foregoing local server, and fig. 3 illustrates that a common Mock platform is configured with Mock data in advance, and the agent may perform data interaction with the common Mock platform, and the agent acquires the Mock data stored in the common Mock platform and configures the Mock data into a test data configuration file required by a front-end test, where the test data configuration file is to be stored in the agent, the front end sends a data acquisition request to the agent, and the agent feeds back target test data according to the data acquisition request.
On the basis of the foregoing fig. 3, an interaction diagram of a request processing method as shown in fig. 4 is further provided in the embodiment of the present invention, and fig. 4 further illustrates that the common Mock platform sends Mock data to the agent, so that the agent 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, and the agent will feed back the corresponding target test data to the front-end. In another embodiment, the front end may also send a data acquisition request to the public Mock platform, and the public Mock platform modifies Mock data based on the data acquisition request to obtain target test data and feeds the target test data back to the front end.
In summary, the request processing method provided in the embodiment of the present invention can directly run the Mock tool locally through the local server, and by storing the Mock data in the local server, the Mock data can be maintained by the user at the client, and the test data required by the user is customized, which does not affect the use of other testers. In addition, the embodiment of the invention can directly run the Mock tool locally without deployment, can effectively reduce the dependence required by the Mock operation, and can start and use the Mock tool through local starting.
For the request processing method provided in the foregoing embodiment, an embodiment of the present invention provides a request processing apparatus applied to a client, where the client is in communication connection with 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 apparatus shown in fig. 5, the apparatus mainly includes the following components:
a request generating module 502, configured to generate a data obtaining request in response to a obtaining operation for test data;
the request intercepting module 504 is configured to send a data acquisition request to the local server based on a preconfigured 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 a data receiving module 506, configured to receive the target test data fed back by the local server.
Compared with the prior art in which the target test data is modified and fed back through a common Mock tool, the request processing device provided by the embodiment of the invention can feed 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 an embodiment, the apparatus 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 the 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, an embodiment of the present invention further provides a request processing apparatus, where the apparatus is 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, referring to a schematic structural diagram of the request processing apparatus shown in fig. 6, the apparatus mainly includes the following components:
a request receiving module 602, configured to receive a data obtaining request sent by a client; the data acquisition request is sent to a local server by a client based on a pre-configured target local host file;
a data determination module 604, configured to determine target test data from the test data configuration file based on the data obtaining request;
and a data feedback module 606, configured to feed target test data back to the client.
Compared with the prior art in which the common data is modified and fed back through a common Mock tool, the request processing device provided by the embodiment of the invention can respond to the data acquisition request sent by the client through the local server, and can feed back the required target test data through the local server corresponding to the client, thereby avoiding other clients from modifying the test data configuration file stored in the local server corresponding to the client, not only remarkably reducing the workload required for maintaining the data, but also effectively improving 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 determination module 604 is further configured to: analyzing the data acquisition request to obtain a first designated field and data description parameters 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 specified field configured in advance and the target test data, and sending the feedback data packet to the client.
In an embodiment, the apparatus further includes a data configuration module, configured to obtain Mock data stored in the specified data sharing platform; responding to configuration operation aiming at 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 an associated manner.
The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments.
The embodiment of the invention provides electronic equipment, which particularly 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 above described embodiments.
Fig. 7 is a schematic structural diagram of an electronic device 100 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, wherein the processor 70, the communication interface 73 and the memory 71 are connected through the 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) and may further include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 73 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used.
The bus 72 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 7, but this does not indicate only one bus or one 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 performed by the apparatus defined by the flow process 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 having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 70. The Processor 70 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed 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 directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is 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 completes the steps of the method in combination with the hardware thereof.
The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the foregoing method embodiment, which is not described herein again.
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 such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A request processing method is applied to a client, the client is in communication connection with a local server, and the local server stores a test data configuration file corresponding to the client, and the method comprises the following steps:
responding to the acquisition operation aiming at the test data, and generating a data acquisition request;
sending 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.
2. The method of claim 1, wherein prior to the step of sending the data acquisition request to the local server based on a preconfigured target 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; 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. A request processing method is 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 includes:
receiving a data acquisition request sent by the client; the data acquisition request is sent to the local server by the client based on a pre-configured target local host file;
determining target test data from the test data configuration file based on the data acquisition request;
and feeding back the target test data to the client.
4. The method of claim 3, wherein the local server is configured with a plurality of candidate interfaces, each candidate interface corresponding 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 comprises:
analyzing the data acquisition request to obtain a first designated field and data description parameters 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.
5. The method of 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 field and the target test data, and sending the feedback data packet to the client.
6. The method of claim 4, further comprising:
acquiring Mock data stored in a specified 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 an associated manner.
7. A request processing apparatus, applied to a client, the client being in communication connection with a local server, the local server storing a test data configuration file corresponding to the client, the apparatus comprising:
the request generating module is used for responding to the acquisition operation aiming at the test data and generating a data acquisition request;
the request intercepting module is used for sending 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 the data receiving module is used for receiving the target test data fed back by the local server.
8. A request processing device is 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 the request processing device comprises:
the request receiving module is used for receiving a data acquisition request sent by the 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 determination module 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 the target test data back to the client.
9. An electronic device comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor to perform the method of any of claims 1 to 2 or to perform the method of any of claims 3 to 6.
10. A computer-readable storage medium, having stored thereon computer-executable instructions, which, when invoked and executed by a processor, cause the processor to carry out the method of any one of claims 1 to 2, or cause the processor to carry out the method of any one of claims 3 to 6.
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 true CN115208951A (en) 2022-10-18
CN115208951B 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)

Cited By (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
CN117909248A (en) * 2024-03-18 2024-04-19 易方信息科技股份有限公司 Dynamic forwarding method based on interface test platform and related device
CN118041824A (en) * 2024-04-12 2024-05-14 杭州优云科技股份有限公司 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

Cited By (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
CN117909248A (en) * 2024-03-18 2024-04-19 易方信息科技股份有限公司 Dynamic forwarding method based on interface test platform and related device
CN118041824A (en) * 2024-04-12 2024-05-14 杭州优云科技股份有限公司 Method and device for testing bypass mirror function, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115208951B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
US10803274B2 (en) Computer configured to display multimedia content
CN115208951A (en) Request processing method and device, electronic equipment and computer readable storage medium
CN107784552B (en) Information push task execution method and device, computer equipment and storage medium
WO2019201039A1 (en) Method and system for updating application and application server
CN108809890B (en) Vulnerability detection method, test server and client
WO2019019361A1 (en) Method and apparatus for processing data of database, computer device, and storage medium
WO2016101635A1 (en) Method, apparatus and device for synchronizing login status, and computer storage medium
CN108255701B (en) Scene testing method and mobile terminal
CN109558199B (en) Information pushing method, device, equipment and storage medium
US20140019957A1 (en) Method, apparatus, and system for sharing software among terminals
WO2014008864A1 (en) Method, apparatus, and system for sharing software among terminals
WO2019019670A1 (en) Application accessing method and device, computer apparatus, and storage medium
CN111291292A (en) Page rendering method and device, terminal equipment and storage medium
US9781230B2 (en) Broadcast-based update management
CN111294288A (en) Traffic identification method and device, application program interface gateway and storage medium
CN112818270B (en) Data cross-domain transfer method and device and computer equipment
CN112187622B (en) Instant message display method and device and server
CN105068926A (en) Program test method and device thereof
CN109951549B (en) Network page access method and device and computer readable storage medium
CN109495319B (en) Method, device and equipment for determining fault information of CDN node
CN109067570B (en) Server information display method and device and server
CN108737350B (en) Information processing method and client
CN106411891B (en) File processing method and device, server and equipment
CN113485855B (en) Memory sharing method and device, electronic equipment and readable storage medium
CN113961162A (en) Screen projection control method, screen projection sending end, screen projection receiving end and screen projection system

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