CN108897691B - Data processing method, device, server and medium based on interface simulation service - Google Patents

Data processing method, device, server and medium based on interface simulation service Download PDF

Info

Publication number
CN108897691B
CN108897691B CN201810714121.0A CN201810714121A CN108897691B CN 108897691 B CN108897691 B CN 108897691B CN 201810714121 A CN201810714121 A CN 201810714121A CN 108897691 B CN108897691 B CN 108897691B
Authority
CN
China
Prior art keywords
matching rule
data
meta
interface
data processing
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
CN201810714121.0A
Other languages
Chinese (zh)
Other versions
CN108897691A (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.)
Baidu Online Network Technology Beijing Co Ltd
Original Assignee
Baidu Online Network Technology Beijing 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 Baidu Online Network Technology Beijing Co Ltd filed Critical Baidu Online Network Technology Beijing Co Ltd
Priority to CN201810714121.0A priority Critical patent/CN108897691B/en
Publication of CN108897691A publication Critical patent/CN108897691A/en
Application granted granted Critical
Publication of CN108897691B publication Critical patent/CN108897691B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a data processing method, a device, a server and a medium based on interface simulation service, wherein the method comprises the steps of loading a plug-in corresponding to a specified interface communication protocol according to the specified interface communication protocol; utilizing a plug-in to perform first analysis on a received interface request of the downstream service to be tested according to the setting of a specified interface communication protocol to obtain request data of a first structure; traversing at least one preset matching rule, and determining a target matching rule matched with the request data; performing data processing on the request data according to the target matching rule to obtain a data processing result; and performing second analysis on the data processing result by using the plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure, and returning the interface return data to the downstream service to be tested. The embodiment of the invention solves the problem of poor expansibility of the existing interface simulation service, and realizes the provision of the interface simulation service supporting different communication protocols in a plug-in mode.

Description

