CN108897691A - Data processing method, device, server and medium based on interface analog service - Google Patents

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

Info

Publication number
CN108897691A
CN108897691A CN201810714121.0A CN201810714121A CN108897691A CN 108897691 A CN108897691 A CN 108897691A CN 201810714121 A CN201810714121 A CN 201810714121A CN 108897691 A CN108897691 A CN 108897691A
Authority
CN
China
Prior art keywords
data
matching rule
service
interface
metamessage
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
CN201810714121.0A
Other languages
Chinese (zh)
Other versions
CN108897691B (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
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology 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

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

Abstract

The embodiment of the invention discloses a kind of data processing method based on interface analog service, device, server and media, wherein this method includes loading corresponding plug-in unit according to specified interface communications protocol;Using plug-in unit, the setting according to specified interface communications protocol carries out the first parsing to the interface requests of the tested downstream service received, obtains the request data of first structure;At least one preconfigured matching rule is traversed, determines the object matching rule wherein to match with request data;Data processing is carried out to request data according to object matching rule, obtains data processed result;Using plug-in unit, the setting according to specified interface communications protocol carries out the second parsing to data processed result, obtains the interface returned data of the second structure, and be back to tested downstream service.The embodiment of the present invention solves the problems, such as that existing interface analog service scalability is poor, realizes the interface analog service for providing in a manner of plug-in unit and supporting different communication protocol.

Description

Data processing method, device, server and medium based on interface analog service
Technical field
The present embodiments relate to field of computer technology more particularly to a kind of data processings based on interface analog service Method, apparatus, server and medium.
Background technique
In the exploitation of web services, test process, it is related to tested web services and the interface that upstream services is called, due to Upstream service is usually therefore can have the test environment that upstream services with tested web services concurrent development and not yet erect Situation, furthermore, it is also possible to therefore, existing there are the situation that tested web services need specific upstream service data to return An analog service (Mock Service) would generally be built in technology, and upstream service is simulated using the analog service to tested Web services are tested.
Due to there are many communication protocols based on Socket, upstream service can provide a variety of different types of interfaces It is called to be tested web services.However, existing analog service is usually only capable of supporting a kind of communication protocol, simulation suit is limited The application of business causes its scalability poor.
Summary of the invention
The embodiment of the present invention provides a kind of data processing method based on interface analog service, device, server and medium, To solve the problems, such as that analog service scalability is poor in the prior art.
In a first aspect, the embodiment of the invention provides a kind of data processing method based on interface analog service, this method Including:
Corresponding plug-in unit is loaded according to specified interface communications protocol;
Using the plug-in unit, the setting according to the specified interface communications protocol is to the tested downstream service received Interface requests carry out the first parsing, obtain the request data of first structure;
At least one preconfigured matching rule is traversed, determines the object matching wherein to match with the request data Rule;
Data processing is carried out to the request data according to object matching rule, obtains data processed result;
Using the plug-in unit, the setting according to the specified interface communications protocol carries out the to the data processed result Two parsings, obtain the interface returned data of the second structure, and return it to the tested downstream service.
Second aspect, the embodiment of the invention also provides a kind of data processing based on interface analog service, the device packets It includes:
Plug-in unit loading module, for loading corresponding plug-in unit according to specified interface communications protocol;
First parsing module, for utilizing the plug-in unit, the setting according to the specified interface communications protocol is to reception The interface requests of the tested downstream service arrived carry out the first parsing, obtain the request data of first structure;
Matching rule determining module, for traversing at least one preconfigured matching rule, determination is wherein asked with described The object matching rule for asking data to match;
Data processing module obtains data for carrying out data processing to the request data according to object matching rule Processing result;
Second parsing module, for utilizing the plug-in unit, the setting according to the specified interface communications protocol is to described Data processed result carries out the second parsing, obtains the interface returned data of the second structure, and return it to the tested downstream Service.
The third aspect, the embodiment of the invention also provides a kind of servers, including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processing Device realizes the data processing method based on interface analog service as described in any embodiment of the present invention.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer Program is realized when the program is executed by processor at the data based on interface analog service as described in any embodiment of the present invention Reason method.
The embodiment of the present invention is first depending on specified interface communications protocol and loads corresponding plug-in unit, using the plug-in unit, Setting according to specified interface communications protocol carries out the first parsing to the interface requests of the tested downstream service received, obtains Then request data carries out data processing to request data according to matched object matching rule, obtains data processed result, most After be again based on plug-in unit the second parsing carried out to data processed result, obtain interface returned data, and return it to it is tested under Trip service.The embodiment of the present invention, which solves interface analog service in the prior art, due to only supporting a kind of communication protocol leads to it The poor problem of scalability is realized and is provided the interface simulation suit of the different communication protocol based on Socket in a manner of plug-in unit Business, also, developer only need to safeguard corresponding plugin library, enrich interface according to specific exploitation or test scene The ability of analog service frame, improves the scalability of interface analog service, and then improves opening for tested downstream service product Hair and testing efficiency.
Detailed description of the invention
Fig. 1 is the flow chart for the data processing method based on interface analog service that the embodiment of the present invention one provides;
Fig. 2 is the flow chart of the data processing method provided by Embodiment 2 of the present invention based on interface analog service;
Fig. 3 is the flow chart for the data processing method based on interface analog service that the embodiment of the present invention three provides;
Fig. 4 is the structural schematic diagram for the data processing equipment based on interface analog service that the embodiment of the present invention four provides;
Fig. 5 is a kind of structural schematic diagram for server that the embodiment of the present invention five provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is the flow chart for the data processing method based on interface analog service that the embodiment of the present invention one provides, this reality The case where example is applicable to the data processing based on interface analog service is applied, this method can be by the number based on interface analog service It is executed according to processing unit, which can be realized by the way of software and/or hardware, and can be integrated on the server.Such as Shown in Fig. 1, this method is specifically included:
S110, corresponding plug-in unit is loaded according to specified interface communications protocol.
Plug-in unit in the present embodiment is developer according to required exploitation or test environment or scene, is write in advance The program got well and encapsulated, also, different communication protocol corresponds to different types of plug-in unit.Therefore, based on interface analog service into When row data processing, it is first depending on the specified interface communications protocol of the data handling procedure and loads corresponding plug-in unit.In addition, different The plug-in unit of type can be uniformly stored in plugin library, convenient for centralized management and maintenance.
S120, the plug-in unit using load, the setting according to specified interface communications protocol take the tested downstream received The interface requests of business carry out the first parsing, obtain the request data of first structure.
After analog service frame receives the interface requests of tested downstream service, using the plug-in unit of load, and foundation refers to The setting of fixed interface communications protocol carries out the first parsing to received interface requests automatically, the request data after parsing To be identified and be handled by plug-in unit.Wherein, it is corresponding to can be understood as different communication protocol itself for the setting of interface communications protocol Data structure form and data resolution rules.Consider that the data structure of different interface communications protocols is different, therefore, by the The structure for the request data that one parsing obtains is also different.
S130, at least one preconfigured matching rule of traversal, determine the target wherein to match with request data With rule.
Matching rule is that developer finishes simultaneously in advance according to interface communications protocol and specific test or exploitation scene It is stored in repository in the form of configuration file, when carrying out data processing, it is only necessary to which corresponding rule are matched according to request data Then.Matching rule defines the specific processing mode to request data, and the relevant information of each matching rule can be right It should store in one file.Wherein, for the traversal order of matching rule, the present embodiment is to this and is not especially limited.? In the case where guaranteeing that the object matching that can be matched to request data is regular, any effective traversal order be can be used.
S140, data processing is carried out to request data according to object matching rule, obtains data processed result.
After goal rule determines, data processing can be carried out to request data, obtain processing result.Wherein, data Processing mode includes forwarding, transparent transmission and return data falsification.
S150, the plug-in unit using load, the setting according to specified interface communications protocol carry out the to data processed result Two parsings, obtain the interface returned data of the second structure, and return it to tested downstream service.
Data processing is completed and then the secondary plug-in unit using load, and the setting pair according to specified interface communications protocol Data processed result carries out the second parsing, obtains interface returned data and is back to tested downstream service.Wherein, in data processing In the process, request data and interface returned data are the data of the different structure under corresponding same communication protocol, this is based on inserting The needs of part processing data.
It should be noted that existing interface analog service can only generally realize that the upstream based on http (s) agreement services Simulation, however encapsulation thought is combined in the present embodiment, using the plug-in unit write in advance, it can provide and be communicated based on distinct interface The analog service of agreement, developer only need to be according to specific exploitation or test scenes, and configuring plug-in unit corresponding with load is Can, the Function Extension of interface analog service is realized, its frame ability is enriched, and then tested downstream service product can be promoted Exploitation and testing efficiency.
Optionally, the interface returned data for obtaining the second structure is back to tested downstream service, including:
The interface returned data for obtaining the second structure is back to tested downstream service according to specified interface communications protocol.
Corresponding plug-in unit is loaded according to specified interface communications protocol when i.e. analog service starts, data processing completes it Afterwards, tested downstream service is back to by data are handled also according to specified interface communications protocol.
Optionally, the interface returned data of the request data of first structure and the second structure is json formatted data.
Json format is a kind of data format of key-value pair form, using the text formatting for being totally independent of programming language come Storage and expression data, are easy to people and read and write, while being also easy to machine parsing and generating.Here, the later period protects for convenience Log and analysis log are deposited, it can be equal by the interface returned data of the request data of first structure and the second structure in the present embodiment It is set as json format.
Optionally, this method further includes:
To the interface requests each time of tested downstream service, its access log is recorded, and is shown by Web page.
The displaying of log can be realized based on Redis database and displaying Web page.It is each using Redis database purchase The access of secondary analog service records, and is externally shown by Web page, can be convenient developer to exploitation or test scene It is involved in the problems, such as being checked.
The present embodiment technical solution is first depending on specified interface communications protocol and loads corresponding plug-in unit, is inserted using this Part, the setting according to specified interface communications protocol carry out the first parsing to the interface requests of the tested downstream service received, Request data is obtained, data processing then is carried out to request data according to matched object matching rule, obtains data processing knot Fruit is finally again based on plug-in unit and carries out the second parsing to data processed result, obtains interface returned data, and be back to it is tested under Trip service.The present embodiment technical solution solves interface analog service in the prior art and leads due to only supporting a kind of communication protocol The problem for causing its scalability poor is realized and is provided the interface simulation of the different communication protocol based on Socket in a manner of plug-in unit Service, also, developer only need to safeguard corresponding plugin library, enrich and connect according to specific exploitation or test scene Mouth mold intends the ability of service framework, improves the scalability and versatility of interface analog service, and then improves tested downstream clothes The exploitation of business product and testing efficiency.
Embodiment two
Fig. 2 is the flow chart of the data processing method provided by Embodiment 2 of the present invention based on interface analog service, this reality Applying example is further progress optimization on the basis of the above embodiments.As shown in Fig. 2, this method includes:
S210, corresponding plug-in unit is loaded according to specified interface communications protocol.
S220, the plug-in unit using load, the setting according to specified interface communications protocol take the tested downstream received The interface requests of business carry out the first parsing, obtain the request data of first structure.
S230, at least one preconfigured matching rule of traversal, determine the target wherein to match with request data With rule.
S240, when object matching rule be forward rule when, from object matching rule in obtain upstream service forwarding ring Border information, the designated environment serviced according to forwarding environmental information and specified interface communications protocol forwarding request data to upstream.
When the function that interface analog service is realized is forwarded to the interface requests in tested downstream, with request data phase Matched object matching rule is forward rule.In repeating process, interface analog service is based on plug-in unit, under being tested The request data of trip service is forwarded to the designated environment of upstream service.
S250, the feedback data for obtaining the designated environment that upstream services, and as data processed result.
After upstream service receives the request data of tested downstream service, to request in the designated environment of upstream service Data are handled, and after data processing is completed, execute operation S270, are again back to processing result using plug-in unit under being tested Trip service.
S260, when object matching rule be return forge rule when, from object matching rule in obtain forgery to be returned Data, and as data processed result.
When object matching rule is to return to forge rule, do not need to service according to upstream to tested downstream service at this time Request data carries out feedback processing.When interface analog service receives the interface requests of tested downstream service, parsed by data, It is forged in rule from pre-set return and obtains out data falsification, and be back to tested downstream service.Wherein, data falsification can To be that developer is pre- according to the exploitation needs of tested downstream service, application scenarios or test environment and interface communications protocol The returned data first defined.In the prior art it is usually manual amendment's environment code, directly forges false data in code level, with Support the progress of product development or test, and the data falsification returned in the present embodiment is the mistake in pre-defined matching rule Configured data in journey, without carrying out artificial data falsification input in product development or test process.
The main contents of matching rule configuration file are illustrated below:Illustratively, matching rule configures The main contents of file may include:The Action Specification of matching rule, the first specific fields of matching rule, matching rule are corresponding Data processing method and the contents such as data processing of information.Wherein, the content of the first specific fields and request data content phase It closes;Data processing method includes forwarding, transparent transmission and return data falsification;Data processing of information includes the interface communication of upstream service The related datas such as protocol type, environment Host and interface (Port).
For example, when the corresponding data processing method of process field in matching rule configuration file is forwarding (dispatch) when, i.e. object matching rule is forward rule, the corresponding data of info field in matching rule configuration file Processing information may include the environment Host and two fields of environment Port of upstream service, indicate interface analog service by number of request According to the address information for being forwarded to upstream service.
When the corresponding data processing method of process field in matching rule configuration file is to return to data falsification (fake) when, i.e., object matching rule is to return to forge rule, the corresponding data of info field in matching rule configuration file Handling information may include data falsification predetermined.
After determining object matching rule, the corresponding data processing method of object matching rule and place can be utilized It manages information and next step operation is carried out to request data.
S270, the plug-in unit using load, the setting according to specified interface communications protocol carry out the to data processed result Two parsings, obtain the interface returned data of the second structure, and return it to tested downstream service.
Optionally, at least one preconfigured matching rule is being traversed, is determining the mesh wherein to match with request data During marking matching rule, if being not matched to object matching rule, it will be requested according to specified interface communications protocol The default contexts that data penetration transmission is serviced to upstream;
The feedback data for obtaining the default contexts of upstream service, as data processed result.
When being not matched to corresponding rule, analog interface service is then according to interface communications protocol by tested downstream service Request data be transparent to upstream service default contexts in handled.Wherein, the transparent transmission and turn that interface analog service is realized The difference of hair function is:Forwarding is to be sent to request data in the designated environment of upstream service, and transparent transmission is by number of request According to be sent to upstream service default contexts in.Request data is sent to the true test environment of upstream service by transparent transmission, It can solve the problem of upstream service testing data configuration difficulty.
Below by taking interface analog service supports the plug-in unit of http communication protocol as an example, illustrate:
(1) parsing of the interface requests of downstream service
Enter ginseng:The interface requests got by Socket;
Processing:By interface requests according to http protocol analysis at the request data of A structure json format;
It returns:Return to the request data of the json format of A structure.
(2) playback of the interface requests of downstream service
Enter ginseng:The request data (data of the interface requests after parsing) of A structure json format, the upstream of request service Designated environment information (Host and Port);
Processing:Http request is generated using the request data of the json format of A structure and the environmental information of request, and Playback is executed, interface return information is organized into the data processed result of the json format of B structure;
It returns:(interface requests upstream service designated environment playback to the data processed result of the json format of return B structure Interface afterwards returns to the data after parsing).
(3) data falsification of the interface requests of downstream service returns
Enter ginseng:The request data (data of the interface requests after parsing) of A structure json format, the upstream of request service Default contexts information (Host and Port);
Processing:B structure json formatted data is generated according to http agreement and executes http response.
It returns:Whether True/False (forges to return and succeed).
It is usually in the prior art more set of environments that trip service is connected by manual switching, to support different analog service function The joint of energy is called, and in the present embodiment, plug-in unit and specified interface communications protocol correspond, according to interface communications protocol Difference loads different plug-in units, and then is connected to the varying environment of upstream service, without artificially carrying out cutting for upstream service environment It changes.
It should be noted that existing analog service mainly includes:Nginx Reverse Proxy, mockjs server, Rap server and mockserver server.Wherein, nginx Reverse Proxy only supports http agreement, can not extend logical Believe agreement, and the flow of uri dimension is only supported to forward setting, upstream service interface returned data is not supported to simulate;mockjs Server, rap server and mockserver server also only support http agreement, can not expanding communication agreement, do not support base In interface requests data automatically parse and carry out upstream service specific environment routing.However, the present embodiment technical solution is supported Developer is realized the simulation of the interface service of the self-defining communication protocol based on Socket, is no longer limited in a manner of plug-in unit In the analog service of single communication protocol, and analog service can be realized simultaneously to upstream service specific environment (default ring Border and designated environment) routing and the simulation of interface returned data etc..
Optionally, this method further includes:In case of data processing exception, then at least through short message, mail or phone Mode is alarmed.For example, interface analog service starts a leak (bug), then can by short message, mail and phone at least Perhaps administrator alarms so that developer or administrator grasp interface service frame in time to developer for a kind of mode The operating condition of frame guarantees that the exploitation of tested downstream service product or test are normally carried out.
The present embodiment technical solution is by providing the interface analog service frame based on plug-in unit, the starting of interface analog service Afterwards, plug-in unit corresponding with specified interface communications protocol is loaded, and (is turned using the parsing of plug-in unit progress interface requests, playback Hair) or return is forged, when matching rule is not present, then the transparent transmission of interface requests is carried out using the plug-in unit, is solved existing The problem that interface analog service causes its scalability poor due to only supporting a kind of communication protocol in technology, realizing can mention For the interface analog service of the different communication protocol based on Socket, specific environment road is serviced to upstream wherein can be realized simultaneously By simulating with interface returned data, also, developer only need to safeguard corresponding plugin library according to specific exploitation and test scene , without artificially carrying out the input of data falsification and the switching of upstream service varying environment, enrich interface analog service The ability of frame, improves the scalability and versatility of interface analog service, and then tested downstream service product can be improved Exploitation and testing efficiency.
Embodiment three
Fig. 3 is the flow chart for the data processing method based on interface analog service that the embodiment of the present invention three provides, this reality Applying example is further progress optimization on the basis of the above embodiments.As shown in figure 3, this method includes:
S310, corresponding plug-in unit is loaded according to specified interface communications protocol.
S320, the plug-in unit using load, the setting according to specified interface communications protocol take the tested downstream received The interface requests of business carry out the first parsing, obtain the request data of first structure, wherein upstream service is carried in interface requests Identification information.
The identification information of upstream service is used to load the metamessage configuration file of upstream service.
S330, the identification information serviced according to upstream, load metamessage configuration file corresponding with upstream service.
The matching rule of data processing is not only stored in the repository of interface analog service, but also stores upstream service The metamessage of metamessage, the service of a upstream can store in a file.Illustratively, for storing the member letter of upstream service The content of the configuration file of breath mainly includes:Upstream service name, upstream service environment Host, upstream service environment interface (Port), and be directed toward multiple matching rules file relative path the second specific fields (data), wherein upstream services ring Border includes default contexts and designated environment.
When interface analog service receives the interface requests of tested downstream service, the first parsing is carried out to it, meeting simultaneously Judge analog service repository whether has been loaded in memory.If it is judged that there are no loading simulation service configuration in memory The information of all metamessage configuration files in repository can be then loaded into memory by library.
S340, according to the second specific fields in metamessage configuration file, load at least one preconfigured matching rule Then, wherein the second specific fields are used to be directed toward the to acquisite approachs of matching rule.
After the information of all metamessage configuration files is loaded into memory, interface analog service can be according to each The information of corresponding matching rule configuration file is loaded into memory by the second specific fields in metamessage configuration file, with Continue all matching rules of traversal after an action of the bowels.
The first specific fields of S350, at least one preconfigured matching rule of traversal, judge the first specific fields Value whether be request data sub- dictionary, wherein the first specific fields are for defining matching rule according to interface communications protocol The required information carried of setting.
Interface analog service obtains newest configuration, including matching by way of heat load from analog service repository Regular configuration file and metamessage configuration file.After confirmation has been completed the heat load of configuration, all matching rules are traversed The first specific fields (for example, pattern field), judge first specific fields value whether be request data sub- word Allusion quotation, first specific fields exist in the form of key-value pair.Wherein, the definition of sub- dictionary is:If all keys all exist in field A Exist in field B, and the corresponding value of each key is equal with the corresponding value of the corresponding key of field B in field A, then field A is The sub- dictionary of field B.I.e. if all keys all exist in request data in the first specific fields of matching rule, and match The corresponding value of each key is equal with the corresponding value of the corresponding key of request data in first specific fields of rule, then matching rule The first specific fields be request data sub- dictionary.Wherein, the corresponding value of each key in the first specific fields of matching rule It is also possible to the form of nested key-value pair.
If S360, judging that the first specific fields are the sub- dictionary of request data, stop traversing, and current matching is advised Then it is determined as the object matching to match with request data rule.
During whether judge the value of the first specific fields of matching rule is the sub- dictionary of request data, once hair Raw matching, then exit the traversal to matching rule, is carried out using the corresponding data processing method of matching rule and processing information It operates in next step.
S370, data processing is carried out to request data according to object matching rule, obtains data processed result.
S380, the plug-in unit using load, the setting according to specified interface communications protocol carry out the to data processed result Two parsings, obtain the interface returned data of the second structure, and return it to tested downstream service.
Based on the above technical solution, optionally, the identification information according to upstream service, load and upstream service pair The metamessage configuration file answered, including:
According to upstream service identification information, loaded from repository metamessage configuration file corresponding with upstream service to Memory, wherein repository records each metamessage configuration file for storing preconfigured whole metamessage configuration files The first renewal time information;
Correspondingly, this method further includes:
The second renewal time information of the metamessage configuration file of load is recorded in memory;
If being loaded with metamessage configuration file corresponding with upstream service in memory, compared for the first renewal time Information and the second renewal time information configure the metamessage corresponding with upstream service loaded in memory according to comparison result File carries out increase or delete processing, and updates matching rule corresponding with metamessage configuration file.
Consider that interface analog service obtains newest configuration by way of heat load from analog service repository, because This, the renewal time of all configuration files is also required to be safeguarded.Interface analog service is matched in the metamessage of load upstream service While setting file, the recent renewal time of all metamessage configuration files can be also safeguarded in memory.If in memory It is loaded with analog service repository, then when can obtain the recent renewal of all metamessage configuration files of analog service repository first Between be compared with the recent renewal time of the metamessage configuration file loaded in memory.
If it was found that analog service repository is there are metamessage configuration file, there is a situation where increase/deletions, in memory Corresponding document is carried out to increase/delete processing, and matching corresponding to the second specific fields in metamessage configuration file is advised Then configuration file does same treatment.
The recent renewal time of metamessage configuration file changes if it exists, then reloads metamessage configuration file letter Memory is ceased, and updates the file recent renewal time safeguarded in memory.
The renewal time maintenance of file through the above configuration, it is ensured that is loaded in analog service repository and memory matches It sets file to be consistent, and uses last updated configuration file.
Optionally, this method further includes:
The target element information configuration file configured in repository is verified.
Optionally, the target element information configuration file configured in repository is verified, including:
If other configured metamessage configuration files in the filename and repository of target element information configuration file Filename repeat, or if the first specific fields of the corresponding any matching rule of target element information configuration file field Value, is the sub- dictionary of the corresponding a certain matching rule of other metamessage configuration files, then prompt forbids typing target metamessage to match Set file.
By judging whether the filename in metamessage configuration file existing and corresponding matching rule configuration file The field value of first specific fields of middle matching rule whether be other matching rules sub- dictionary, realize target element information configuration The verification of file, the case where multiple matching rules being matched to avoid the same request data of tested downstream service.
The technical solution of the present embodiment takes tested downstream first with the plug-in unit corresponding with interface communications protocol of load The interface requests of business are parsed to obtain request data, then, according to the identification information of upstream service, load and upstream service pair The metamessage configuration file answered, secondly, load is preconfigured at least according to the second specific fields in metamessage configuration file One matching rule judges the first spy finally by the first specific fields for traversing at least one preconfigured matching rule Determine field value whether be request data sub- dictionary, determine object matching rule, and then request data handled simultaneously It is back to downstream service.The present embodiment technical solution solve in the prior art interface analog service due to only supporting a kind of communication Agreement and the problem for causing its scalability poor, are realized and are provided the different communication protocol based on Socket in a manner of plug-in unit Interface analog service, also, developer only need to safeguard plugin library corresponding with update according to specific exploitation or test scene , the ability of interface analog service frame is enriched, improves the scalability and versatility of interface analog service, and then promoted The exploitation of tested downstream service product and testing efficiency;In addition, the maintenance and comparison of the renewal time of configuration file, ensure that The consistency of the configuration file loaded in analog service repository and memory;To the metamessage configuration file configured in repository Verification avoids the case where same request data of tested downstream service matches multiple matching rules.
Example IV
Fig. 4 is the structural schematic diagram for the data processing equipment based on interface analog service that the embodiment of the present invention four provides, The present embodiment is applicable to the case where data processing based on interface analog service.The device can use software and/or hardware Mode realize, and be configured on server.Data processing based on interface analog service provided by the embodiment of the present invention The data processing method provided by any embodiment of the invention based on interface analog service can be performed in device, has execution method Corresponding functional module and beneficial effect.
As shown in figure 4, the device includes plug-in unit loading module 410, the first parsing module 420, matching rule determining module 430, data processing module 440 and the second parsing module 450, wherein:
Plug-in unit loading module 410, for loading corresponding plug-in unit according to specified interface communications protocol;
First parsing module 420, for the plug-in unit using load, the setting according to specified interface communications protocol is to reception The interface requests of the tested downstream service arrived carry out the first parsing, obtain the request data of first structure;
Matching rule determining module 430, for traversing at least one preconfigured matching rule, determine wherein with request The object matching rule that data match;
Data processing module 440 obtains at data for carrying out data processing to request data according to object matching rule Manage result;
Second parsing module 450, for the plug-in unit using load, the setting according to specified interface communications protocol is to data Processing result carries out the second parsing, obtains the interface returned data of the second structure, and return it to tested downstream service.
Optionally, matching rule determining module 430 includes judging unit and object matching rule determination unit, wherein:
Judging unit judges the first spy for traversing the first specific fields of at least one preconfigured matching rule Determine field value whether be request data sub- dictionary, wherein the first specific fields are logical according to interface for defining matching rule Believe the required information carried of the setting of agreement;
Object matching rule determination unit, if stopping for judging that the first specific fields are the sub- dictionary of request data It only traverses, and current matching rule is determined as the object matching to match with request data rule.
Optionally, the object matching rule in matching rule determining module 430 is forward rule;
Correspondingly, data processing module 440 includes retransmission unit and designated environment feedback data acquiring unit, wherein:
Retransmission unit, the forwarding environmental information serviced for obtaining upstream from object matching rule, according to forwarding environment The designated environment that information and specified interface communications protocol forwarding request data are serviced to upstream;
Designated environment feedback data acquiring unit, the feedback data of the designated environment for obtaining upstream service, and conduct Data processed result.
Optionally, the object matching rule in matching rule determining module 430 is to return to forge rule;
Correspondingly, data processing module 440 is specifically used for:
Data falsification to be returned is obtained from object matching rule, and as data processed result.
Optionally, which further includes that transparent transmission module and default contexts feedback data obtain module, wherein:
Transparent transmission module, if will be asked for being not matched to object matching rule according to specified interface communications protocol The default contexts for asking data penetration transmission to service to upstream;
Default contexts feedback data obtains module, the feedback data of the default contexts for obtaining upstream service, as number According to processing result.
Optionally, the second parsing module 450 includes interface returned data acquiring unit and data return unit, wherein:
Interface returned data acquiring unit, the setting for the plug-in unit using load, according to specified interface communications protocol Second parsing is carried out to data processed result, obtains the interface returned data of the second structure;
Data return unit, for returning the interface returned data for obtaining the second structure according to specified interface communications protocol It is back to tested downstream service.
Optionally, the second structure in the request data of first structure and the second parsing module 450 in the first parsing module 420 Interface returned data, be json formatted data.
Based on the above technical solution, optionally, it is carried in received interface requests in the first parsing module 420 The identification information of upstream service;
Correspondingly, the device further includes:
Metamessage configuration file loading module loads corresponding with upstream service for the identification information according to upstream service Metamessage configuration file;
Matching rule loading module, for according to the second specific fields in metamessage configuration file, load to be pre-configured with At least one matching rule, wherein the second specific fields are used to be directed toward the to acquisite approachs of matching rule.
Optionally, metamessage configuration file loading module is specifically used for:
According to upstream service identification information, loaded from repository metamessage configuration file corresponding with upstream service to Memory, wherein repository records each metamessage configuration file for storing preconfigured whole metamessage configuration files The first renewal time information;
Correspondingly, the device further includes:
Renewal time logging modle, the second renewal time letter of the metamessage configuration file for recording load in memory Breath;
Renewal time comparison module, if for being loaded with metamessage configuration text corresponding with upstream service in memory Part then compares the first renewal time information and the second renewal time information, according to comparison result, to load in memory and upstream It services corresponding metamessage configuration file and carries out increase or delete processing, and update matching rule corresponding with metamessage configuration file Then.
Based on the above technical solution, optionally, which further includes:
Correction verification module, for being verified to the target element information configuration file configured in repository.
Optionally, correction verification module is specifically used for:
If other configured metamessage configuration files in the filename and repository of target element information configuration file Filename repeat, or if the first specific fields of the corresponding any matching rule of target element information configuration file field Value, is the sub- dictionary of the corresponding a certain matching rule of other metamessage configuration files, then prompt forbids typing target metamessage to match Set file.
Optionally, which further includes:
Alarm module, in case of data processing exception, then being carried out at least through the mode of short message, mail or phone Alarm.
Optionally, which further includes:
Log display module records its access log, and pass through for the interface requests each time to tested downstream service Web page is shown.
The present embodiment technical solution is first depending on specified interface communications protocol and loads corresponding plug-in unit, is inserted using this Part, the setting according to specified interface communications protocol carry out the first parsing to the interface requests of the tested downstream service received, Request data is obtained, data processing then is carried out to request data according to matched object matching rule, obtains data processing knot Fruit, be finally again based on plug-in unit to data processed result carry out second parsing, obtain interface returned data, and return it to by Survey downstream service.The present embodiment technical solution solve in the prior art interface analog service due to only supporting a kind of communication protocol And the problem for causing its scalability poor, it realizes and the interface of the different communication protocol based on Socket is provided in a manner of plug-in unit Analog service, improves the scalability of interface analog service, and then improves exploitation and the testing efficiency of product.
Embodiment five
Fig. 5 is a kind of structural schematic diagram for server that the embodiment of the present invention five provides.Fig. 5, which is shown, to be suitable for being used to realizing The block diagram of the exemplary servers 512 of embodiment of the present invention.The server 512 that Fig. 5 is shown is only an example, should not be right The function and use scope of the embodiment of the present invention bring any restrictions.
As shown in figure 5, server 512 is showed in the form of generic server.The component of server 512 may include but not It is limited to:One or more processor 516, storage device 528 connect different system components (including storage device 528 and processing Device 516) bus 518.
Bus 518 indicates one of a few class bus structures or a variety of, including storage device bus or storage device control Device processed, peripheral bus, graphics acceleration port, processor or total using the local of any bus structures in a variety of bus structures Line.For example, these architectures include but is not limited to industry standard architecture (Industry Subversive Alliance, ISA) bus, microchannel architecture (Micro Channel Architecture, MAC) bus is enhanced Isa bus, Video Electronics Standards Association (Video Electronics Standards Association, VESA) local are total Line and peripheral component interconnection (Peripheral Component Interconnect, PCI) bus.
Server 512 typically comprises a variety of computer system readable media.These media can be it is any being capable of bedding and clothing The usable medium that business device 512 accesses, including volatile and non-volatile media, moveable and immovable medium.
Storage device 528 may include the computer system readable media of form of volatile memory, such as arbitrary access Memory (Random Access Memory, RAM) 530 and/or cache memory 532.Server 512 can be further Including other removable/nonremovable, volatile/non-volatile computer system storage mediums.Only as an example, storage system System 534 can be used for reading and writing immovable, non-volatile magnetic media (Fig. 5 do not show, commonly referred to as " hard disk drive ").To the greatest extent It is not shown in pipe Fig. 5, the disc driver for reading and writing to removable non-volatile magnetic disk (such as " floppy disk ") can be provided, with And to removable anonvolatile optical disk, such as CD-ROM (Compact Disc Read-Only Memory, CD-ROM), number Word optic disk (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical mediums) read-write CD Driver.In these cases, each driver can be connected by one or more data media interfaces with bus 518. Storage device 528 may include at least one program product, which has one group of (for example, at least one) program module, These program modules are configured to perform the function of various embodiments of the present invention.
Program/utility 540 with one group of (at least one) program module 542 can store in such as storage dress It sets in 528, such program module 542 includes but is not limited to operating system, one or more application program, other program moulds It may include the realization of network environment in block and program data, each of these examples or certain combination.Program module 542 usually execute function and/or method in embodiment described in the invention.
Server 512 can also be with one or more external equipments 514 (such as keyboard, direction terminal, display 524 etc.) Communication, can also be enabled a user to one or more terminal interact with the server 512 communicate, and/or with make the clothes Any terminal (such as network interface card, modem etc.) that business device 512 can be communicated with one or more of the other computing terminal Communication.This communication can be carried out by input/output (I/O) interface 522.Also, server 512 can also be suitable by network Orchestration 520 and one or more network (such as local area network (Local Area Network, LAN), wide area network (Wide Area Network, WAN) and/or public network, such as internet) communication.As shown in figure 5, network adapter 520 passes through bus 518 It is communicated with other modules of server 512.It should be understood that although not shown in the drawings, can be used in conjunction with server 512 other hard Part and/or software module, including but not limited to:Microcode, terminal driver, redundant processor, external disk drive array, magnetic Disk array (Redundant Arrays of Independent Disks, RAID) system, tape drive and data backup Storage system etc..
The program that processor 516 is stored in storage device 528 by operation, thereby executing various function application and number According to processing, such as realize the data processing method provided by any embodiment of the invention based on interface analog service, this method May include:
Corresponding plug-in unit is loaded according to specified interface communications protocol;
Using the plug-in unit, the setting according to the specified interface communications protocol is to the tested downstream service received Interface requests carry out the first parsing, obtain the request data of first structure;
At least one preconfigured matching rule is traversed, determines the object matching wherein to match with the request data Rule;
Data processing is carried out to the request data according to object matching rule, obtains data processed result;
Using the plug-in unit, the setting according to the specified interface communications protocol carries out the to the data processed result Two parsings, obtain the interface returned data of the second structure, and return it to the tested downstream service.
Embodiment six
The embodiment of the present invention six additionally provides a kind of computer readable storage medium, is stored thereon with computer program, should Such as the data processing side provided by any embodiment of the invention based on interface analog service is realized when program is executed by processor Method, this method may include:
Corresponding plug-in unit is loaded according to specified interface communications protocol;
Using the plug-in unit, the setting according to the specified interface communications protocol is to the tested downstream service received Interface requests carry out the first parsing, obtain the request data of first structure;
At least one preconfigured matching rule is traversed, determines the object matching wherein to match with the request data Rule;
Data processing is carried out to the request data according to object matching rule, obtains data processed result;
Using the plug-in unit, the setting according to the specified interface communications protocol carries out the to the data processed result Two parsings, obtain the interface returned data of the second structure, and return it to the tested downstream service.
The computer storage medium of the embodiment of the present invention, can be using any of one or more computer-readable media Combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.It is computer-readable Storage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device or Device, or any above combination.The more specific example (non exhaustive list) of computer readable storage medium includes:Tool There are electrical connection, the portable computer diskette, hard disk, random access memory (RAM), read-only memory of one or more conducting wires (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD- ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer-readable storage Medium can be any tangible medium for including or store program, which can be commanded execution system, device or device Using or it is in connection.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimited In wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
The computer for executing operation of the present invention can be write with one or more programming languages or combinations thereof Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++, It further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be with It fully executes, partly execute on the user computer on the user computer, being executed as an independent software package, portion Divide and partially executes or executed on remote computer or terminal completely on the remote computer on the user computer.It is relating to And in the situation of remote computer, remote computer can pass through the network of any kind --- including local area network (LAN) or extensively Domain net (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as provided using Internet service Quotient is connected by internet).
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.

Claims (28)

1. a kind of data processing method based on interface analog service, which is characterized in that including:
Corresponding plug-in unit is loaded according to specified interface communications protocol;
Using the plug-in unit, the setting according to the specified interface communications protocol is to the interface of the tested downstream service received Request carries out the first parsing, obtains the request data of first structure;
At least one preconfigured matching rule is traversed, determines the object matching rule wherein to match with the request data Then;
Data processing is carried out to the request data according to object matching rule, obtains data processed result;
Using the plug-in unit, the setting according to the specified interface communications protocol carries out the second solution to the data processed result Analysis, obtains the interface returned data of the second structure, and return it to the tested downstream service.
2. the method according to claim 1, wherein at least one preconfigured matching rule of traversal, determines The object matching rule wherein to match with the request data, including:
The first specific fields for traversing at least one preconfigured matching rule judge whether the value of the first specific fields is institute State the sub- dictionary of request data, wherein the first specific fields are for defining the matching rule setting according to interface communications protocol The fixed required information carried;
If judging, the first specific fields are the sub- dictionary of the request data, stop traversing, and really by current matching rule It is set to the object matching rule to match with the request data.
3. the method according to claim 1, wherein object matching rule is forward rule;
Correspondingly, carrying out data processing to the request data according to object matching rule, data processed result is obtained, including:
From object matching rule in obtain upstream service forwarding environmental information, according to the forwarding environmental information and it is described specify The interface communications protocol designated environment that forwards the request data to service to the upstream;
The feedback data of the designated environment of the upstream service is obtained, and as the data processed result.
4. the method according to claim 1, wherein object matching rule is to return to forge rule;
Correspondingly, carrying out data processing to the request data according to object matching rule, data processed result is obtained, including:
Data falsification to be returned is obtained from object matching rule, and as the data processed result.
5. the method according to claim 1, wherein traversing at least one preconfigured matching rule, really During the fixed object matching rule wherein to match with the request data, if being not matched to object matching rule, The request data is then transparent to according to the specified interface communications protocol default contexts of upstream service;
The feedback data for obtaining the default contexts of the upstream service, as the data processed result.
6. the method according to claim 1, wherein the interface returned data for obtaining the second structure is back to institute Tested downstream service is stated, including:
The interface returned data for obtaining the second structure is back to the tested downstream according to the specified interface communications protocol Service.
7. the method according to claim 1, wherein carrying the mark letter of upstream service in the interface requests Breath;
Correspondingly, determining the mesh wherein to match with the request data traversing at least one preconfigured matching rule Before marking matching rule, the method also includes:
According to the identification information of upstream service, metamessage configuration file corresponding with upstream service is loaded;
According to the second specific fields in the metamessage configuration file, at least one preconfigured matching rule is loaded, In, the second specific fields are used to be directed toward the to acquisite approachs of matching rule.
8. the method according to the description of claim 7 is characterized in that load metamessage configuration text corresponding with upstream service Part, including:
Metamessage configuration file corresponding with upstream service is loaded from repository to memory, wherein the repository is used In the preconfigured whole metamessage configuration files of storage, and record the first renewal time letter of each metamessage configuration file Breath;
Correspondingly, the method also includes:
The second renewal time information of the metamessage configuration file of load is recorded in memory;
If being loaded with metamessage configuration file corresponding with upstream service in memory, compared for the first renewal time Information and the second renewal time information, according to comparison result, to the metamessage corresponding with upstream service loaded in memory Configuration file carries out increase or delete processing, and updates matching rule corresponding with the metamessage configuration file.
9. according to the method described in claim 8, it is characterized in that, the method also includes:
The target element information configuration file configured in the repository is verified.
10. according to the method described in claim 9, it is characterized in that, to the target element information configuration configured in the repository File is verified, including:
If the file of other configured metamessage configuration files in the filename and repository of target element information configuration file Name repetition, or if the first specific fields of the corresponding any matching rule of target element information configuration file field value, be The sub- dictionary of the corresponding a certain matching rule of other metamessage configuration files, then prompt forbids typing target element information configuration literary Part.
11. the method according to any one of claims 1 to 10, which is characterized in that the method also includes:
In case of data processing exception, then alarm at least through the mode of short message, mail or phone.
12. according to the method for claim 11, which is characterized in that the interface of the request data of first structure and the second structure Returned data is json formatted data.
13. according to the method for claim 11, which is characterized in that the method also includes:
To the interface requests each time of the tested downstream service, its access log is recorded, and is shown by Web page.
14. a kind of data processing equipment based on interface analog service, which is characterized in that including:
Plug-in unit loading module, for loading corresponding plug-in unit according to specified interface communications protocol;
First parsing module, for utilizing the plug-in unit, setting according to the specified interface communications protocol is to receiving The interface requests of tested downstream service carry out the first parsing, obtain the request data of first structure;
Matching rule determining module, for traversing at least one preconfigured matching rule, determine wherein with the number of request According to the object matching rule to match;
Data processing module obtains data processing for carrying out data processing to the request data according to object matching rule As a result;
Second parsing module, for utilizing the plug-in unit, the setting according to the specified interface communications protocol is to the data Processing result carries out the second parsing, obtains the interface returned data of the second structure, and return it to the tested downstream service.
15. device according to claim 14, which is characterized in that matching rule determining module includes:
Judging unit judges the first specific word for traversing the first specific fields of at least one preconfigured matching rule The value of section whether be the request data sub- dictionary, wherein the first specific fields are for defining the matching rule according to connecing The required information carried of the setting of port communications agreement;
Object matching rule determination unit, if stopping for judging that the first specific fields are the sub- dictionary of the request data It only traverses, and current matching rule is determined as the object matching to match with the request data rule.
16. device according to claim 14, which is characterized in that the object matching rule in matching rule determining module is Forward rule;
Correspondingly, data processing module includes:
Retransmission unit, the forwarding environmental information serviced for obtaining upstream from object matching rule, according to the forwarding environment The designated environment that information and the specified interface communications protocol forward the request data to service to the upstream;
Designated environment feedback data acquiring unit, the feedback data of the designated environment for obtaining the upstream service, and conduct The data processed result.
17. device according to claim 14, which is characterized in that the object matching rule in matching rule determining module is It returns and forges rule;
Correspondingly, data processing module is specifically used for:
Data falsification to be returned is obtained from object matching rule, and as the data processed result.
18. device according to claim 14, which is characterized in that described device further includes:
Transparent transmission module, if for being not matched to object matching rule, according to the specified interface communications protocol by institute State the default contexts that request data is transparent to upstream service;
Default contexts feedback data obtains module, the feedback data of the default contexts for obtaining the upstream service, as institute State data processed result.
19. device according to claim 14, which is characterized in that the second parsing module includes:
Interface returned data acquiring unit, for utilizing the plug-in unit, the setting pair according to the specified interface communications protocol The data processed result carries out the second parsing, obtains the interface returned data of the second structure;
Data return unit, for returning the interface returned data for obtaining the second structure according to the specified interface communications protocol It is back to the tested downstream service.
20. device according to claim 14, which is characterized in that carried in received interface requests in the first parsing module The identification information for thering is upstream to service;
Correspondingly, described device further includes:
Metamessage configuration file loading module, the identification information for servicing according to the upstream, load are serviced with the upstream Corresponding metamessage configuration file;
Matching rule loading module, for according to the second specific fields in the metamessage configuration file, load to be pre-configured with At least one matching rule, wherein the second specific fields are used to be directed toward the to acquisite approachs of matching rule.
21. device according to claim 20, which is characterized in that metamessage configuration file loading unit is specifically used for:
According to the identification information of upstream service, metamessage configuration text corresponding with upstream service is loaded from repository Part is to memory, wherein the repository records each metamessage for storing preconfigured whole metamessage configuration files First renewal time information of configuration file;
Correspondingly, described device further includes:
Renewal time logging modle, the second renewal time information of the metamessage configuration file for recording load in memory;
Renewal time comparison module, if for being loaded with metamessage configuration text corresponding with upstream service in memory Part then compares the first renewal time information and the second renewal time information, according to comparison result, to loaded in memory with it is described Upstream services corresponding metamessage configuration file and carries out increase or delete processing, and updates corresponding with the metamessage configuration file Matching rule.
22. device according to claim 21, which is characterized in that described device further includes:
Correction verification module, for being verified to the target element information configuration file configured in the repository.
23. device according to claim 22, which is characterized in that correction verification module is specifically used for:
If the file of other configured metamessage configuration files in the filename and repository of target element information configuration file Name repetition, or if the first specific fields of the corresponding any matching rule of target element information configuration file field value, be The sub- dictionary of the corresponding a certain matching rule of other metamessage configuration files, then prompt forbids typing target element information configuration literary Part.
24. any device in 4~23 according to claim 1, which is characterized in that described device further includes:
Alarm module, in case of data processing exception, then being reported at least through the mode of short message, mail or phone It is alert.
25. device according to claim 24, which is characterized in that in the first parsing module the request data of first structure and The interface returned data of second structure in second parsing module, is json formatted data.
26. device according to claim 24, which is characterized in that described device further includes:
Log display module records its access log, and pass through for the interface requests each time to the tested downstream service Web page is shown.
27. a kind of server, which is characterized in that including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now data processing method based on interface analog service as described in any in claim 1~13.
28. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor The data processing method based on interface analog service as described in any in claim 1~13 is realized when execution.
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 true CN108897691A (en) 2018-11-27
CN108897691B 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)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857656A (en) * 2019-01-18 2019-06-07 深圳壹账通智能科技有限公司 Adaptation method, device, computer equipment and storage medium based on test
CN110120917A (en) * 2019-06-28 2019-08-13 北京百度网讯科技有限公司 Method for routing and device based on content
CN110196809A (en) * 2019-05-30 2019-09-03 贝壳技术有限公司 Interface test method and device
CN110278272A (en) * 2019-06-24 2019-09-24 四川新网银行股份有限公司 Simulate the universal method of Socket request
CN110287039A (en) * 2019-06-26 2019-09-27 网易无尾熊(杭州)科技有限公司 Analog interface configuration method, medium, device and calculating equipment
CN110309058A (en) * 2019-05-24 2019-10-08 平安银行股份有限公司 Business end test method, device, computer installation and computer storage medium
CN110825453A (en) * 2019-10-25 2020-02-21 中盈优创资讯科技有限公司 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
CN111309498A (en) * 2020-02-13 2020-06-19 山东汇贸电子口岸有限公司 Request processing method, device and computer readable medium
CN111382056A (en) * 2018-12-29 2020-07-07 北京字节跳动网络技术有限公司 Service testing method and device, server and storage medium
CN111382057A (en) * 2018-12-29 2020-07-07 北京字节跳动网络技术有限公司 Test case generation method, test method and device, server and storage medium
CN111385147A (en) * 2020-03-06 2020-07-07 腾讯科技(深圳)有限公司 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
CN111858083A (en) * 2019-12-30 2020-10-30 北京嘀嘀无限科技发展有限公司 Remote service calling method and device, electronic equipment and storage medium
CN112073420A (en) * 2020-09-11 2020-12-11 杭州安恒信息技术股份有限公司 Network protocol analysis method, device and related equipment
CN112181519A (en) * 2020-09-25 2021-01-05 中国建设银行股份有限公司 Data processing method, device, equipment and storage medium
CN112351059A (en) * 2020-07-30 2021-02-09 中兴通讯股份有限公司 Request processing method and device, electronic equipment and computer-readable storage medium
CN112383434A (en) * 2020-11-17 2021-02-19 Oppo广东移动通信有限公司 Interface simulation method and device for network request, electronic equipment and storage medium
CN112597000A (en) * 2020-12-09 2021-04-02 山东浪潮通软信息科技有限公司 WebScoket protocol-based automatic testing method for instant messaging software
CN112688793A (en) * 2019-10-18 2021-04-20 北京字节跳动网络技术有限公司 Data packet obtaining method and device and electronic equipment
CN113328913A (en) * 2021-05-31 2021-08-31 长沙市到家悠享家政服务有限公司 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
CN114567621A (en) * 2022-04-29 2022-05-31 成都瑞华康源科技有限公司 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
ANDREA ARCURI: "Private API Access and Functional Mocking in Automated Unit Test Generation", 《 2017 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION (ICST)》 *

Cited By (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382056A (en) * 2018-12-29 2020-07-07 北京字节跳动网络技术有限公司 Service testing method and device, server and storage medium
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
CN111382057A (en) * 2018-12-29 2020-07-07 北京字节跳动网络技术有限公司 Test case generation method, test 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
CN110196809A (en) * 2019-05-30 2019-09-03 贝壳技术有限公司 Interface test method and device
CN110278272A (en) * 2019-06-24 2019-09-24 四川新网银行股份有限公司 Simulate the universal method of 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
CN110120917A (en) * 2019-06-28 2019-08-13 北京百度网讯科技有限公司 Method for routing and device based on content
CN112688793A (en) * 2019-10-18 2021-04-20 北京字节跳动网络技术有限公司 Data packet obtaining method and device and electronic equipment
CN112688793B (en) * 2019-10-18 2023-01-03 北京字节跳动网络技术有限公司 Data packet obtaining method and device and electronic equipment
CN110825453A (en) * 2019-10-25 2020-02-21 中盈优创资讯科技有限公司 Data processing method and device based on big data platform
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
CN111858083A (en) * 2019-12-30 2020-10-30 北京嘀嘀无限科技发展有限公司 Remote service calling method and device, electronic equipment and storage medium
CN111309498A (en) * 2020-02-13 2020-06-19 山东汇贸电子口岸有限公司 Request processing method, device and computer readable medium
CN111309498B (en) * 2020-02-13 2023-09-15 山东汇贸电子口岸有限公司 Request processing method, apparatus and computer readable medium
CN111385147A (en) * 2020-03-06 2020-07-07 腾讯科技(深圳)有限公司 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
CN112351059A (en) * 2020-07-30 2021-02-09 中兴通讯股份有限公司 Request processing method and device, electronic equipment and computer-readable storage medium
CN112073420A (en) * 2020-09-11 2020-12-11 杭州安恒信息技术股份有限公司 Network protocol analysis method, device and related equipment
CN112181519A (en) * 2020-09-25 2021-01-05 中国建设银行股份有限公司 Data processing method, device, equipment and storage medium
CN112383434A (en) * 2020-11-17 2021-02-19 Oppo广东移动通信有限公司 Interface simulation method and device for network request, electronic 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
CN112597000A (en) * 2020-12-09 2021-04-02 山东浪潮通软信息科技有限公司 WebScoket protocol-based automatic testing method for instant messaging software
CN113328913A (en) * 2021-05-31 2021-08-31 长沙市到家悠享家政服务有限公司 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
CN114567621A (en) * 2022-04-29 2022-05-31 成都瑞华康源科技有限公司 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

Also Published As

Publication number Publication date
CN108897691B (en) 2022-02-15

Similar Documents

Publication Publication Date Title
CN108897691A (en) Data processing method, device, server and medium based on interface analog service
US8079017B2 (en) Automated QS interface testing framework
CN111316279A (en) Computer-implemented system and method for connecting a blockchain with a digital twin set
CN111045756B (en) Method, apparatus, computing device and medium for generating interface service
CN110083543A (en) Regression testing method, device, electronic equipment and storage medium
CN110661776B (en) Sensitive data tracing method, device, security gateway and system
CN108459850B (en) Method, device and system for generating test script
CN104468655B (en) The method and system tested reverse proxy software
CN110377429A (en) A kind of control method, device, server and storage medium that real-time task calculates
CN113641591B (en) Test case generation method and device and test method and device
CN109522228A (en) Interface automatic test data configuration method, apparatus, platform and storage medium
CN112732572A (en) Service testing method, device and system, storage medium and electronic device
CN110413971A (en) Information processing method, device, terminal and the server of online document
CN113806037A (en) Service calling method and device, storage medium and electronic equipment
CN110059011A (en) Interface test method, device, medium and electronic equipment
CN114189553A (en) Flow playback method, system and computing equipment
US9398041B2 (en) Identifying stored vulnerabilities in a web service
CN111078529B (en) Client writing module testing method and device and electronic equipment
WO2023124314A1 (en) Micro-service test method and system for hybrid cpu architecture device, and related apparatus
CN110362294A (en) Development task executes method, apparatus, electronic equipment and storage medium
CN114677138A (en) Data processing method, data processing equipment and computer readable storage medium
CN116521509A (en) Intelligent contract testing method, device, equipment, storage medium and product
CN110262856A (en) A kind of application data acquisition method, device, terminal and storage medium
CN108170557B (en) Method and apparatus for outputting information
WO2020088087A1 (en) Method and device for testing application program interface (api)

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