CN109739656A - Interface data analogy method, device, storage medium and electronic equipment - Google Patents

Interface data analogy method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN109739656A
CN109739656A CN201811446132.1A CN201811446132A CN109739656A CN 109739656 A CN109739656 A CN 109739656A CN 201811446132 A CN201811446132 A CN 201811446132A CN 109739656 A CN109739656 A CN 109739656A
Authority
CN
China
Prior art keywords
interface
target
mock
data
target interface
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
CN201811446132.1A
Other languages
Chinese (zh)
Other versions
CN109739656B (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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201811446132.1A priority Critical patent/CN109739656B/en
Publication of CN109739656A publication Critical patent/CN109739656A/en
Application granted granted Critical
Publication of CN109739656B publication Critical patent/CN109739656B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

This disclosure relates to a kind of interface data analogy method, device, storage medium and electronic equipment, this method comprises: according to the input parameter for calling direction target interface to send, the call request to the target interface is initiated, which connect with the operation system for having target service function;After initiating the call request, by being explained towards simulation Mock subsidiary on the tangent plane programming AOP technical intercept target interface under preset frame, to obtain target data, which is that the analogue data of the corresponding business datum of target service function generated is explained by the Mock;The target data is back to the called side by the target interface.It can be simulated and be exported according to the business datum that interface function directly returns to interface, while reducing influence of the single face development progress to whole development progress, the step of simulating to interface itself is avoided, workload needed for reducing maintenance analog interface improves whole development efficiency.

Description

Interface data analogy method, device, storage medium and electronic equipment
Technical field
This disclosure relates to network development field, and in particular, to a kind of interface data analogy method, device, storage medium And electronic equipment.
Background technique
In network development of today (for example, Java Web is developed), developer increasingly tends to front and back end separation Development scheme.Specifically, rear end (also known as server-side) only provides the processing of service logic, and externally provides service interface.And it is preceding End obtains data by the interface for calling server-side to provide, and is showed by page user oriented.It can also pass through in many cases, The interface that operation system externally provides is completed integrated between multiple systems.Based on above-mentioned exploitation scene, majority of case is all The format for the interface data (input and output parameter) that server-side externally provides first is defined, and raw based on the format appointed At corresponding interface document, then by each operation system according to the exploitation of itself function of interface document complete independently.This is resulted in In above-mentioned exploitation scene, usually only after the completion of server-side interface exploitation, called side could debug it, and connect In mouth debugging process, a large amount of interface connection can be led to the problem of.
In the related technology, the influence in order to avoid single service end or operation system development progress to whole development progress, It is generally necessary to have the system of Mock function for exploitation environment configurations, then reality is simulated by the analog interface of the system creation The reception and output of the calling and data of interface.In this way, even if the function of actual interface and untapped completion, called side is still The function of oneself can be completed according to the Dynamic data exchange that analog interface exports.It, will again after the completion of the functional development of actual interface Analog interface is switched to actual interface, and then completes whole joint debugging work.But in actual operation, Mock system is still There are system building complex steps, safeguard analog interface heavy workload and the appearance when analog interface and actual interface switch over Easily there is the problems such as address error, influences the whole efficiency of network development.
Summary of the invention
To overcome the problems in correlation technique, purpose of this disclosure is to provide a kind of interface data analogy methods, dress It sets, storage medium and electronic equipment.
To achieve the goals above, according to the first aspect of the embodiments of the present disclosure, a kind of interface data analogy method is provided, The described method includes:
According to the input parameter for calling direction target interface to send, the call request to the target interface is initiated, it is described Target interface is connect with the operation system for having target service function;
After initiating the call request, by towards target described in tangent plane programming AOP technical intercept under preset frame Subsidiary simulation Mock is explained on interface, and to obtain target data, the target data is to explain to generate by the Mock The analogue data of the corresponding business datum of the target service function;
The target data is back to the called side by the target interface.
Optionally, enter ginseng in the interface sent according to called side, before triggering is to the call request of target interface, institute State method further include:
According to the target service function, the Mock is added for the target interface and is explained.
Optionally, the preset frame is Spring model-view-controller Spring MVC frame, described to initiate After the call request, by towards mould subsidiary on target interface described in tangent plane programming AOP technical intercept under preset frame Quasi- Mock is explained, to obtain target data, comprising:
After initiating the call request, detect on the target interface whether the subsidiary Mock is explained;
When detecting that the subsidiary Mock is explained on the target interface, pass through the AOP of the Spring MVC frame Mock described in technical intercept is explained;
The Mock is parsed by the AOP technology of the Spring MVC frame to explain, and to obtain the analogue data, is made For the target data.
Optionally, described according to the input parameter for calling direction target interface to send, initiate the tune to the target interface With request, comprising:
Receive the input parameter;
Determine the input parameter whether have call the target interface needed for parameter attribute, the parameter attribute packet It includes: parameter name, parameter type and request method;
When the parameter attribute needed for determining that the input parameter has the calling target interface, initiates the calling and ask It asks.
According to the second aspect of an embodiment of the present disclosure, a kind of interface data simulator is provided, described device includes:
Initiation module is requested, for according to the input parameter for calling direction target interface to send, initiation to connect the target The call request of mouth, the target interface are connect with the operation system for having target service function;
Blocking module is explained, is used for after initiating the call request, by towards tangent plane programming AOP under preset frame Subsidiary simulation Mock is explained on target interface described in technical intercept, and to obtain target data, the target data is passes through State the analogue data that Mock explains the corresponding business datum of the target service function generated;
Data return module, for the target data to be back to the called side by the target interface.
Optionally, described device further include:
Adding module is explained, for the Mock being added for the target interface and being explained according to the target service function.
Optionally, the preset frame is Spring model-view-controller Spring MVC frame, and the note is blocked Cut module, comprising:
Detection sub-module is explained, whether is attached to institute on the target interface for detecting after initiating the call request State Mock note;
It explains and intercepts submodule, for when detecting on the target interface that the subsidiary Mock is explained, by described Mock described in the AOP technical intercept of Spring MVC frame is explained;
Data acquisition submodule parses the Mock for the AOP technology by the Spring MVC frame and explains, with The analogue data is obtained, as the target data.
Optionally, the request initiation module, comprising:
Parameter receiving submodule, for receiving the input parameter;
Parameter detecting submodule, determine the input parameter whether have call the target interface needed for parameter category Property, the parameter attribute includes: parameter name, parameter type and request method;
Submodule is initiated in request, for the parameter category needed for determining that the input parameter has the calling target interface When property, the call request is initiated.
According to the third aspect of an embodiment of the present disclosure, a kind of computer readable storage medium is provided, calculating is stored thereon with Machine program realizes the interface data simulation side that embodiment of the present disclosure first aspect provides when the computer program is executed by processor The step of method.
According to a fourth aspect of embodiments of the present disclosure, a kind of electronic equipment is provided, comprising:
Memory is stored thereon with computer program;
Processor, for executing the computer program in the memory, to realize embodiment of the present disclosure first party The step of interface data analogy method that face provides.
Through the above technical solutions, the disclosure can be according to the input parameter for calling direction target interface to send, initiation pair The call request of the target interface, the target interface are connect with the operation system for having target service function;Initiating the calling After request, by being explained towards simulation Mock subsidiary on the tangent plane programming AOP technical intercept target interface under preset frame, To obtain target data, which is to explain the corresponding business datum of target service function generated by the Mock Analogue data;The target data is back to the called side by the target interface.It can be according to interface function directly to interface The business datum of return is simulated and is exported, and the same of influence of the single face development progress to whole development progress is being reduced When, the step of simulating to interface itself is avoided, workload needed for reducing maintenance analog interface improves whole development effect Rate.
Other feature and advantage of the disclosure will the following detailed description will be given in the detailed implementation section.
Detailed description of the invention
Attached drawing is and to constitute part of specification for providing further understanding of the disclosure, with following tool Body embodiment is used to explain the disclosure together, but does not constitute the limitation to the disclosure.In the accompanying drawings:
Fig. 1 is a kind of flow chart of interface data analogy method shown according to an exemplary embodiment;
Fig. 2 is the flow chart for implementing another interface data analogy method exemplified according to Fig. 1;
Fig. 3 is the flow chart for implementing a kind of note hold-up interception method exemplified according to Fig.2,;
Fig. 4 is the flow chart for implementing a kind of call request initiating method exemplified according to Fig.2,;
Fig. 5 is a kind of block diagram of interface data simulator shown according to an exemplary embodiment;
Fig. 6 is the block diagram for implementing another interface data simulator exemplified according to Fig.5,;
Fig. 7 is the block diagram for implementing a kind of note blocking module exemplified according to Fig.6,;
Fig. 8 is the block diagram for implementing a kind of request initiation module exemplified according to Fig.6,;
Fig. 9 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
Fig. 1 is a kind of flow chart of interface data analogy method shown according to an exemplary embodiment, as shown in Figure 1, This method comprises:
Step 101, according to the input parameter for calling direction target interface to send, the calling of the target interface is asked in initiation It asks.
Wherein, which connect with the operation system for having target service function.
By taking the target service function is searching user's information as an example, at this point, the target interface is using User ID as input Parameter and using the corresponding user information of the User ID as the interface of output parameter.The direction target interface is being called to input one After User ID, parameter name, parameter type and the request method of the User ID to this input is needed to detect, and in the use When family ID meets the parameter attribute that the target interface defines, call request is initiated.It should be noted that the operation system is network A part of exploration project, the network development project are the integrated of multiple operation systems.Also, set herein the operation system this When and do not complete exploitation, i.e., can not realize the target service function by the calling of the target interface and outputting and inputting for parameter Energy.
Step 102, after initiating the call request, by being somebody's turn to do towards tangent plane programming AOP technical intercept under preset frame Subsidiary simulation Mock is explained on target interface, to obtain target data.
Wherein, which is to explain the corresponding business number of the target service function generated by the Mock (simulation) According to analogue data.The preset frame can be Spring MVC (Model-View-Controller, model-view-control structure Device) frame.The data format of above-mentioned input parameter and the target data is JSON (JavaScript Object Notation, JavaScript object numbered musical notation) format.Mock note can directly support JSON format string.It should Spring MVC frame itself is capable of providing AOP (Aspect Oriented Programming, towards tangent plane programming) technology, The various pieces of service logic can be isolated using the AOP technology, so that the coupling between service logic each section Right reduction improves the reusability of program.In the embodiments of the present disclosure, which can be according to code function to code Carry out fragment interception.
Still by taking the target service function is searching user's information as an example, the target interface that subsidiary Mock is explained can be indicated Are as follows:
Wherein, " public Map<String, Object>getUser (String userId) " is the target interface Parameter attribute definition, the position of " return null " are to be attached after the completion of operation system is developed with the target interface The return value of interface (in the embodiments of the present disclosure, is defined as " return null " to be intended to avoid unfinished business system by position System adverse effect caused by explaining interception process).In addition, "@Mock (" { " code ": " 0 ", " name ": " Three ", " mobile ": " 18611112222 " ") " be that above-mentioned Mock is explained.It is understood that the Mock is explained Detection and the practical detection for above-mentioned "@Mock () " character of interception, and the content in the bracket of "@Mock () " character is For the business datum that will be exported with JSON format.
In addition, the target data of the JSON format generated according to the note are as follows:
The user informations such as Customs Assigned Number, address name and telephone number therein are to input corresponding to parameter " User ID " Output parameter.It is understood that these output parameters are not to be exported by interface, but according to attached on the target interface The Mock note of band simulates next.
Step 103, which is back to by the called side by the target interface.
In conclusion the disclosure can connect the target according to the input parameter for calling direction target interface to send, initiation The call request of mouth, the target interface are connect with the operation system for having target service function;After initiating the call request, By being explained towards simulation Mock subsidiary on the tangent plane programming AOP technical intercept target interface under preset frame, to obtain mesh Data are marked, which is that the simulation number of the corresponding business datum of target service function generated is explained by the Mock According to;The target data is back to the called side by the target interface.Directly interface can be returned according to interface function Business datum is simulated and is exported, and while reducing influence of the single face development progress to whole development progress, is avoided The step of simulating to interface itself, workload needed for reducing maintenance analog interface, improves whole development efficiency.
Fig. 2 is the flow chart for implementing another interface data analogy method exemplified according to Fig. 1, as shown in Fig. 2, Before step 101, this method can also include:
Step 104, according to the target service function, the Mock is added for the target interface and is explained.
Illustratively, it before the business datum exported by step 101-103 to target interface is simulated, needs for institute There is the operation system interface addition Mock that exploitation is completed not yet to explain.Added Mock, which is explained, to be needed with the corresponding industry of interface Business function is foundation, and guarantees that the data format of the data simulated is consistent with the data format that operation system exports.
Fig. 3 is the flow chart for implementing a kind of note hold-up interception method exemplified according to Fig.2, as shown in figure 3, above-mentioned step Rapid 102 may include:
Step 1021, it after initiating the call request, detects and whether is attached to Mock note on the target interface.
Illustratively, when detecting on the target interface that the subsidiary Mock is explained, can continue step 1022 and 1023, to obtain the target data of interface return;When detecting that not being attached to the Mock on the target interface explains, Ke Yitong The corresponding operation system of the target interface is crossed, actual business datum is generated according to the input parameter, and pass through the target interface Return to the actual business datum.In fact, in the embodiments of the present disclosure, the interface of each untapped completion of operation system can It is added Mock note, and the output parameter of the interface of the untapped completion of operation system is generally defined as null value.Therefore, for It is returned herein in the interface of the untapped completion of operation system when detecting that not being attached to the Mock on the target interface explains Actual business datum is null value.
Step 1022, when detecting that the subsidiary Mock is explained on the target interface, pass through the Spring MVC frame The AOP technical intercept Mock is explained.
Step 1023, it parses the Mock by the AOP technology of the Spring MVC frame to explain, to obtain the simulation number According to as the target data.
Fig. 4 is the flow chart for implementing a kind of call request initiating method exemplified according to Fig.2, as shown in figure 4, on Stating step 101 may include:
Step 1011, the input parameter is received.
Step 1012, determine the input parameter whether have call the target interface needed for parameter attribute.
Wherein, which includes: parameter name, parameter type and request method.
Step 1013, when the parameter attribute needed for determining that the input parameter has the calling target interface, the tune is initiated With request.
Illustratively, when interface is the normal interface connecting with the operation system for having developed completion, the parameter of script is inputted The function that the actually included parameter attribute to input parameter is detected during target interface, it is still, above-mentioned Target data not necessarily passes through what the target interface directly exported, and may be to explain directly simulation according to Mock to generate (being not through the parameter attribute verification of interface), therefore, when receiving the input parameter, needs the parameter to input parameter Attribute is detected, with ensure the input parameter be and the matched input parameter of the target interface.
In conclusion the disclosure can connect the target according to the input parameter for calling direction target interface to send, initiation The call request of mouth, the target interface are connect with the operation system for having target service function;After initiating the call request, By being explained towards simulation Mock subsidiary on the tangent plane programming AOP technical intercept target interface under preset frame, to obtain mesh Data are marked, which is that the simulation number of the corresponding business datum of target service function generated is explained by the Mock According to;The target data is back to the called side by the target interface.Directly interface can be returned according to interface function Business datum is simulated and is exported, and while reducing influence of the single face development progress to whole development progress, is avoided The step of simulating to interface itself, workload needed for reducing maintenance analog interface, improves whole development efficiency.
Fig. 5 is a kind of block diagram of interface data simulator shown according to an exemplary embodiment, as shown in figure 5, should Device 500 includes:
Initiation module 510 is requested, for according to the input parameter for calling direction target interface to send, initiation to connect the target The call request of mouth, the target interface are connect with the operation system for having target service function;
Blocking module 520 is explained, is used for after initiating the call request, by towards tangent plane programming under preset frame Subsidiary simulation Mock is explained on the AOP technical intercept target interface, and to obtain target data, which is to pass through this Mock explains the analogue data of the corresponding business datum of target service function generated;
Data return module 530, for the target data to be back to the called side by the target interface.
Fig. 6 is the block diagram for implementing another interface data simulator exemplified according to Fig.5, as shown in fig. 6, should Device 500 further include:
Adding module 540 is explained, for the Mock being added for the target interface and being explained according to the target service function.
Fig. 7 is the block diagram for implementing a kind of note blocking module exemplified according to Fig.6, as shown in fig. 7, the default frame Frame is Spring model-view-controller Spring MVC frame, the note blocking module 520, comprising:
Detection sub-module 521 is explained, whether incidentally should on the target interface for detecting after initiating the call request Mock is explained;
It explains and intercepts submodule 522, for when detecting on the target interface that the subsidiary Mock is explained, by this The AOP technical intercept of the Spring MVC frame Mock is explained;
Data acquisition submodule 523 is explained for parsing the Mock by the AOP technology of the Spring MVC frame, with The analogue data is obtained, as the target data.
Fig. 8 is the block diagram for implementing a kind of request initiation module exemplified according to Fig.6, as shown in figure 8,
The request initiation module, comprising:
Parameter receiving submodule, for receiving the input parameter;
Parameter detecting submodule, determine the input parameter whether have call the target interface needed for parameter attribute, should Parameter attribute includes: parameter name, parameter type and request method;
Submodule is initiated in request, for the parameter attribute needed for determining that the input parameter has the calling target interface When, initiate the call request.
In conclusion the disclosure can connect the target according to the input parameter for calling direction target interface to send, initiation The call request of mouth, the target interface are connect with the operation system for having target service function;After initiating the call request, By being explained towards simulation Mock subsidiary on the tangent plane programming AOP technical intercept target interface under preset frame, to obtain mesh Data are marked, which is that the simulation number of the corresponding business datum of target service function generated is explained by the Mock According to;The target data is back to the called side by the target interface.Directly interface can be returned according to interface function Business datum is simulated and is exported, and while reducing influence of the single face development progress to whole development progress, is avoided The step of simulating to interface itself, workload needed for reducing maintenance analog interface, improves whole development efficiency.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
Fig. 9 is the block diagram of a kind of electronic equipment 900 shown according to an exemplary embodiment.As shown in figure 9, the electronics is set Standby 900 may include: processor 901, memory 902, multimedia component 903, input/output (I/O) interface 904, Yi Jitong Believe component 905.
Wherein, processor 901 is used to control the integrated operation of the electronic equipment 900, to complete above-mentioned interface data mould All or part of the steps in quasi- method.Memory 902 is for storing various types of data to support in the electronic equipment 900 Operation, these data for example may include the finger of any application or method for operating on the electronic equipment 900 Order and the relevant data of application program, such as contact data, the message of transmitting-receiving, picture, audio, video etc..The storage Device 902 can be realized by any kind of volatibility or non-volatile memory device or their combination, such as static random It accesses memory (Static Random Access Memory, abbreviation SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, abbreviation EEPROM), erasable programmable Read-only memory (Erasable Programmable Read-Only Memory, abbreviation EPROM), programmable read only memory (Programmable Read-Only Memory, abbreviation PROM), and read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or CD.Multimedia component 903 may include screen and audio component.Wherein Screen for example can be touch screen, and audio component is used for output and/or input audio signal.For example, audio component may include One microphone, microphone is for receiving external audio signal.The received audio signal can be further stored in storage Device 902 is sent by communication component 905.Audio component further includes at least one loudspeaker, is used for output audio signal.I/O Interface 904 provides interface between processor 901 and other interface modules, other above-mentioned interface modules can be keyboard, mouse, Button etc..These buttons can be virtual push button or entity button.Communication component 905 is for the electronic equipment 900 and other Wired or wireless communication is carried out between equipment.Wireless communication, such as Wi-Fi, bluetooth, near-field communication (Near Field Communication, abbreviation NFC), 2G, 3G or 4G or they one or more of combination, therefore corresponding communication Component 905 may include: Wi-Fi module, bluetooth module, NFC module.
In one exemplary embodiment, electronic equipment 900 can be by one or more application specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), digital signal processor (Digital Signal Processor, abbreviation DSP), digital signal processing appts (Digital Signal Processing Device, Abbreviation DSPD), programmable logic device (Programmable Logic Device, abbreviation PLD), field programmable gate array (Field Programmable Gate Array, abbreviation FPGA), controller, microcontroller, microprocessor or other electronics member Part is realized, for executing above-mentioned interface data analogy method.
In a further exemplary embodiment, a kind of computer readable storage medium including program instruction, example are additionally provided It such as include the memory 902 of program instruction, above procedure instruction can be executed by the processor 901 of electronic equipment 900 on to complete The interface data analogy method stated.
The preferred embodiment of the disclosure is described in detail in conjunction with attached drawing above, still, the disclosure is not limited to above-mentioned reality The detail in mode is applied, in the range of the technology design of the disclosure, those skilled in the art are considering specification and practice After the disclosure, it is readily apparent that other embodiments of the disclosure, belongs to the protection scope of the disclosure.
It is further to note that specific technical features described in the above specific embodiments, in not lance In the case where shield, it can be combined in any appropriate way.Simultaneously between a variety of different embodiments of the disclosure Any combination can also be carried out, as long as it, without prejudice to the thought of the disclosure, equally should be considered as disclosure disclosure of that. The disclosure is not limited to the precision architecture being described above out, and the scope of the present disclosure is only limited by the attached claims System.

Claims (10)

1. a kind of interface data analogy method, which is characterized in that the described method includes:
According to the input parameter for calling direction target interface to send, the call request to the target interface, the target are initiated Interface is connect with the operation system for having target service function;
After initiating the call request, by towards target interface described in tangent plane programming AOP technical intercept under preset frame Upper subsidiary simulation Mock is explained, and to obtain target data, the target data is to be explained described in generation by the Mock The analogue data of the corresponding business datum of target service function;
The target data is back to the called side by the target interface.
2. the method according to claim 1, wherein entering ginseng, triggering in the interface sent according to called side Before the call request of target interface, the method also includes:
According to the target service function, the Mock is added for the target interface and is explained.
3. the method according to claim 1, wherein the preset frame is Spring model-view-controller Spring MVC frame, it is described after initiating the call request, by being blocked towards tangent plane programming AOP technology under preset frame It cuts simulation Mock subsidiary on the target interface to explain, to obtain target data, comprising:
After initiating the call request, detect on the target interface whether the subsidiary Mock is explained;
When detecting that the subsidiary Mock is explained on the target interface, pass through the AOP technology of the Spring MVC frame The Mock is intercepted to explain;
It parses the Mock by the AOP technology of the Spring MVC frame to explain, to obtain the analogue data, as institute State target data.
4. the method according to claim 1, wherein described join according to the input for calling direction target interface to send Number initiates the call request to the target interface, comprising:
Receive the input parameter;
Determine the input parameter whether have call the target interface needed for parameter attribute, the parameter attribute includes: Parameter name, parameter type and request method;
When the parameter attribute needed for determining that the input parameter has the calling target interface, the call request is initiated.
5. a kind of interface data simulator, which is characterized in that described device includes:
Initiation module is requested, for initiating to the target interface according to the input parameter for calling direction target interface to send Call request, the target interface are connect with the operation system for having target service function;
Blocking module is explained, is used for after initiating the call request, by towards tangent plane programming AOP technology under preset frame It intercepts simulation Mock subsidiary on the target interface to explain, to obtain target data, the target data is by described Mock explains the analogue data of the corresponding business datum of the target service function generated;
Data return module, for the target data to be back to the called side by the target interface.
6. device according to claim 5, which is characterized in that described device further include:
Adding module is explained, for the Mock being added for the target interface and being explained according to the target service function.
7. device according to claim 5, which is characterized in that the preset frame is Spring model-view-controller Spring MVC frame, the note blocking module, comprising:
Detection sub-module is explained, it is whether subsidiary described on the target interface for detecting after initiating the call request Mock is explained;
It explains and intercepts submodule, for when detecting on the target interface that the subsidiary Mock is explained, by described Mock described in the AOP technical intercept of Spring MVC frame is explained;
Data acquisition submodule parses the Mock for the AOP technology by the Spring MVC frame and explains, to obtain The analogue data, as the target data.
8. device according to claim 5, which is characterized in that the request initiation module, comprising:
Parameter receiving submodule, for receiving the input parameter;
Parameter detecting submodule, determine the input parameter whether have call the target interface needed for parameter attribute, institute Stating parameter attribute includes: parameter name, parameter type and request method;
Submodule is initiated in request, for the parameter attribute needed for determining that the input parameter has the calling target interface When, initiate the call request.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt The step of any one of claim 1-4 the method is realized when processor executes.
10. a kind of electronic equipment characterized by comprising
Memory is stored thereon with computer program;
Processor, for executing the computer program in the memory, to realize described in any one of claim 1-4 The step of method.
CN201811446132.1A 2018-11-29 2018-11-29 Interface data simulation method and device, storage medium and electronic equipment Active CN109739656B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811446132.1A CN109739656B (en) 2018-11-29 2018-11-29 Interface data simulation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811446132.1A CN109739656B (en) 2018-11-29 2018-11-29 Interface data simulation method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN109739656A true CN109739656A (en) 2019-05-10
CN109739656B CN109739656B (en) 2020-11-27

Family

ID=66358307

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811446132.1A Active CN109739656B (en) 2018-11-29 2018-11-29 Interface data simulation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN109739656B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110147326A (en) * 2019-05-23 2019-08-20 四川新网银行股份有限公司 Micro services automated testing method based on Redis database
CN110460583A (en) * 2019-07-15 2019-11-15 中国平安人寿保险股份有限公司 A kind of sensitive information recording method and device, electronic equipment
CN110502224A (en) * 2019-08-22 2019-11-26 深圳前海环融联易信息科技服务有限公司 Interface analogy method, device and computer equipment based on HTTP request
CN110515962A (en) * 2019-08-30 2019-11-29 北京三快在线科技有限公司 Data cached method, apparatus, electronic equipment and storage medium
CN111400178A (en) * 2020-03-13 2020-07-10 深圳前海环融联易信息科技服务有限公司 Automatic interface number making method and device, computer equipment and storage medium
CN111797020A (en) * 2020-07-03 2020-10-20 北京每日优鲜电子商务有限公司 Mock data method and device based on dynamic bytecode
CN111831277A (en) * 2020-09-21 2020-10-27 腾讯科技(深圳)有限公司 Virtual data generation method, device, equipment and computer readable storage medium
CN112241332A (en) * 2019-07-16 2021-01-19 北京京东振世信息技术有限公司 Interface compensation method and device
CN113722020A (en) * 2020-05-26 2021-11-30 腾讯科技(深圳)有限公司 Interface calling method, device and computer readable storage medium
CN115344502A (en) * 2022-10-18 2022-11-15 中建电子商务有限责任公司 Method for automatically generating mock data and automatically loading mock data based on real data

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8291375B2 (en) * 2004-03-29 2012-10-16 Sybase, Inc. Attribute-based component programming system and methodology for object-oriented languages
CN102902619A (en) * 2011-07-29 2013-01-30 阿里巴巴集团控股有限公司 Method and device for regression testing of Web application programs
US20150074647A1 (en) * 2012-04-20 2015-03-12 Doron Levi Testing system for an integrated software system
CN105389256A (en) * 2015-11-11 2016-03-09 中国建设银行股份有限公司 Unit testing method and system
CN106528393A (en) * 2015-09-09 2017-03-22 北京京东尚科信息技术有限公司 Method and device for Mock testing of WebService
CN107179984A (en) * 2016-03-10 2017-09-19 北京京东尚科信息技术有限公司 A kind of interface mock methods and interface test method
CN107220169A (en) * 2016-03-21 2017-09-29 阿里巴巴集团控股有限公司 A kind of emulating server returns to the method and apparatus for customizing data
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8291375B2 (en) * 2004-03-29 2012-10-16 Sybase, Inc. Attribute-based component programming system and methodology for object-oriented languages
CN102902619A (en) * 2011-07-29 2013-01-30 阿里巴巴集团控股有限公司 Method and device for regression testing of Web application programs
US20150074647A1 (en) * 2012-04-20 2015-03-12 Doron Levi Testing system for an integrated software system
CN106528393A (en) * 2015-09-09 2017-03-22 北京京东尚科信息技术有限公司 Method and device for Mock testing of WebService
CN105389256A (en) * 2015-11-11 2016-03-09 中国建设银行股份有限公司 Unit testing method and system
CN107179984A (en) * 2016-03-10 2017-09-19 北京京东尚科信息技术有限公司 A kind of interface mock methods and interface test method
CN107220169A (en) * 2016-03-21 2017-09-29 阿里巴巴集团控股有限公司 A kind of emulating server returns to the method and apparatus for customizing data
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
孟燕,: "自动化测试技术中Mock框架的建设与应用", 《武汉理工大学学报(自然科学版)》 *
李媛媛,等;: "应用AOP提高软件代码质量的研究", 《太原理工大学学报》 *
潘诗瑶,等;: "Web应用***中的MOCK测试技术", 《软件》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110147326A (en) * 2019-05-23 2019-08-20 四川新网银行股份有限公司 Micro services automated testing method based on Redis database
CN110460583A (en) * 2019-07-15 2019-11-15 中国平安人寿保险股份有限公司 A kind of sensitive information recording method and device, electronic equipment
CN110460583B (en) * 2019-07-15 2022-06-03 中国平安人寿保险股份有限公司 Sensitive information recording method and device and electronic equipment
CN112241332B (en) * 2019-07-16 2023-09-22 北京京东振世信息技术有限公司 Interface compensation method and device
CN112241332A (en) * 2019-07-16 2021-01-19 北京京东振世信息技术有限公司 Interface compensation method and device
CN110502224A (en) * 2019-08-22 2019-11-26 深圳前海环融联易信息科技服务有限公司 Interface analogy method, device and computer equipment based on HTTP request
CN110515962A (en) * 2019-08-30 2019-11-29 北京三快在线科技有限公司 Data cached method, apparatus, electronic equipment and storage medium
CN111400178A (en) * 2020-03-13 2020-07-10 深圳前海环融联易信息科技服务有限公司 Automatic interface number making method and device, computer equipment and storage medium
CN113722020A (en) * 2020-05-26 2021-11-30 腾讯科技(深圳)有限公司 Interface calling method, device and computer readable storage medium
WO2021238596A1 (en) * 2020-05-26 2021-12-02 腾讯科技(深圳)有限公司 Interface calling method and apparatus, and computer-readable storage medium
US11809882B2 (en) 2020-05-26 2023-11-07 Tencent Technology (Shenzhen) Company Limited Interface calling method and apparatus, and computer-readable storage medium
CN113722020B (en) * 2020-05-26 2024-06-11 腾讯科技(深圳)有限公司 Interface calling method, device and computer readable storage medium
CN111797020A (en) * 2020-07-03 2020-10-20 北京每日优鲜电子商务有限公司 Mock data method and device based on dynamic bytecode
CN111831277A (en) * 2020-09-21 2020-10-27 腾讯科技(深圳)有限公司 Virtual data generation method, device, equipment and computer readable storage medium
CN115344502A (en) * 2022-10-18 2022-11-15 中建电子商务有限责任公司 Method for automatically generating mock data and automatically loading mock data based on real data
CN115344502B (en) * 2022-10-18 2023-03-10 中建电子商务有限责任公司 Method for automatically generating mock data and automatically loading mock data based on real data

Also Published As

Publication number Publication date
CN109739656B (en) 2020-11-27

Similar Documents

Publication Publication Date Title
CN109739656A (en) Interface data analogy method, device, storage medium and electronic equipment
US10467127B2 (en) Unified UI/UX and API testing of web applications
CN108345531B (en) Test method, device and system
CN105827683A (en) Data synchronization method, server and electronic device
CN107613118A (en) A kind of method, apparatus, mobile terminal and storage medium for opening shortcut function
CN111506579B (en) Method, program and equipment for generating intelligent contract code
WO2020211360A1 (en) Mock test method and system, electronic device, and computer non-volatile readable storage medium
WO2022095412A1 (en) Microservice development method and apparatus, storage medium, and electronic device
CN109800135A (en) A kind of information processing method and terminal
CN111538659B (en) Interface testing method, system, electronic equipment and storage medium of business scene
CN107203465A (en) System interface method of testing and device
US20170185422A1 (en) Method and system for generating and controlling composite user interface control
CN113127108A (en) Service request processing method and device, storage medium and electronic equipment
CN111125602B (en) Page construction method, device, equipment and storage medium
TW202226099A (en) Payment function activation method, terminal device, server, system, and storage medium
CN111813407B (en) Game development method, game running device and electronic equipment
CN111026651A (en) Test method, test device, storage medium and electronic equipment
CN113626321B (en) Bridging test method, device, system and storage medium
KR20100056337A (en) Device for generating a script for menu test, menu test automatic system having the same, and method thereof
CN105979021B (en) A kind of information processing method and user terminal
CN111026800B (en) Data export method and device, electronic equipment and storage medium
US20170286074A1 (en) Electronic Device and Method for Multiple Compiling Platforms
CN108563578A (en) SDK compatibility detection method, device, equipment and readable storage medium
KR102031810B1 (en) System and method for providing service menu based on application service, and apparatus applied to the same
CN112214404A (en) Mobile application testing method and device, 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