Data processing method, device, server and medium based on interface simulation service
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data processing method, a data processing device, a data processing server and a data processing medium based on interface simulation service.
Background
In the development and test processes of the web Service, interface call of the tested web Service to the upstream Service is involved, and because the upstream Service is usually developed in parallel with the tested web Service, a test environment of the upstream Service is not built yet, and in addition, a situation that the tested web Service needs to return specific upstream Service data may exist, so a simulation Service (Mock Service) is usually built in the prior art, and the upstream Service is simulated by using the simulation Service to test the tested web Service.
Since there are many communication protocols based on Socket, the upstream service can provide many different types of interfaces for the web service under test to call. However, the existing simulation service can only support one communication protocol, which limits the application of the simulation service and results in poor expandability.
Disclosure of Invention
The embodiment of the invention provides a data processing method, a data processing device, a server and a medium based on interface simulation service, and aims to solve the problem of poor expansibility of simulation service in the prior art.
In a first aspect, an embodiment of the present invention provides a data processing method based on an interface simulation service, where the method includes:
loading a plug-in corresponding to the specified interface communication protocol;
utilizing the plug-in to perform first analysis on the received interface request of the downstream service to be tested according to the setting of the specified interface communication protocol to obtain request data of a first structure;
traversing at least one preset matching rule, and determining a target matching rule matched with the request data;
performing data processing on the request data according to a target matching rule to obtain a data processing result;
and performing second analysis on the data processing result by using the plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure, and returning the interface return data to the tested downstream service.
In a second aspect, an embodiment of the present invention further provides a data processing apparatus based on an interface simulation service, where the apparatus includes:
the plug-in loading module is used for loading the plug-in corresponding to the plug-in loading module according to the specified interface communication protocol;
the first analysis module is used for carrying out first analysis on the received interface request of the tested downstream service according to the setting of the specified interface communication protocol by using the plug-in to obtain request data of a first structure;
the matching rule determining module is used for traversing at least one preset matching rule and determining a target matching rule matched with the request data;
the data processing module is used for carrying out data processing on the request data according to a target matching rule to obtain a data processing result;
and the second analysis module is used for carrying out second analysis on the data processing result by utilizing the plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure and returning the interface return data to the tested downstream service.
In a third aspect, an embodiment of the present invention further provides a server, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method based on the interface simulation service according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a data processing method based on an interface simulation service according to any embodiment of the present invention.
The embodiment of the invention firstly loads the corresponding plug-in according to the specified interface communication protocol, utilizes the plug-in to carry out first analysis on the received interface request of the downstream service to be tested according to the setting of the specified interface communication protocol to obtain the request data, then carries out data processing on the request data according to the matched target matching rule to obtain the data processing result, and finally carries out second analysis on the data processing result based on the plug-in again to obtain the interface return data and returns the interface return data to the downstream service to be tested. The embodiment of the invention solves the problem that the interface simulation service in the prior art has poor expansibility due to only supporting one communication protocol, realizes that the interface simulation service of different communication protocols based on Socket is provided in a plug-in mode, and developers only need to maintain corresponding plug-in libraries according to specific development or test scenes, thereby enriching the capacity of an interface simulation service framework, improving the expansibility of the interface simulation service and further improving the development and test efficiency of tested downstream service products.
Drawings
FIG. 1 is a flowchart of a data processing method based on interface simulation service according to an embodiment of the present invention;
FIG. 2 is a flowchart of a data processing method based on interface simulation service according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a data processing method based on interface simulation service according to a third embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a data processing apparatus based on interface emulation service according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a data processing method based on an interface simulation service according to an embodiment of the present invention, where the present embodiment is applicable to a case of data processing based on an interface simulation service, and the method may be executed by a data processing apparatus based on an interface simulation service, and the apparatus may be implemented in a software and/or hardware manner and may be integrated on a server. As shown in fig. 1, the method specifically includes:
and S110, loading the corresponding plug-in according to the specified interface communication protocol.
The plug-in this embodiment is a program that is written and encapsulated in advance by a developer according to a required development or test environment or scenario, and different communication protocols correspond to different types of plug-ins. Therefore, when data processing is performed based on the interface simulation service, the corresponding plug-in is loaded according to the interface communication protocol specified by the data processing process. In addition, different types of plug-ins can be uniformly stored in a plug-in library, and centralized management and maintenance are facilitated.
S120, the loaded plug-in is utilized to perform first analysis on the received interface request of the tested downstream service according to the setting of the specified interface communication protocol, and request data of a first structure is obtained.
After the simulation service framework receives the interface request of the downstream service to be tested, the loaded plug-in is utilized, the received interface request is automatically subjected to first analysis according to the setting of the specified interface communication protocol, and the analyzed request data can be identified and processed by the plug-in. The setting of the interface communication protocol may be understood as a data structure form and a data analysis rule corresponding to different communication protocols. The data structures of different interface communication protocols are considered to be different, so the structure of the request data obtained through the first analysis is also different.
S130, traversing at least one preset matching rule, and determining a target matching rule matched with the request data.
The matching rule is that a developer is compiled in advance with a specific test or development scene according to an interface communication protocol and stored in a configuration library in the form of a configuration file, and when data is processed, the corresponding rule is matched according to request data. The matching rules define the specific processing mode of the request data, and the information related to each matching rule can be correspondingly stored in one file. As to the traversal order of the matching rule, this embodiment is not particularly limited. Any effective traversal order can be employed while ensuring that the target matching rule for the requested data can be matched.
And S140, performing data processing on the request data according to the target matching rule to obtain a data processing result.
After the target rule is determined, data processing can be performed on the request data to obtain a processing result. The data processing mode comprises forwarding, transparent transmission and counterfeit data return.
S150, the loaded plug-in is utilized to carry out second analysis on the data processing result according to the setting of the specified interface communication protocol to obtain interface return data of a second structure, and the interface return data is returned to the tested downstream service.
And after the data processing is finished, the loaded plug-in is utilized again, and the second analysis is carried out on the data processing result according to the setting of the specified interface communication protocol to obtain interface return data and return the interface return data to the tested downstream service. In the data processing process, the request data and the interface return data correspond to data with different structures under the same communication protocol, and the data processing process is based on the requirement of the plug-in for processing the data.
It should be noted that the existing interface simulation service generally can only implement upstream service simulation based on http(s) protocol, however, in this embodiment, by combining the encapsulation idea, a pre-programmed plug-in is used to provide simulation services based on different interface communication protocols, and a developer only needs to configure and load the corresponding plug-in according to a specific development or test scenario, so as to implement function expansion of the interface simulation service, enrich the framework capability thereof, and further improve the development and test efficiency of a tested downstream service product.
Optionally, returning the interface return data of the obtained second structure to the downstream service to be tested, includes:
and returning the interface return data of the second structure to the tested downstream service according to the specified interface communication protocol.
Namely, when the simulation service is started, the corresponding plug-in is loaded according to the specified interface communication protocol, and after the data processing is finished, the processed data is returned to the tested downstream service according to the specified interface communication protocol.
Optionally, the request data of the first structure and the interface return data of the second structure are both json format data.
The json format is a data format in a key-value pair form, adopts a text format completely independent of a programming language to store and represent data, is easy to read and write by a human, and is also easy to analyze and generate by a machine. Here, in order to facilitate post-saving and analyzing the log, in this embodiment, both the request data of the first structure and the interface return data of the second structure may be set to be in a json format.
Optionally, the method further includes:
and recording an access log of each interface request of the downstream service to be tested, and displaying the access log through a web page.
The presentation of the log can be implemented based on a Redis database and a presentation Web page. The Redis database is used for storing each time of access records of the simulation service and is displayed externally through the web page, so that developers can conveniently investigate problems related to development or test scenes.
According to the technical scheme, a corresponding plug-in is loaded according to a specified interface communication protocol, the plug-in is utilized to perform first analysis on a received interface request of the downstream service to be tested according to the setting of the specified interface communication protocol to obtain request data, then the request data is subjected to data processing according to a matched target matching rule to obtain a data processing result, and finally, second analysis is performed on the data processing result based on the plug-in again to obtain interface return data, and the interface return data are returned to the downstream service to be tested. The technical scheme of the embodiment solves the problem that interface simulation services in the prior art are poor in expansibility due to the fact that only one communication protocol is supported, interface simulation services of different communication protocols based on Socket are provided in a plug-in mode, developers only need to maintain corresponding plug-in libraries according to specific development or test scenes, the capacity of an interface simulation service framework is enriched, the expansibility and the universality of the interface simulation services are improved, and further the development and test efficiency of tested downstream service products is improved.
Example two
Fig. 2 is a flowchart of a data processing method based on an interface simulation service according to a second embodiment of the present invention, which is further optimized based on the above embodiments. As shown in fig. 2, the method includes:
s210, loading the corresponding plug-in according to the specified interface communication protocol.
S220, the loaded plug-in is utilized to perform first analysis on the received interface request of the tested downstream service according to the setting of the specified interface communication protocol, and request data of a first structure is obtained.
And S230, traversing at least one preset matching rule, and determining a target matching rule matched with the request data.
S240, when the target matching rule is the forwarding rule, acquiring forwarding environment information of the upstream service from the target matching rule, and forwarding the request data to a specified environment of the upstream service according to the forwarding environment information and a specified interface communication protocol.
When the interface simulation service realizes the function of forwarding the downstream interface request to be tested, the target matching rule matched with the request data is the forwarding rule. In the forwarding process, the interface simulation service is based on the plug-in, and can forward the request data of the downstream service to be tested to the specified environment of the upstream service.
And S250, acquiring feedback data of the designated environment of the upstream service as a data processing result.
After the upstream service receives the request data of the downstream service to be tested, the request data is processed in the specified environment of the upstream service, and after the data processing is completed, operation S270 is executed to return the processing result to the downstream service to be tested by using the plug-in again.
And S260, when the target matching rule is a return forgery rule, obtaining forgery data to be returned from the target matching rule, and taking the forgery data as a data processing result.
When the target matching rule is a return fake rule, the request data of the downstream service to be detected does not need to be subjected to feedback processing according to the upstream service. And when the interface simulation service receives an interface request of the downstream service to be tested, acquiring forged data from a preset return forged rule through data analysis, and returning the forged data to the downstream service to be tested. The fake data can be return data predefined by a developer according to the development needs of the tested downstream service, an application scenario or a test environment and an interface communication protocol. In the prior art, environment codes are usually modified manually, and fake data are forged directly at a code level to support the development or testing of products, whereas the returned fake data in the embodiment are data which are configured in the process of predefining matching rules, and manual fake data input is not needed in the product development or testing process.
The following illustrates the main contents of the matching rule profile: illustratively, the main contents of the matching rule profile may include: the function specification of the matching rule, the first specific field of the matching rule, the data processing mode corresponding to the matching rule, the data processing information and other contents. Wherein the content of the first specific field is related to the content of the requested data; the data processing mode comprises forwarding, transparent transmission and counterfeit data return; the data processing information comprises the interface communication protocol type of the upstream service, the environment Host, an interface (Port) and other related data.
For example, when the data processing mode corresponding to the process field in the matching rule configuration file is forwarding (dispatch), that is, the target matching rule is a forwarding rule, the data processing information corresponding to the info field in the matching rule configuration file may include two fields, namely, an environment Host and an environment Port of the upstream service, indicating that the interface simulation service forwards the request data to the address information of the upstream service.
When the data processing mode corresponding to the process field in the matching rule configuration file is to return fake data (fake), that is, the target matching rule is a fake returning rule, the data processing information corresponding to the info field in the matching rule configuration file may include predefined fake data.
After the target matching rule is determined, the next operation can be performed on the request data by using the data processing mode and the processing information corresponding to the target matching rule.
And S270, carrying out second analysis on the data processing result by utilizing the loaded plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure, and returning the interface return data to the tested downstream service.
Optionally, in the process of traversing at least one pre-configured matching rule and determining a target matching rule matched with the request data, if the target matching rule is not matched, the request data is transparently transmitted to a default environment of an upstream service according to a specified interface communication protocol;
and acquiring feedback data of the default environment of the upstream service as a data processing result.
And when the corresponding rule is not matched, the simulation interface service transparently transmits the request data of the downstream service to be tested to the default environment of the upstream service for processing according to the interface communication protocol. The difference between the transparent transmission and forwarding functions realized by the interface simulation service is as follows: forwarding is sending the requested data to the specified context of the upstream service, and pass-through is sending the requested data to the default context of the upstream service. The problem that the upstream service test data is difficult to construct can be solved by transmitting the request data to the real test environment of the upstream service through transparent transmission.
The following takes an example of a plug-in for an interface emulation service to support http communication protocol:
(1) resolution of interface requests for downstream services
Ginseng introduction: acquiring an interface request through Socket;
and (3) treatment: analyzing the interface request into request data in a json format of an A structure according to an http protocol;
and returning: request data in json format of a structure is returned.
(2) Replay of interface requests for downstream services
Ginseng introduction: request data (data after the interface request is analyzed) in the structure json format of A, and specified environment information (Host and Port) of the requested upstream service;
and (3) treatment: generating an http request by using the request data of the json format of the structure A and the requested environment information, executing playback, and organizing the interface return information into a data processing result of the json format of the structure B;
and returning: and returning the data processing result of the structure B in the json format (the interface requests to return the analyzed data to the interface after being replayed to the upstream service specified environment).
(3) Spurious data return for interface requests of downstream services
Ginseng introduction: request data (data after the interface request is analyzed) in the structure json format of A, and default environment information (Host and Port) of the requested upstream service;
and (3) treatment: and generating and executing http response according to the http protocol by using the Json format data of the B structure.
And returning: True/False (whether the fake return was successful).
In the prior art, multiple sets of environments of connected upstream services are usually switched manually to support joint calling of different analog service functions, but in the embodiment, plug-ins correspond to specified interface communication protocols one to one, different plug-ins are loaded according to different interface communication protocols, and then the plug-ins are connected to different environments of the upstream services, and manual switching of the upstream service environments is not needed.
It should be noted that the existing simulation services mainly include: nginx reverse proxy server, mockjs server, rap server, and mockserver server. The nginx reverse proxy server only supports an http protocol, cannot expand a communication protocol, only supports the uri-dimensional flow forwarding setting, and does not support the upstream service interface to return data simulation; the mockjs server, the rap server and the mockserver server only support an http protocol, cannot expand a communication protocol, and do not support automatic analysis based on interface request data and routing in an upstream service specific environment. However, the technical solution of the embodiment supports the developer to implement the simulation of the interface service based on the Socket's customized communication protocol in a plug-in manner, and is not limited to the simulation service of a single communication protocol, and the simulation service can implement the routing of the upstream service specific environment (default environment and specified environment) and the simulation of the interface return data, and the like at the same time.
Optionally, the method further includes: if the data processing is abnormal, the alarm is given at least by a short message, a mail or a telephone. For example, if the interface simulation service has a bug (bug), the interface simulation service can give an alarm to a developer or an administrator through at least one of a short message, a mail and a telephone, so that the developer or the administrator can master the operation condition of the interface service framework in time, and the development or the test of the tested downstream service product can be ensured to be normally performed.
The technical scheme of the embodiment is that an interface simulation service framework based on a plug-in is provided, after the interface simulation service is started, the plug-in corresponding to a specified interface communication protocol is loaded, the plug-in is utilized to analyze, replay (forward) or forge and return the interface request, when a matching rule does not exist, the plug-in is utilized to transmit the interface request, the problem that the interface simulation service in the prior art is poor in expansibility due to only supporting one communication protocol is solved, the interface simulation service capable of providing different communication protocols based on Socket is realized, the simulation of the routing of an upstream service specific environment and the data returned by the interface can be realized simultaneously, in addition, developers only need to maintain a corresponding plug-in library according to specific development and test scenes, and the manual input of forged data and the switching of different environments of the upstream service are not needed, the capability of an interface simulation service framework is enriched, the expansibility and the universality of the interface simulation service are improved, and the development and test efficiency of a tested downstream service product can be improved.
EXAMPLE III
Fig. 3 is a flowchart of a data processing method based on an interface simulation service according to a third embodiment of the present invention, which is further optimized based on the foregoing embodiments. As shown in fig. 3, the method includes:
s310, loading the corresponding plug-in according to the specified interface communication protocol.
S320, carrying out first analysis on the received interface request of the downstream service to be detected according to the setting of the specified interface communication protocol by using the loaded plug-in, and obtaining request data of a first structure, wherein the interface request carries the identification information of the upstream service.
The identification information of the upstream service is used to load a meta-information profile of the upstream service.
S330, loading a meta-information configuration file corresponding to the upstream service according to the identification information of the upstream service.
The configuration library of the interface simulation service stores not only the matching rules of data processing, but also the meta-information of the upstream service, and the meta-information of one upstream service can be stored in one file. Illustratively, the content of the configuration file for storing meta information of the upstream service mainly includes: an upstream service name, an upstream service environment Host, an upstream service environment interface (Port), and a second specific field (data) pointing to a relative path of a file for the plurality of matching rules, wherein the upstream service environment includes a default environment and a specified environment.
When the interface simulation service receives an interface request of the downstream service to be tested, the interface simulation service carries out first analysis on the interface request and judges whether a simulation service configuration library is loaded in a memory or not. And if the simulation service configuration library is judged not to be loaded in the memory, loading the information of all the meta-information configuration files in the configuration library into the memory.
S340, loading at least one preset matching rule according to a second specific field in the meta-information configuration file, wherein the second specific field is used for pointing to an acquisition path of the matching rule.
After the information of all the meta-information configuration files is loaded into the memory, the interface simulation service may load the information of the corresponding matching rule configuration file into the memory according to the second specific field in each meta-information configuration file, so as to traverse all the matching rules in the subsequent process.
S350, traversing a first specific field of at least one preset matching rule, and judging whether the value of the first specific field is a sub-dictionary requesting data, wherein the first specific field is used for defining information which is required to be carried by the matching rule according to the setting of the interface communication protocol.
The interface simulation service acquires the latest configuration from the simulation service configuration library in a hot loading mode, wherein the configuration comprises a matching rule configuration file and a meta information configuration file. After confirming that the hot loading of the configuration is completed, a first specific field (for example, a pattern field) of all the matching rules is traversed, and whether the value of the first specific field is a sub-dictionary of the requested data or not is judged, wherein the first specific field exists in a form of a key-value pair. Wherein, the definition of the sub-dictionary is: if all the keys in the field A exist in the field B and the value corresponding to each key in the field A is equal to the value corresponding to the corresponding key in the field B, the field A is a sub-dictionary of the field B. That is, if all keys in the first specific field of the matching rule are present in the requested data and the value corresponding to each key in the first specific field of the matching rule is equal to the value corresponding to the key corresponding to the requested data, then the first specific field of the matching rule is a sub-dictionary of the requested data. Wherein the value corresponding to each key in the first specific field of the matching rule may also be in the form of a nested key-value pair.
And S360, if the first specific field is judged to be the sub-dictionary of the request data, stopping traversing, and determining the current matching rule as the target matching rule matched with the request data.
And in the process of judging whether the value of the first specific field of the matching rule is the sub-dictionary of the request data or not, once matching occurs, exiting the traversal of the matching rule, and performing the next operation by using the data processing mode and the processing information corresponding to the matching rule.
And S370, performing data processing on the request data according to the target matching rule to obtain a data processing result.
And S380, carrying out second analysis on the data processing result by utilizing the loaded plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure, and returning the interface return data to the tested downstream service.
On the basis of the above technical solution, optionally, loading the meta information configuration file corresponding to the upstream service according to the identification information of the upstream service includes:
loading a meta-information configuration file corresponding to the upstream service from a configuration library to a memory according to the identification information of the upstream service, wherein the configuration library is used for storing all pre-configured meta-information configuration files and recording first updating time information of each meta-information configuration file;
correspondingly, the method further comprises the following steps:
recording second updating time information of the loaded meta-information configuration file in the memory;
and if the meta-information configuration file corresponding to the upstream service is loaded in the memory, comparing the first update time information with the second update time information, adding or deleting the meta-information configuration file corresponding to the upstream service loaded in the memory according to the comparison result, and updating the matching rule corresponding to the meta-information configuration file.
Considering that the interface simulation service obtains the latest configuration from the simulation service configuration library by means of hot loading, the update time of all configuration files also needs to be maintained. The interface emulation service maintains the latest update times of all the meta-information profiles in memory while loading the meta-information profiles of the upstream services. If the simulation service configuration library is loaded in the memory, the latest updating time of all the meta-information configuration files of the simulation service configuration library is firstly obtained and compared with the latest updating time of the meta-information configuration files loaded in the memory.
And if the condition that the meta-information configuration file is added or deleted in the simulation service configuration library is found, adding or deleting the corresponding file in the memory, and performing the same processing on the matching rule configuration file corresponding to the second specific field in the meta-information configuration file.
And if the latest updating time of the meta-information configuration file is changed, reloading the information of the meta-information configuration file to the memory, and updating the latest updating time of the file maintained in the memory.
By maintaining the update time of the configuration file, the simulation service configuration library can be kept consistent with the configuration file loaded in the memory, and the latest updated configuration file is used.
Optionally, the method further includes:
and checking the target meta-information configuration file configured in the configuration library.
Optionally, the verifying the target meta information configuration file configured in the configuration library includes:
and prompting to prohibit inputting the target meta-information configuration file if the file name of the target meta-information configuration file is overlapped with the file names of other configured meta-information configuration files in the configuration library, or if the field value of the first specific field of any matching rule corresponding to the target meta-information configuration file is a sub-dictionary of a certain matching rule corresponding to other meta-information configuration files.
The verification of the target meta-information configuration file is realized by judging whether the file name in the meta-information configuration file exists and whether the field value of the first specific field of the matching rule in the corresponding matching rule configuration file is the sub-dictionary of other matching rules, so that the condition that a plurality of matching rules are matched by the same request data of the tested downstream service can be avoided.
According to the technical scheme of the embodiment, firstly, a loaded plug-in corresponding to an interface communication protocol is utilized to analyze an interface request of a downstream service to be tested to obtain request data, then, a meta-information configuration file corresponding to the upstream service is loaded according to identification information of the upstream service, secondly, at least one preset matching rule is loaded according to a second specific field in the meta-information configuration file, and finally, whether the value of the first specific field is a sub-dictionary of the request data or not is judged by traversing the first specific field of the at least one preset matching rule, so that a target matching rule is determined, and then the request data is processed and returned to the downstream service. The technical scheme of the embodiment solves the problem that interface simulation service in the prior art is poor in expansibility due to the fact that only one communication protocol is supported, interface simulation service of different communication protocols based on Socket is provided in a plug-in mode, developers only need to maintain and update corresponding plug-in libraries according to specific development or test scenes, the capacity of an interface simulation service framework is enriched, the expansibility and the universality of the interface simulation service are improved, and further the development and test efficiency of tested downstream service products is improved; in addition, the consistency between the simulation service configuration library and the configuration file loaded in the memory is ensured by maintaining and comparing the updating time of the configuration file; the verification of the meta-information configuration file configured in the configuration library avoids the condition that the same request data of the tested downstream service matches a plurality of matching rules.
Example four
Fig. 4 is a schematic structural diagram of a data processing apparatus based on an interface simulation service according to a fourth embodiment of the present invention, which is applicable to a data processing situation based on the interface simulation service. The device can be realized in a software and/or hardware mode and can be configured on the server. The data processing device based on the interface simulation service provided by the embodiment of the invention can execute the data processing method based on the interface simulation service provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
As shown in fig. 4, the apparatus includes a plug-in loading module 410, a first parsing module 420, a matching rule determining module 430, a data processing module 440, and a second parsing module 450, wherein:
the plug-in loading module 410 is used for loading a plug-in corresponding to the plug-in according to a specified interface communication protocol;
the first analysis module 420 is configured to perform, by using the loaded plug-in, first analysis on the received interface request of the detected downstream service according to the setting of the specified interface communication protocol, so as to obtain request data of a first structure;
a matching rule determining module 430, configured to traverse at least one pre-configured matching rule, and determine a target matching rule matching the request data therein;
the data processing module 440 is configured to perform data processing on the request data according to the target matching rule to obtain a data processing result;
the second parsing module 450 is configured to perform second parsing on the data processing result according to the setting of the specified interface communication protocol by using the loaded plug-in, obtain interface return data of the second structure, and return the interface return data to the downstream service to be tested.
Optionally, the matching rule determining module 430 includes a judging unit and a target matching rule determining unit, where:
the judging unit is used for traversing a first specific field of at least one preset matching rule and judging whether the value of the first specific field is a sub-dictionary requesting data or not, wherein the first specific field is used for defining information which is required to be carried by the matching rule according to the setting of an interface communication protocol;
and the target matching rule determining unit is used for stopping traversing if the first specific field is judged to be the sub-dictionary of the request data, and determining the current matching rule as the target matching rule matched with the request data.
Optionally, the target matching rule in the matching rule determining module 430 is a forwarding rule;
correspondingly, the data processing module 440 includes a forwarding unit and a specified environment feedback data obtaining unit, where:
the forwarding unit is used for acquiring forwarding environment information of the upstream service from the target matching rule and forwarding the request data to the specified environment of the upstream service according to the forwarding environment information and the specified interface communication protocol;
and the specified environment feedback data acquisition unit is used for acquiring feedback data of the specified environment of the upstream service as a data processing result.
Optionally, the target matching rule in the matching rule determining module 430 is a return forgery rule;
correspondingly, the data processing module 440 is specifically configured to:
and acquiring the forged data to be returned from the target matching rule, and taking the forged data as a data processing result.
Optionally, the apparatus further includes a transparent transmission module and a default environment feedback data acquisition module, wherein:
the transparent transmission module is used for transmitting the request data to a default environment of the upstream service according to a specified interface communication protocol if the target matching rule is not matched;
and the default environment feedback data acquisition module is used for acquiring the feedback data of the default environment of the upstream service as a data processing result.
Optionally, the second parsing module 450 includes an interface return data obtaining unit and a data returning unit, where:
the interface return data acquisition unit is used for carrying out second analysis on the data processing result by utilizing the loaded plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure;
and the data return unit is used for returning the interface return data of the second structure to the tested downstream service according to the specified interface communication protocol.
Optionally, the request data of the first structure in the first parsing module 420 and the interface return data of the second structure in the second parsing module 450 are both json format data.
On the basis of the above technical solution, optionally, the interface request received in the first parsing module 420 carries identification information of an upstream service;
correspondingly, the device also comprises:
the meta-information configuration file loading module is used for loading a meta-information configuration file corresponding to the upstream service according to the identification information of the upstream service;
and the matching rule loading module is used for loading at least one pre-configured matching rule according to a second specific field in the meta-information configuration file, wherein the second specific field is used for pointing to an acquisition path of the matching rule.
Optionally, the meta-information configuration file loading module is specifically configured to:
loading a meta-information configuration file corresponding to the upstream service from a configuration library to a memory according to the identification information of the upstream service, wherein the configuration library is used for storing all pre-configured meta-information configuration files and recording first updating time information of each meta-information configuration file;
correspondingly, the device also comprises:
the updating time recording module is used for recording second updating time information of the loaded meta-information configuration file in the memory;
and the update time comparison module is used for comparing the first update time information with the second update time information if the meta-information configuration file corresponding to the upstream service is loaded in the memory, adding or deleting the meta-information configuration file corresponding to the upstream service loaded in the memory according to the comparison result, and updating the matching rule corresponding to the meta-information configuration file.
On the basis of the above technical solution, optionally, the apparatus further includes:
and the verification module is used for verifying the target meta-information configuration file configured in the configuration library.
Optionally, the verification module is specifically configured to:
and prompting to prohibit inputting the target meta-information configuration file if the file name of the target meta-information configuration file is overlapped with the file names of other configured meta-information configuration files in the configuration library, or if the field value of the first specific field of any matching rule corresponding to the target meta-information configuration file is a sub-dictionary of a certain matching rule corresponding to other meta-information configuration files.
Optionally, the apparatus further comprises:
and the alarm module is used for alarming at least in a short message, mail or telephone mode if the data processing is abnormal.
Optionally, the apparatus further comprises:
and the log display module is used for recording the access log of each interface request of the downstream service to be tested and displaying the access log through a web page.
According to the technical scheme, a corresponding plug-in is loaded according to a specified interface communication protocol, the plug-in is utilized to perform first analysis on a received interface request of the downstream service to be tested according to the setting of the specified interface communication protocol to obtain request data, then the request data is subjected to data processing according to a matched target matching rule to obtain a data processing result, and finally, second analysis is performed on the data processing result based on the plug-in again to obtain interface return data, and the interface return data is returned to the downstream service to be tested. The technical scheme of the embodiment solves the problem that interface simulation service in the prior art is poor in expansibility due to the fact that only one communication protocol is supported, interface simulation service based on different communication protocols of Socket is provided in a plug-in mode, expansibility of the interface simulation service is improved, and development and test efficiency of products is improved.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a server according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary server 512 suitable for use in implementing embodiments of the present invention. The server 512 shown in fig. 5 is only an example and should not bring any limitations to the function and scope of the use of the embodiments of the present invention.
As shown in FIG. 5, the server 512 is in the form of a general purpose server. Components of server 512 may include, but are not limited to: one or more processors 516, a storage device 528, and a bus 518 that couples the various system components including the storage device 528 and the processors 516.
Bus 518 represents one or more of any of several types of bus structures, including a memory device bus or memory device controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The server 512 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by server 512 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 528 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 530 and/or cache Memory 532. The server 512 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 534 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk such as a Compact disk Read-Only Memory (CD-ROM), Digital Video disk Read-Only Memory (DVD-ROM) or other optical media may be provided. In these cases, each drive may be connected to bus 518 through one or more data media interfaces. Storage 528 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 540 having a set (at least one) of program modules 542 may be stored, for example, in storage 528, such program modules 542 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may include an implementation of a network environment. The program modules 542 generally perform the functions and/or methods of the described embodiments of the invention.
The server 512 may also communicate with one or more external devices 514 (e.g., keyboard, pointing terminal, display 524, etc.), with one or more terminals that enable a user to interact with the server 512, and/or with any terminals (e.g., network card, modem, etc.) that enable the server 512 to communicate with one or more other computing terminals. Such communication may occur via input/output (I/O) interfaces 522. Further, server 512 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network such as the Internet) via Network adapter 520. As shown in FIG. 5, the network adapter 520 communicates with the other modules of the server 512 via the bus 518. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the server 512, including but not limited to: microcode, end drives, Redundant processors, external disk drive Arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems, among others.
The processor 516 executes programs stored in the storage device 528 to execute various functional applications and data processing, for example, implement a data processing method based on an interface simulation service provided by any embodiment of the present invention, and the method may include:
loading a plug-in corresponding to the specified interface communication protocol;
utilizing the plug-in to perform first analysis on the received interface request of the downstream service to be tested according to the setting of the specified interface communication protocol to obtain request data of a first structure;
traversing at least one preset matching rule, and determining a target matching rule matched with the request data;
performing data processing on the request data according to a target matching rule to obtain a data processing result;
and performing second analysis on the data processing result by using the plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure, and returning the interface return data to the tested downstream service.
EXAMPLE six
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a data processing method based on an interface simulation service, where the method includes:
loading a plug-in corresponding to the specified interface communication protocol;
utilizing the plug-in to perform first analysis on the received interface request of the downstream service to be tested according to the setting of the specified interface communication protocol to obtain request data of a first structure;
traversing at least one preset matching rule, and determining a target matching rule matched with the request data;
performing data processing on the request data according to a target matching rule to obtain a data processing result;
and performing second analysis on the data processing result by using the plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure, and returning the interface return data to the tested downstream service.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or terminal. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (26)

1. A data processing method based on interface simulation service is characterized by comprising the following steps:
loading a plug-in corresponding to the specified interface communication protocol;
utilizing the plug-in to perform first analysis on the received interface request of the downstream service to be tested according to the setting of the specified interface communication protocol to obtain request data of a first structure;
traversing at least one preset matching rule, and determining a target matching rule matched with the request data;
performing data processing on the request data according to a target matching rule to obtain a data processing result;
and performing second analysis on the data processing result by using the plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure, and returning the interface return data to the tested downstream service according to the specified interface communication protocol.
2. The method of claim 1, wherein traversing at least one pre-configured matching rule to determine a target matching rule matching the requested data comprises:
traversing a first specific field of at least one preset matching rule, and judging whether the value of the first specific field is a sub-dictionary of the request data, wherein the first specific field is used for defining information required to be carried by the matching rule according to the setting of an interface communication protocol;
and if the first specific field is judged to be the sub-dictionary of the request data, stopping traversing, and determining the current matching rule as the target matching rule matched with the request data.
3. The method of claim 1, wherein the target matching rule is a forwarding rule;
correspondingly, the data processing is performed on the request data according to the target matching rule to obtain a data processing result, and the data processing result comprises the following steps:
acquiring forwarding environment information of an upstream service from a target matching rule, and forwarding the request data to a specified environment of the upstream service according to the forwarding environment information and the specified interface communication protocol;
and acquiring feedback data of the designated environment of the upstream service as the data processing result.
4. The method of claim 1, wherein the target matching rule is a return forgery rule;
correspondingly, the data processing is performed on the request data according to the target matching rule to obtain a data processing result, and the data processing result comprises the following steps:
and acquiring the forged data to be returned from the target matching rule, and taking the forged data as the data processing result.
5. The method according to claim 1, wherein in the process of traversing at least one pre-configured matching rule and determining a target matching rule matching the request data, if no target matching rule is matched, the request data is transmitted to a default environment of an upstream service according to the specified interface communication protocol;
and acquiring feedback data of the default environment of the upstream service as the data processing result.
6. The method of claim 1, wherein the interface request carries identification information of an upstream service;
accordingly, before traversing the at least one pre-configured matching rule to determine the target matching rule matching the requested data, the method further comprises:
loading a meta-information configuration file corresponding to the upstream service according to the identification information of the upstream service;
and loading at least one preset matching rule according to a second specific field in the meta-information configuration file, wherein the second specific field is used for pointing to an acquisition path of the matching rule.
7. The method of claim 6, wherein loading a meta-information profile corresponding to the upstream service comprises:
loading a meta-information configuration file corresponding to the upstream service from a configuration library to a memory, wherein the configuration library is used for storing all pre-configured meta-information configuration files and recording first updating time information of each meta-information configuration file;
correspondingly, the method further comprises the following steps:
recording second updating time information of the loaded meta-information configuration file in the memory;
and if the meta-information configuration file corresponding to the upstream service is loaded in the memory, comparing the first update time information with the second update time information, adding or deleting the meta-information configuration file corresponding to the upstream service loaded in the memory according to the comparison result, and updating the matching rule corresponding to the meta-information configuration file.
8. The method of claim 7, further comprising:
and checking the target meta-information configuration file configured in the configuration library.
9. The method of claim 8, wherein verifying the target meta-information configuration file configured in the configuration repository comprises:
and prompting to prohibit inputting the target meta-information configuration file if the file name of the target meta-information configuration file is overlapped with the file names of other configured meta-information configuration files in the configuration library, or if the field value of the first specific field of any matching rule corresponding to the target meta-information configuration file is a sub-dictionary of a certain matching rule corresponding to other meta-information configuration files.
10. The method of any one of claims 1 to 9, further comprising:
if the data processing is abnormal, the alarm is given at least by a short message, a mail or a telephone.
11. The method of claim 10, wherein the request data of the first structure and the interface return data of the second structure are both json format data.
12. The method of claim 10, further comprising:
and recording an access log of each interface request of the downstream service to be tested, and displaying the access log through a web page.
13. A data processing apparatus based on an interface emulation service, comprising:
the plug-in loading module is used for loading the plug-in corresponding to the plug-in loading module according to the specified interface communication protocol;
the first analysis module is used for carrying out first analysis on the received interface request of the tested downstream service according to the setting of the specified interface communication protocol by using the plug-in to obtain request data of a first structure;
the matching rule determining module is used for traversing at least one preset matching rule and determining a target matching rule matched with the request data;
the data processing module is used for carrying out data processing on the request data according to a target matching rule to obtain a data processing result;
and the second analysis module is used for performing second analysis on the data processing result by utilizing the plug-in according to the setting of the specified interface communication protocol to obtain interface return data of a second structure, and returning the interface return data to the tested downstream service according to the specified interface communication protocol.
14. The apparatus of claim 13, wherein the matching rule determining module comprises:
the judging unit is used for traversing a first specific field of at least one preset matching rule and judging whether the value of the first specific field is a sub-dictionary of the request data, wherein the first specific field is used for defining information which is required to be carried by the matching rule according to the setting of an interface communication protocol;
and the target matching rule determining unit is used for stopping traversal if the first specific field is judged to be the sub-dictionary of the request data, and determining the current matching rule as the target matching rule matched with the request data.
15. The apparatus of claim 13, wherein the target matching rule in the matching rule determination module is a forwarding rule;
correspondingly, the data processing module comprises:
a forwarding unit, configured to obtain forwarding environment information of an upstream service from a target matching rule, and forward the request data to a specified environment of the upstream service according to the forwarding environment information and the specified interface communication protocol;
and the specified environment feedback data acquisition unit is used for acquiring feedback data of the specified environment of the upstream service and taking the feedback data as the data processing result.
16. The apparatus of claim 13, wherein the target matching rule in the matching rule determination module is a return forgery rule;
correspondingly, the data processing module is specifically configured to:
and acquiring the forged data to be returned from the target matching rule, and taking the forged data as the data processing result.
17. The apparatus of claim 13, further comprising:
the transparent transmission module is used for transmitting the request data to a default environment of an upstream service according to the specified interface communication protocol if the target matching rule is not matched;
and the default environment feedback data acquisition module is used for acquiring the feedback data of the default environment of the upstream service as the data processing result.
18. The apparatus according to claim 13, wherein the interface request received in the first parsing module carries identification information of an upstream service;
correspondingly, the device further comprises:
the meta-information configuration file loading module is used for loading a meta-information configuration file corresponding to the upstream service according to the identification information of the upstream service;
and the matching rule loading module is used for loading at least one pre-configured matching rule according to a second specific field in the meta-information configuration file, wherein the second specific field is used for pointing to an acquisition path of the matching rule.
19. The apparatus according to claim 18, wherein the meta information profile loading unit is specifically configured to:
loading a meta-information configuration file corresponding to the upstream service from a configuration library to a memory according to the identification information of the upstream service, wherein the configuration library is used for storing all pre-configured meta-information configuration files and recording first updating time information of each meta-information configuration file;
correspondingly, the device further comprises:
the updating time recording module is used for recording second updating time information of the loaded meta-information configuration file in the memory;
and the update time comparison module is used for comparing the first update time information with the second update time information if the meta information configuration file corresponding to the upstream service is loaded in the memory, adding or deleting the meta information configuration file corresponding to the upstream service loaded in the memory according to the comparison result, and updating the matching rule corresponding to the meta information configuration file.
20. The apparatus of claim 19, further comprising:
and the verification module is used for verifying the target meta-information configuration file configured in the configuration library.
21. The apparatus of claim 20, wherein the verification module is specifically configured to:
and prompting to prohibit inputting the target meta-information configuration file if the file name of the target meta-information configuration file is overlapped with the file names of other configured meta-information configuration files in the configuration library, or if the field value of the first specific field of any matching rule corresponding to the target meta-information configuration file is a sub-dictionary of a certain matching rule corresponding to other meta-information configuration files.
22. The apparatus of any one of claims 13 to 21, further comprising:
and the alarm module is used for alarming at least in a short message, mail or telephone mode if the data processing is abnormal.
23. The apparatus of claim 22, wherein the request data of the first structure in the first parsing module and the interface return data of the second structure in the second parsing module are both json format data.
24. The apparatus of claim 23, further comprising:
and the log display module is used for recording the access log of each interface request of the downstream service to be tested and displaying the access log through a web page.
25. A server, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of data processing based on an interface emulation service as claimed in any one of claims 1 to 12.
26. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the data processing method based on the interface emulation service according to any one of claims 1 to 12.
CN201810714121.0A 2018-06-29 2018-06-29 Data processing method, device, server and medium based on interface simulation service Active CN108897691B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810714121.0A CN108897691B (en) 2018-06-29 2018-06-29 Data processing method, device, server and medium based on interface simulation service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810714121.0A CN108897691B (en) 2018-06-29 2018-06-29 Data processing method, device, server and medium based on interface simulation service

Publications (2)

Publication Number Publication Date
CN108897691A CN108897691A (en) 2018-11-27
CN108897691B true CN108897691B (en) 2022-02-15

Family

ID=64347833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810714121.0A Active CN108897691B (en) 2018-06-29 2018-06-29 Data processing method, device, server and medium based on interface simulation service

Country Status (1)

Country Link
CN (1) CN108897691B (en)

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382057B (en) * 2018-12-29 2024-02-02 北京字节跳动网络技术有限公司 Test case generation method, test method and device, server and storage medium
CN111382056B (en) * 2018-12-29 2024-02-02 北京字节跳动网络技术有限公司 Service testing method and device, server and storage medium
CN109857656A (en) * 2019-01-18 2019-06-07 深圳壹账通智能科技有限公司 Adaptation method, device, computer equipment and storage medium based on test
CN110309058A (en) * 2019-05-24 2019-10-08 平安银行股份有限公司 Business end test method, device, computer installation and computer storage medium
CN110196809B (en) * 2019-05-30 2023-10-24 贝壳找房(北京)科技有限公司 Interface testing method and device
CN110278272B (en) * 2019-06-24 2022-04-15 四川新网银行股份有限公司 Universal method for simulating Socket request
CN110287039A (en) * 2019-06-26 2019-09-27 网易无尾熊(杭州)科技有限公司 Analog interface configuration method, medium, device and calculating equipment
CN110120917B (en) * 2019-06-28 2024-02-02 北京瑛菲网络科技有限公司 Routing method and device based on content
CN112688793B (en) * 2019-10-18 2023-01-03 北京字节跳动网络技术有限公司 Data packet obtaining method and device and electronic equipment
CN110825453B (en) * 2019-10-25 2023-12-05 中盈优创资讯科技有限公司 Data processing method and device based on big data platform
CN111143224A (en) * 2019-12-30 2020-05-12 广州酷狗计算机科技有限公司 Pile service implementation method, device, equipment and computer storage medium
CN111858083B (en) * 2019-12-30 2024-05-14 北京嘀嘀无限科技发展有限公司 Remote service calling method and device, electronic equipment and storage medium
CN111309498B (en) * 2020-02-13 2023-09-15 山东汇贸电子口岸有限公司 Request processing method, apparatus and computer readable medium
CN111385147B (en) * 2020-03-06 2021-07-27 腾讯科技(深圳)有限公司 Fault simulation method, device and computer readable storage medium
CN111797013A (en) * 2020-06-29 2020-10-20 北京字节跳动网络技术有限公司 Interface detection tool generation method, interface detection method, device, equipment and medium
CN112351059B (en) * 2020-07-30 2021-09-10 中兴通讯股份有限公司 Request processing method and device, electronic equipment and computer-readable storage medium
CN112073420B (en) * 2020-09-11 2023-07-04 杭州安恒信息技术股份有限公司 Network protocol analysis method, device and related equipment
CN112181519A (en) * 2020-09-25 2021-01-05 中国建设银行股份有限公司 Data processing method, device, equipment and storage medium
CN112383434B (en) * 2020-11-17 2023-08-08 Oppo广东移动通信有限公司 Interface simulation method and device for network request, electronic equipment and storage medium
CN112597000B (en) * 2020-12-09 2023-10-03 浪潮通用软件有限公司 Instant messaging software automatic test method based on WebScokey protocol
CN112651367A (en) * 2020-12-30 2021-04-13 深圳市计通智能技术有限公司 Method for intelligently monitoring multi-dimensional aviation display screen
CN113328913B (en) * 2021-05-31 2022-11-18 长沙市到家悠享家政服务有限公司 Method, device and system for improving project testing efficiency
CN113726579A (en) * 2021-09-02 2021-11-30 国网信息通信产业集团有限公司 Method and device for realizing power Internet of things communication protocol plug-in
CN114567621B (en) * 2022-04-29 2022-07-12 成都瑞华康源科技有限公司 Client-side adaptive response content control system, method and storage medium
CN114780265A (en) * 2022-05-18 2022-07-22 壹沓科技(上海)有限公司 Cross-system service calling method, device and related equipment based on DSL

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103023708A (en) * 2011-09-20 2013-04-03 腾讯科技(深圳)有限公司 Method and system for testing communication protocol interface
CN106528400A (en) * 2016-09-22 2017-03-22 深圳峰创智诚科技有限公司 MOCK testing method and device
CN106603283A (en) * 2016-12-13 2017-04-26 广州唯品会信息科技有限公司 Service simulation method and device, concentrated management platform
CN106648945A (en) * 2016-09-30 2017-05-10 北京金山安全软件有限公司 Interface data testing method and device and electronic equipment
CN107122292A (en) * 2016-10-21 2017-09-01 北京小度信息科技有限公司 A kind of method and system of analog service
CN107329890A (en) * 2017-06-06 2017-11-07 北京金山安全软件有限公司 Test method and device based on Mock and server
US9830173B1 (en) * 2015-04-09 2017-11-28 Amazon Technologies, Inc. Proxy simulation service for testing stateless systems
CN107729246A (en) * 2017-10-13 2018-02-23 广州阿里巴巴文学信息技术有限公司 For the auxiliary test methods of intended application, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103023708A (en) * 2011-09-20 2013-04-03 腾讯科技(深圳)有限公司 Method and system for testing communication protocol interface
US9830173B1 (en) * 2015-04-09 2017-11-28 Amazon Technologies, Inc. Proxy simulation service for testing stateless systems
CN106528400A (en) * 2016-09-22 2017-03-22 深圳峰创智诚科技有限公司 MOCK testing method and device
CN106648945A (en) * 2016-09-30 2017-05-10 北京金山安全软件有限公司 Interface data testing method and device and electronic equipment
CN107122292A (en) * 2016-10-21 2017-09-01 北京小度信息科技有限公司 A kind of method and system of analog service
CN106603283A (en) * 2016-12-13 2017-04-26 广州唯品会信息科技有限公司 Service simulation method and device, concentrated management platform
CN107329890A (en) * 2017-06-06 2017-11-07 北京金山安全软件有限公司 Test method and device based on Mock and server
CN107729246A (en) * 2017-10-13 2018-02-23 广州阿里巴巴文学信息技术有限公司 For the auxiliary test methods of intended application, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Private API Access and Functional Mocking in Automated Unit Test Generation;Andrea Arcuri;《 2017 IEEE International Conference on Software Testing, Verification and Validation (ICST)》;20170518;126-136 *

Also Published As

Publication number Publication date
CN108897691A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN108897691B (en) Data processing method, device, server and medium based on interface simulation service
CN108334436B (en) Application software optimization method, device, equipment and computer readable storage medium
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN111324441A (en) Operating environment switching method and device, computer equipment and storage medium
US10585678B2 (en) Insertion of custom activities in an orchestrated application suite
CN112612977A (en) Page display method, system, device, equipment and storage medium
CN114371888A (en) Method and device for hot updating of log collection plug-in, electronic equipment and readable medium
CN113821254A (en) Interface data processing method, device, storage medium and equipment
CN116644250B (en) Page detection method, page detection device, computer equipment and storage medium
CN111813685A (en) Automatic testing method and device
CN112559024A (en) Method and device for generating transaction code change list
CN114338846A (en) Message testing method and device
CN112084114A (en) Method and apparatus for testing an interface
CN112882948A (en) Stability testing method, device and system for application and storage medium
CN112579428A (en) Interface testing method and device, electronic equipment and storage medium
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN112860538A (en) Method and device for performing interface regression test based on online log
CN111831530A (en) Test method and device
CN115484200B (en) Buried point testing method, buried point testing device, server, storage medium and buried point testing system
CN113420010B (en) Database management method, device, electronic equipment and storage medium
CN113626409B (en) Test data processing method, device, equipment and storage medium
CN111857879B (en) Data processing method, device, electronic equipment and computer readable medium
CN110351222B (en) Data security processing method, device and system
CN113760724A (en) Automatic testing method and device, electronic equipment and computer readable medium
CN117298598A (en) Method and device for processing resource package, storage medium and electronic 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