CN108600255A - Mock service management method, device, computer equipment and storage medium - Google Patents
Mock service management method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN108600255A CN108600255A CN201810427435.2A CN201810427435A CN108600255A CN 108600255 A CN108600255 A CN 108600255A CN 201810427435 A CN201810427435 A CN 201810427435A CN 108600255 A CN108600255 A CN 108600255A
- Authority
- CN
- China
- Prior art keywords
- mock
- business end
- key
- service
- platforms
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
Abstract
The embodiment of the invention discloses a kind of Mock service management method, device, computer equipment and storage mediums, wherein the method includes:If receiving the access request from business end, key corresponding with the access request is generated;The key is assembled into URL link, and the URL link is sent to business end;The incidence relation between Mock platforms and business end is established according to the URL link, the incidence relation includes the correspondence of Mock platforms and business end;If receiving the Mock service request at business end, the Mock service in the Mock platforms is sent to by business end according to the incidence relation.The embodiment of the present invention can realize the interaction of Mock platforms and business end, and simplify interactive operation, improve the usage experience of user.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of Mock service management method, device, computer to set
Standby and storage medium.
Background technology
In the prior art, Mock platforms and the interaction at business end are not gone to complete there are one complete exchange method,
If by the way that manually the related Mock service on Mock platforms were replicated one by one and when being sent to business end, usual interactive operation
Can be very cumbersome, interactive efficiency is relatively low, and with the continuous innovation of technology, the portfolio at business end constantly increases, traditional
Interactive mode cannot meet business demand and development instantly.
Invention content
In view of this, the embodiment of the present invention provides a kind of Mock service management method, device, computer equipment and deposits
Storage media can realize the interaction of Mock platforms and business end, and simplify interactive operation, improve the usage experience of user.
On the one hand, an embodiment of the present invention provides a kind of Mock service management method, the application scenarios packets of this method application
Mock platforms and business end are included, carrying out practically includes in Mock platforms, this method:
If receiving the access request from business end, key corresponding with the access request is generated;
The key is assembled into URL link, and the URL link is sent to business end;
The incidence relation between Mock platforms and business end is established according to the URL link, the incidence relation includes
The correspondence of Mock platforms and business end;
If the Mock service request at business end is received, according to the incidence relation by the Mock in the Mock platforms
Service is sent to business end.
On the other hand, an embodiment of the present invention provides a kind of Mock service managing device, described device includes:
If generation unit generates corresponding with the access request for receiving the access request from business end
Key;
The URL link for the key to be assembled into URL link, and is sent to business end by module units;
Unit is established, it is described for establishing the incidence relation between Mock platforms and business end according to the URL link
Incidence relation includes the correspondence of Mock platforms and business end;
Transmission unit, if the Mock service for receiving business end is asked, according to the incidence relation by the Mock
Mock service in platform is sent to business end.
Another aspect, the embodiment of the present invention additionally provide a kind of computer equipment, including memory, processor and storage
On the memory and the computer program that can run on the processor, the processor execute the computer journey
Mock service management method as described above is realized when sequence.
It is described computer-readable to deposit in another aspect, the embodiment of the present invention additionally provides a kind of computer readable storage medium
Storage media storage there are one either more than one program the one or more programs can by one or one with
On processor execute, to realize Mock service management method as described above.
A kind of Mock service management method of offer of the embodiment of the present invention, device, computer equipment and storage medium,
Middle method includes:If receiving the access request from business end, key corresponding with the access request is generated;By institute
It states key and is assembled into URL link, and the URL link is sent to business end;According to the URL link establish Mock platforms with
Incidence relation between business end, the incidence relation include the correspondence of Mock platforms and business end;If receiving business
The Mock service at end is asked, and the Mock service in the Mock platforms is sent to business end according to the incidence relation.This hair
Bright embodiment can realize the interaction of Mock platforms and business end, and simplify interactive operation, improve the usage experience of user.
Description of the drawings
Technical solution in order to illustrate the embodiments of the present invention more clearly, required use in being described below to embodiment
Attached drawing be briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, for ability
For the those of ordinary skill of domain, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 is a kind of schematic flow diagram of Mock service management method provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic flow diagram of Mock service management method provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic flow diagram of Mock service management method provided in an embodiment of the present invention;
Fig. 4 is a kind of schematic flow diagram of Mock service management method provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic block diagram of Mock service managing device provided in an embodiment of the present invention;
Fig. 6 is a kind of another schematic block diagram of Mock service managing device provided in an embodiment of the present invention;
Fig. 7 is a kind of another schematic block diagram of Mock service managing device provided in an embodiment of the present invention;
Fig. 8 is a kind of another schematic block diagram of Mock service managing device provided in an embodiment of the present invention;
Fig. 9 is a kind of another schematic block diagram of Mock service managing device provided in an embodiment of the present invention;
Figure 10 is a kind of another schematic block diagram of Mock service managing device provided in an embodiment of the present invention;
Figure 11 is a kind of structure composition schematic diagram of computer equipment provided in an embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other reality obtained by those of ordinary skill in the art without making creative efforts
Example is applied, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " comprising " and "comprising" instruction
Described feature, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature,
Entirety, step, operation, element, component and/or its presence or addition gathered.
It is also understood that the term used in this description of the invention is merely for the sake of description specific embodiment
Purpose and be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless
Context clearly indicates other situations, and otherwise " one " of singulative, "one" and "the" are intended to include plural form.
Referring to Fig. 1, Fig. 1 is a kind of schematic flow diagram of Mock service management method provided in an embodiment of the present invention.It should
The application scenarios of method application include Mock platforms and business end, and carrying out practically is in Mock platforms, and specifically, this method can be with
Operate in smart mobile phone (such as Android phone, IOS mobile phones), tablet computer, laptop and smart machine etc. eventually
In end.Mock service management method described in the embodiment of the present invention can realize the interaction of Mock platforms and business end, and
Simplify interactive operation, improves the usage experience of user.Fig. 1 is showing for Mock service management method provided in an embodiment of the present invention
Meaning flow chart.As shown, the method comprising the steps of S101~S104.
S101 generates key corresponding with the access request if receiving the access request from business end.
In embodiments of the present invention, which is specially the port address that business end is sent out, which can
Think that address code, Mock platforms receive the access request from business end, as Mock platforms receive the port from business end
Address;If Mock platforms receive the port address from business end, key is generated according to the port address, the key is by feature
Information and feature random number sequence composition, wherein believe the port address from business end as the feature of generated key
Breath will be used as the feature random number of generated key by presetting the random number that feature random number sequence generating algorithm is generated
Then characteristic information and feature random number sequence are combined to generate the key by sequence.
It should be noted that default feature random number sequence generating algorithm refer to 32bit RSA (Ron Rivest,
Adi Shamir, Leonard Adleman) algorithm, algorithm hypothesis A is from 2~(N-1), and C=(AEXP D) modN satisfactions are such as
Lower condition:D is prime number, and N is the product of two prime numbers (P, Q), (D*E) mod ((P-1) * (Q-1))=1, because, if C=(AEXP
D) modN then has:A=(C EXP E) modN, so, C and A is corresponded, and therefore, for A=2~(N-1), is had and is not weighed
It answers, exhaustively feature random number C sequences, for example, set N=15, P=5, Q=3, then the number that A is 2 to 14.Such as it is now to
2 to 14 feature random number sequences are generated, it is 3, E 3, C to take D2=(2EXP 3) mod 15=8, C3=(3EXP 3) mod 15
=12, C4=(4EXP 3) mod 15=4, C5=(5EXP 3) mod 15=5, C6=(6EXP 3) mod 15=6, C7=
(7EXP 3) mod 15=13, C8=(8EXP 3) mod 15=2, C9=(9EXP 3) mod 15=9, C10=(10EXP 3)
Mod 15=10, C11=(11EXP 3) mod 15=11, C12=(12EXP 3) mod 15=3,
C13=(13EXP 3) mod 15=7, C14=(14EXP 3) mod 15=14, finally obtain the random number sequence of feature
Row 812456132910113714;Wherein, business end port address is 8086, is generated and is calculated by default feature random number sequence
The feature random number for the key that method is generated finally obtains 812456132910113714, then can obtain being generated close
Key is8086812456132910113714。
In one embodiment, as shown in Fig. 2, the step S101 includes step S201~S203.
S201 receives the access request from business end according to the access interface being pre-created.
In embodiments of the present invention, which can be specially that user triggers the thing in the operation pages of business end
Part and the request generated, the request instruction include the port address at business end, which is specially the address code of port,
If the port address code at business end is 8086, specifically, can phase be set in the operation pages at the business end selected for user
The virtual control answered, user can generate the access request by virtual control set by click, and the access request is sent
To the access interface of Mock platforms, optionally, can text prompt be set on the virtual control, the text prompt, for
User prompts what function the virtual control will produce, for example, the word prompts for " generating access request ".
S202 parses the access request to obtain the port address at the business end.
In embodiments of the present invention, which includes port address, such as the access request carries port address
Information parses the access request by server, obtains port address information, which is the unique identification at business end
Mark, for distinguishing different business ends, in the present embodiment, port address is generated by server, for example, each business end
When accessing internet, a port address is generated.
S203 generates key according to obtained port address.
In embodiments of the present invention, the key is made of characteristic information and feature random number sequence, when Mock platforms connect
The port address for receiving business end will utilize default feature random number sequence using the port address as the characteristic information of key
Feature random number sequence of the number that generating algorithm is generated as key, then by characteristic information and feature random number sequence
It is combined to generate the key.
The key is assembled into URL link, and the URL link is sent to business end by S102.
In embodiments of the present invention, URL (Uniform Resource Locator, uniform resource locator) is interconnection
The address of online standard resource, there are one unique URL for each file on internet.After Mock platforms generate key, profit
The key generated is assembled into URL links with pre-set URL link format, wherein the assembling format of URL link is:
" protocol name:// host domain names/path/key ", such as by key8086812456132910113714 are assembled into URL chains
It connects, Ke Yiwei://Mock platforms domain names/path/8086812456132910113714, finally the URL link is directly sent out
It send to business end, and directly changes the specified URL link for being linked as Mock platforms at business end.
In the same embodiment, as shown in figure 3, the step S102 includes step S301~S302.
S301 extracts domain name corresponding with the key and path.
In embodiments of the present invention, the key includes keyword, which is the port address in key, described
Domain name is the domain name of the port corresponding to the port address of the key, and the path is right for the port address of the key
The path for the port answered.Wherein, domain name may include character string, which includes the length of each domain name, such as
The domain name of baidu.com is that the domain name of character string baidu, www.qq.com is character string qq etc.;The path may include
Port mac address or port IP address.
As shown in figure 4, when it is implemented, the step S301 may comprise steps of:
S301a extracts the keyword from the key.
In embodiments of the present invention, the keyword is the port address at business end in key, for example, in step S101
The key generated is8086812456132910113714, the keyword for extracting this key is8086。
S301b obtains corresponding domain name and path according to the keyword in the key.
In embodiments of the present invention, after determining corresponding port by the keyword in the key, using inquiry
The mode of address properties obtains the path of port, and the domain name of port is obtained by the way of domain name detection terminal.
S302, according to URL described in the key and the domain name corresponding with the key and path construction extracted
Link.
In embodiments of the present invention, in Mock platforms, the assembling format of URL link is " protocol name:// host domain names/
Path/key " is combined the domain name, path and the key that is generated that are extracted according to the assembling format of URL link
And obtain the URL link.
When it is implemented, the step S302 may comprise steps of:URL link is called to build interface, according to described
Preset algorithm traverses the structure URL link successively in key, domain name, path and URL link structure interface.Its
In, the preset algorithm is preset createURL algorithms, according to the key, domain name, path and the URL link
Preset createURL algorithms in interface are built, URL link is built and URL link is encapsulated into dynamicActivity classes
In, createURL algorithms are as follows:
Key, domain name and path are read according to getType from methods, a URL is created according to new Link ()
Example, it is general type that URL examples, which are arranged, by etType (Link.LinkType.STRAIGHT) method, is recycled
Read key, domain name and path are connected into created URL examples by setFromType () method, are passed through
Key, domain name and the combination condition in path in URL examples is arranged in setConstraint () method, finally by
DynamicActivity.add (this.Link) method completes the step of structure URL link.
S103 establishes the incidence relation between Mock platforms and business end, the incidence relation according to the URL link
Correspondence including Mock platforms Yu business end.
In embodiments of the present invention, Mock platforms establish incidence relation by URL link and business end, and the association is closed
System includes the correspondence of Mock platforms and business end, and by the incidence relation, Mock platforms can utilize different keys to know
Not different business ends, the incidence relation can be split specifically by by the URL link of Mock platforms, after fractionation
To " host domain names " information, " path " information, " key " information, each fractionation item is distinguished into typing business end port to realize
Mock platforms are associated with business end, when by each fractionation item typing service port and after configured respectively, Mock platforms with
Business end just forms incidence relation, optionally, can Mock platforms be arranged one it is bonded enter control, encapsulated simultaneously on the control
It is integrated with the code for splitting URL link, and is also integrated with the URL link typing business end after fractionation on the control
Code when the user clicks when the control, may be implemented key association Mock platforms and business end and form incidence relation.
S104 will be in the Mock platforms according to the incidence relation if receiving the Mock service request at business end
Mock service is sent to business end.
In embodiments of the present invention, Mock service (Mock Service) is abstracted to all remote services, wherein
Each Mock service is by there are one the versions of the version of service interface, service, service interface name and service to combine generation
The unique service of one, table;Specifically, a service interface includes one or more methods, by corresponding Mock service
It is specially to send out the service interface of Mock service, the version of service, service interface name and the version of service to be sent to business end
Business end is given, optionally, when Mock service is asked at business end, Mock platforms are by receiving service that business end is sent
Version number is to uniquely determine corresponding Mock service.
In one embodiment, as shown in figure 5, the step S104 includes step S401~S403.
S401 obtains the required Mock service version in business end if receiving the Mock service request at business end.
In embodiments of the present invention, after incidence relation is established at Mock platforms and business end, if business end is needed from Mock
Platform obtains Mock service, will send corresponding Mock service and asks to Mock platforms, required to be obtained from Mock platforms
Mock service, wherein Mock service request includes Mock service version.
S402 finds the target Mock service uniquely determined according to the Mock service version.
In embodiments of the present invention, after Mock platforms receive the Mock service version transmitted by business end, by this
Mock service version inquires Mock service corresponding thereto in Mock platform datas, specifically, corresponding on Mock platforms
In Mock service, each Mock service is by a service interface, Mock service releases, Mock service interface name and service
Version composition, Mock platforms receive business end transmission Mock service version after, inquire Mock platforms on business end send out
The Mock service version on the one-to-one platform of Mock service version sent, can be with by the Mock service version on platform
Corresponding Mock service is uniquely determined, and using the Mock service as the required target Mock service in business end.
The target Mock service is sent to business end by S403 according to the incidence relation.
As seen from the above, if the embodiment of the present invention is connect by receiving the access request from business end, generation with described
Enter and asks corresponding key;The key is assembled into URL link, and the URL link is sent to business end;According to institute
State the incidence relation of URL link foundation and business end;Mock service is sent to business end according to the incidence relation.This hair
Bright embodiment can realize the interaction of Mock platforms and business end, and simplify interactive operation, improve the usage experience of user.
Referring to Fig. 6, a kind of corresponding above-mentioned Mock service management method, the embodiment of the present invention also proposes a kind of Mock clothes
Business managing device, the device 100 include:Generation unit 101, module units 102 establish unit 103, transmission unit 104.
Wherein, if the generation unit 101 generates and the access for receiving the access request from business end
Ask corresponding key.In embodiments of the present invention, which is specially the port address that business end is sent out, should
Port address can be address code, and Mock platforms receive the access request from business end, and as Mock platforms, which receive, comes from industry
The port address at business end;If Mock platforms receive the port address from business end, key is generated according to the port address, it should
Key is made of characteristic information and feature random number sequence, wherein using the port address from business end as generated key
Characteristic information, generated key will be used as by presetting the random number that is generated of feature random number sequence generating algorithm
Then characteristic information and feature random number sequence are combined to generate the key by feature random number sequence.
It should be noted that default feature random number sequence generating algorithm refer to 32bit RSA (Ron Rivest,
Adi Shamir, Leonard Adleman) algorithm, algorithm hypothesis A is from 2~(N-1), and C=(AEXP D) modN satisfactions are such as
Lower condition:D is prime number, and N is the product of two prime numbers (P, Q), (D*E) mod ((P-1) * (Q-1))=1, because, if C=(AEXP
D) modN then has:A=(C EXP E) modN, so, C and A is corresponded, and therefore, for A=2~(N-1), is had and is not weighed
It answers, exhaustively feature random number C sequences, for example, set N=15, P=5, Q=3, then the number that A is 2 to 14.Such as it is now to
2 to 14 feature random number sequences are generated, it is 3, E 3, C to take D2=(2EXP 3) mod 15=8, C3=(3EXP 3) mod 15
=12, C4=(4EXP 3) mod 15=4, C5=(5EXP 3) mod 15=5, C6=(6EXP 3) mod 15=6, C7=
(7EXP 3) mod 15=13, C8=(8EXP 3) mod 15=2, C9=(9EXP 3) mod 15=9, C10=(10EXP 3)
Mod 15=10, C11=(11EXP 3) mod 15=11, C12=(12EXP 3) mod 15=3, C13=(13EXP 3) mod
15=7, C14=(14EXP 3) mod 15=14, finally obtain feature random number sequence 812456132910113714;Wherein,
Business end port address is8086, by the feature random number for presetting the key that feature random number sequence generating algorithm is generated
812456132910113714 are finally obtained, then generated key can be obtained being8086812456132910113714。
The URL link for the key to be assembled into URL link, and is sent to business end by module units 102.
In the embodiment of the present invention, URL (Uniform Resource Locator, uniform resource locator) is that standard provides on internet
The address in source, there are one unique URL for each file on internet.After Mock platforms generate key, using pre-setting
URL link format the key generated is assembled into URL links, wherein the assembling format of URL link is:" protocol name://
Host domain names/path/key ", such as by key8086812456132910113714 are assembled into URL link, Ke Yiwei://
Mock platforms domain names/path/8086812456132910113714, the URL link is finally sent directly to business end,
And directly change the specified URL link for being linked as Mock platforms at business end.
Unit 103 is established, for establishing the incidence relation between Mock platforms and business end, institute according to the URL link
State the correspondence that incidence relation includes Mock platforms and business end.In embodiments of the present invention, Mock platforms pass through URL chains
It connects and establishes incidence relation with business end, the incidence relation includes the correspondence of Mock platforms and business end, passes through the association
Relationship, Mock platforms can identify that different business ends, the incidence relation can be specifically by generals using different keys
The URL link of Mock platforms is split, and " host domain names " information, " path " information, " key " information are obtained after fractionation, will
Each item that splits distinguishes typing business end port to realize being associated with for Mock platforms and business end, when by each fractionation item difference
Typing service port and after being configured, Mock platforms just form incidence relation with business end, optionally, can be flat in Mock
Platform setting one it is bonded enter control, encapsulated on the control and be integrated with split URL link code, and on the control also
It is integrated with the code at the URL link typing business end after fractionation, when the user clicks when the control, key association may be implemented
Mock platforms and business end simultaneously form incidence relation.
Transmission unit 104 will be described according to the incidence relation if the Mock service for receiving business end is asked
Mock service in Mock platforms is sent to business end.In embodiments of the present invention, Mock service (Mock Service) is pair
All remote services are abstracted, wherein each Mock service is by there are one the version of service interface, service, service interface names
And the version of service combines and represents a unique service;Specifically, a service interface includes one or more
Method, it is specially by the service interface of Mock service, the version of service, clothes that corresponding Mock service, which is sent to business end,
Business interface name and the version of service are sent to business end, and optionally, when Mock service is asked at business end, Mock platforms are logical
The version number of the service of reception business end transmission is crossed to uniquely determine corresponding Mock service.
As seen from the above, if the embodiment of the present invention is connect by receiving the access request from business end, generation with described
Enter and asks corresponding key;The key is assembled into URL link, and the URL link is sent to business end;According to institute
It states URL link and establishes incidence relation between Mock platforms and business end, the incidence relation includes Mock platforms and business end
Correspondence;It, will be in the Mock platforms according to the incidence relation if receiving the Mock service request at business end
Mock service is sent to business end.The embodiment of the present invention can realize the interaction of Mock platforms and business end, and simplify interaction
Operation, improves the usage experience of user.
As shown in fig. 7, the generation unit 101, including:
Receiving unit 1011, for receiving the access request from business end according to the access interface being pre-created.At this
In inventive embodiments, which can be specially user's event of the triggering in the operation pages of business end and asking for generating
It asks, which includes the port address at business end, which is specially the address code of port, such as the end at business end
Port address code is 8086, specifically, corresponding virtual control can be arranged in the operation pages at the business end selected for user
Part, user can generate the access request by virtual control set by click, and the access request is sent to Mock platforms
Access interface optionally can text prompt be set on the virtual control, the text prompt, for prompting the user with this
Virtual control will produce any function, for example, the word prompts for " generating access request ".
Resolution unit 1012, for parsing the access request to obtain the port address at the business end.In the present invention
In embodiment, which includes port address, such as the access request carries port address information, passes through server
The access request is parsed, obtains port address information, which is the unique identifier at business end, for distinguishing not
With business end, in the present embodiment, port address is generated by server, raw for example, when each business is terminated into internet
At a port address.
Subelement 1013 is generated, for generating key according to obtained port address.In embodiments of the present invention, institute
It states key to be made of characteristic information and feature random number sequence, when Mock platforms receive the port address at business end, by the end
Characteristic information of the port address as key, using the number generated using default feature random number sequence generating algorithm as key
Feature random number sequence, then characteristic information and feature random number sequence are combined to generate the key.
As shown in figure 8, the module units 102, including:
Extraction unit 1021, for extracting domain name corresponding with the key and path.In embodiments of the present invention,
The key includes keyword, the keyword be key in port address, domain name for the key port address institute
The domain name of corresponding port, the path are the path of the port corresponding to the port address of the key.Wherein, the domain
Name may include character string, which includes the length of each domain name, such as the domain name of baidu.com is character string
The domain name of baidu, www.qq.com are character string qq etc.;The path may include port mac address or Port IP
Location.As shown in figure 9, when it is implemented, the extraction unit 1021 further includes:Subelement 1021a is extracted, is used for from described close
The keyword is extracted in key.Obtaining unit 1021b, for according to the keyword in the key, obtaining corresponding domain name
And path.
Construction unit 1022, for according to the key and the domain name corresponding with the key extracted and road
Diameter builds the URL link.In embodiments of the present invention, in Mock platforms, the assembling format of URL link is " protocol name://
Host domain names/path/key ", according to the assembling format of URL link to extracted domain name, path and generated close
Key is combined and obtains the URL link.When it is implemented, the construction unit 1022 is specifically used for:Call URL link structure
Interface is built, build preset algorithm in interface according to the key, domain name, path and the URL link traverses structure successively
The URL links.Wherein, the preset algorithm is preset createURL algorithms, according to the key, domain name, path
And preset createURL algorithms in the URL link structure interface, it builds URL link and is encapsulated into URL link
In dynamicActivity classes, createURL algorithms are as follows:
Key, domain name and path are read according to getType from methods, a URL is created according to new Link ()
Example, it is general type that URL examples, which are arranged, by etType (Link.LinkType.STRAIGHT) method, is recycled
Read key, domain name and path are connected into created URL examples by setFromType () method, are passed through
Key, domain name and the combination condition in path in URL examples is arranged in setConstraint () method, finally by
DynamicActivity.add (this.Link) method completes the step of structure URL link.
As shown in Figure 10, the transmission unit 104, including:
Acquiring unit 1041 obtains the business required Mock in end if the Mock service for receiving business end is asked
Service release.In embodiments of the present invention, after incidence relation is established at Mock platforms and business end, if business end need from
Mock platforms obtain Mock service, will send corresponding Mock service and ask to Mock platforms, with required for the acquisition of Mock platforms
Mock service, wherein the Mock service request include Mock service version.
Searching unit 1042, for finding the target Mock services uniquely determined according to the Mock service version.
In the embodiment of the present invention, after Mock platforms receive the Mock service version transmitted by business end, pass through the Mock service version
In the Mock service of Mock platform datas inquiry corresponding thereto, specifically, on Mock platforms in corresponding Mock service, often
A Mock service is all made of a service interface, Mock service releases, Mock service interface name and the version of service,
After Mock platforms receive the Mock service version of business end transmission, inquires the Mock sent with business end on Mock platforms and take
The Mock service version being engaged on the one-to-one platform of version can be uniquely determined pair by the Mock service version on platform
The Mock service answered, and using the Mock service as the required target Mock service in business end.
Transmission sub-unit 1043, for the target Mock service to be sent to business according to the incidence relation.
In hardware realization, the above generation unit 101, module units 102, establish unit 103, transmission unit 104 etc. can
It is filled to be embedded in the form of hardware or independently of data processing in the device of data processing, can also be stored in a software form
In the memory set, the corresponding operation of above each unit is executed so that processor calls.The processor can be central processing
Unit (CPU), microprocessor, microcontroller etc..
Above-mentioned Mock service managing device can be implemented as a kind of form of computer program, and computer program can be
It is run on computer equipment as shown in figure 11.
Figure 11 is a kind of structure composition schematic diagram of computer equipment of the present invention.The equipment can be terminal, can also be
Server, wherein terminal can be smart mobile phone, tablet computer, laptop, desktop computer, personal digital assistant and wear
Wearing formula device etc. has the electronic device of communication function.Server can be independent server, can also be multiple servers
The server cluster of composition.Referring to Fig.1 1, the computer equipment 500 include the processor 502 connected by system bus 501,
Non-volatile memory medium 503, built-in storage 504 and network interface 505.Wherein, the computer equipment 500 is non-volatile
Storage medium 503 can storage program area 5031 and computer program 5032, which is performed, can make
It obtains processor 502 and executes a kind of Mock service management method.The processor 502 of the computer equipment 500 is for providing calculating
And control ability, support the operation of entire computer equipment 500.The built-in storage 504 is in non-volatile memory medium 503
Computer program 5032 operation provide environment, when which is executed by processor, processor 502 may make to hold
A kind of Mock service management method of row.The network interface 505 of computer equipment 500 such as sends distribution for carrying out network communication
Task dispatching.It will be understood by those skilled in the art that structure shown in Figure 11, only with the relevant portion of application scheme
The block diagram of separation structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer
Equipment may include either combining certain components or with different components than more or fewer components as shown in the figure
Arrangement.
Wherein, following operation is realized when the processor 502 executes the computer program:
If receiving the access request from business end, key corresponding with the access request is generated;
The key is assembled into URL link, and the URL link is sent to business end;
The incidence relation between Mock platforms and business end is established according to the URL link, the incidence relation includes
The correspondence of Mock platforms and business end;
If the Mock service request at business end is received, according to the incidence relation by the Mock in the Mock platforms
Service is sent to business end
In one embodiment, it if described receive the access request from business end, generates and the access request phase
Corresponding key, including:
The access request from business end is received according to the access interface being pre-created;
The access request is parsed to obtain the port address at the business end;
Key is generated according to obtained port address.
In one embodiment, the key is assembled into URL link, including:
Extraction domain name corresponding with the key and path;
It is linked according to URL described in the key and the domain name corresponding with the key and path construction extracted.
In one embodiment, the key includes keyword, described to extract domain name corresponding with the key and road
Diameter, including:
The keyword is extracted from the key;
According to the keyword in the key, corresponding domain name and path are obtained.
In one embodiment, it is described according to the key and the domain name corresponding with the key extracted and
URL link described in path construction, including:
It calls URL link to build interface, is built in interface according to the key, domain name, path and the URL link
Preset algorithm traverses the structure URL link successively.
In one embodiment, described that Mock service is sent to by business end according to the incidence relation, including:
If receiving the Mock service request at business end, the required Mock service version in business end is obtained;
The target Mock service uniquely determined is found according to the Mock service version;
The target Mock service is sent to business end according to the incidence relation.
In one embodiment, the Mock service is made of service interface, service release number and service interface name.
It will be understood by those skilled in the art that the embodiment of computer equipment shown in Figure 11 is not constituted to calculating
The restriction of machine equipment specific composition, in other embodiments, computer equipment may include than illustrating more or fewer portions
Part either combines certain components or different components arrangement.For example, in some embodiments, computer equipment only includes
Memory and processor, in such embodiments, structure and function and the embodiment illustrated in fig. 11 one of memory and processor
It causes, details are not described herein.
The present invention provides a kind of computer readable storage medium, computer-readable recording medium storage there are one or
More than one program, the one or more programs can be executed by one or more than one processor, to realize
Following steps:
If receiving the access request from business end, key corresponding with the access request is generated;
The key is assembled into URL link, and the URL link is sent to business end;
The incidence relation between Mock platforms and business end is established according to the URL link, the incidence relation includes
The correspondence of Mock platforms and business end;
If the Mock service request at business end is received, according to the incidence relation by the Mock in the Mock platforms
Service is sent to business end
In one embodiment, it if described receive the access request from business end, generates and the access request phase
Corresponding key, including:
The access request from business end is received according to the access interface being pre-created;
The access request is parsed to obtain the port address at the business end;
Key is generated according to obtained port address.
In one embodiment, the key is assembled into URL link, including:
Extraction domain name corresponding with the key and path;
It is linked according to URL described in the key and the domain name corresponding with the key and path construction extracted.
In one embodiment, the key includes keyword, described to extract domain name corresponding with the key and road
Diameter, including:
The keyword is extracted from the key;
According to the keyword in the key, corresponding domain name and path are obtained.
In one embodiment, it is described according to the key and the domain name corresponding with the key extracted and
URL link described in path construction, including:
It calls URL link to build interface, is built in interface according to the key, domain name, path and the URL link
Preset algorithm traverses the structure URL link successively.
In one embodiment, described that Mock service is sent to by business end according to the incidence relation, including:
If receiving the Mock service request at business end, the required Mock service version in business end is obtained;
The target Mock service uniquely determined is found according to the Mock service version;
The target Mock service is sent to business end according to the incidence relation.
In one embodiment, the Mock service is made of service interface, service release number and service interface name.
Present invention storage medium above-mentioned includes:Magnetic disc, CD, read-only memory (Read-Only Memory,
The various media that can store program code such as ROM).
Unit in all embodiments of the invention can pass through universal integrated circuit, such as CPU (Central
Processing Unit, central processing unit), or pass through ASIC (Application Specific Integrated
Circuit, application-specific integrated circuit) it realizes.
Step in Mock service management method of the embodiment of the present invention can the adjustment of carry out sequence, conjunction according to actual needs
And it and deletes.
Unit in Mock service managing device of the embodiment of the present invention can merge according to actual needs, divide and
It deletes.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, appoints
What those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications
Or replace, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention is answered
It is subject to the protection scope in claims.
Claims (10)
1. the application scenarios of a kind of Mock service management method, this method application include Mock platforms and business end, carrying out practically
In Mock platforms, which is characterized in that the method includes:
If receiving the access request from business end, key corresponding with the access request is generated;
The key is assembled into URL link, and the URL link is sent to business end;
The incidence relation between Mock platforms and business end is established according to the URL link, the incidence relation includes Mock flat
The correspondence of platform and business end;
If receiving the Mock service request at business end, the Mock service in the Mock platforms is sent out according to the incidence relation
It send to business end.
2. the method as described in claim 1, which is characterized in that if described receive the access request from business end, generate
Key corresponding with the access request, including:
The access request from business end is received according to the access interface being pre-created;
The access request is parsed to obtain the port address at the business end;
Key is generated according to obtained port address.
3. the method as described in claim 1, which is characterized in that the key is assembled into URL link, including:
Extraction domain name corresponding with the key and path;
According to URL link described in the key and the domain name corresponding with the key and path construction extracted.
4. method as claimed in claim 3, which is characterized in that the key includes keyword, the extraction and the key
Corresponding domain name and path, including:
The keyword is extracted from the key;
According to the keyword in the key, corresponding domain name and path are obtained.
5. method as claimed in claim 3, which is characterized in that described according to the key and being extracted with the key
URL link described in corresponding domain name and path construction, including:
It calls URL link to build interface, is built according to the key, domain name, path and the URL link preset in interface
Algorithm traverses the structure URL link successively.
6. the method as described in claim 1, which is characterized in that described that Mock service is sent to industry according to the incidence relation
Business end, including:
If receiving the Mock service request at business end, the required Mock service version in business end is obtained;
The target Mock service uniquely determined is found according to the Mock service version;
The target Mock service is sent to business end according to the incidence relation.
7. the method as described in claim 1, which is characterized in that the Mock service by service interface, service release number and
Service interface name forms.
8. a kind of Mock service managing device, which is characterized in that described device includes:
If generation unit generates key corresponding with the access request for receiving the access request from business end;
The URL link for the key to be assembled into URL link, and is sent to business end by module units;
Unit is established, for establishing the incidence relation between Mock platforms and business end according to the URL link, the association is closed
System includes the correspondence of Mock platforms and business end;
Transmission unit, if the Mock service for receiving business end is asked, according to the incidence relation by the Mock platforms
In Mock service be sent to business end.
9. a kind of computer equipment, including memory, processor and it is stored on the memory and can be on the processor
The computer program of operation, which is characterized in that the processor realizes that claim 1-5 such as appoints when executing the computer program
Mock service management method described in one.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage there are one or
More than one program, the one or more programs can be executed by one or more than one processor, to realize
Mock service management method as described in any one in claim 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810427435.2A CN108600255B (en) | 2018-05-07 | 2018-05-07 | Mock service management method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810427435.2A CN108600255B (en) | 2018-05-07 | 2018-05-07 | Mock service management method, device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108600255A true CN108600255A (en) | 2018-09-28 |
CN108600255B CN108600255B (en) | 2022-02-01 |
Family
ID=63619967
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810427435.2A Active CN108600255B (en) | 2018-05-07 | 2018-05-07 | Mock service management method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108600255B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111131436A (en) * | 2019-12-20 | 2020-05-08 | 广州品唯软件有限公司 | Method and device for quickly searching proxy and readable storage medium |
CN111831550A (en) * | 2020-06-04 | 2020-10-27 | 贝壳技术有限公司 | Joint debugging test method and device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040243338A1 (en) * | 2003-05-30 | 2004-12-02 | Sabiers Mark L. | Simulation of network service test environments |
US20050010661A1 (en) * | 2003-07-08 | 2005-01-13 | Southam Blaine R. | Systems and methods for testing network services |
KR20130078882A (en) * | 2012-01-02 | 2013-07-10 | 주식회사 에프엑스 에듀 | Business model for simulating fx margin transaction through internet homepage |
CN103297475A (en) * | 2012-03-01 | 2013-09-11 | 阿里巴巴集团控股有限公司 | Mock service system and processing method of Mock service |
CN106254423A (en) * | 2016-07-20 | 2016-12-21 | 普元信息技术股份有限公司 | The method realizing Restful service release quickly based on micro services framework |
CN106970873A (en) * | 2017-01-10 | 2017-07-21 | 阿里巴巴集团控股有限公司 | Mock method of testings, apparatus and system on line |
CN107784065A (en) * | 2017-08-17 | 2018-03-09 | 平安壹钱包电子商务有限公司 | Business datum tracking, device, computer equipment and storage medium |
-
2018
- 2018-05-07 CN CN201810427435.2A patent/CN108600255B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040243338A1 (en) * | 2003-05-30 | 2004-12-02 | Sabiers Mark L. | Simulation of network service test environments |
US20050010661A1 (en) * | 2003-07-08 | 2005-01-13 | Southam Blaine R. | Systems and methods for testing network services |
KR20130078882A (en) * | 2012-01-02 | 2013-07-10 | 주식회사 에프엑스 에듀 | Business model for simulating fx margin transaction through internet homepage |
CN103297475A (en) * | 2012-03-01 | 2013-09-11 | 阿里巴巴集团控股有限公司 | Mock service system and processing method of Mock service |
CN106254423A (en) * | 2016-07-20 | 2016-12-21 | 普元信息技术股份有限公司 | The method realizing Restful service release quickly based on micro services framework |
CN106970873A (en) * | 2017-01-10 | 2017-07-21 | 阿里巴巴集团控股有限公司 | Mock method of testings, apparatus and system on line |
CN107784065A (en) * | 2017-08-17 | 2018-03-09 | 平安壹钱包电子商务有限公司 | Business datum tracking, device, computer equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
FORMER MEMBER: ""Mock Services (SOAPUI) Creation for SAP PI Simple Load Test"", 《SAP BLOG》 * |
潘诗瑶; 黄建明: ""Web应用系统中的MOCK测试技术"", 《软件》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111131436A (en) * | 2019-12-20 | 2020-05-08 | 广州品唯软件有限公司 | Method and device for quickly searching proxy and readable storage medium |
CN111131436B (en) * | 2019-12-20 | 2022-08-30 | 广州品唯软件有限公司 | Method and device for quickly searching proxy and readable storage medium |
CN111831550A (en) * | 2020-06-04 | 2020-10-27 | 贝壳技术有限公司 | Joint debugging test method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108600255B (en) | 2022-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108449418B (en) | Hybrid cloud platform management system and method | |
CN103843308A (en) | Execution of applications distributed across a plurality of computing devices | |
GB2518052A (en) | Group server performance correction via actions to server subset | |
CN110719221B (en) | Instant messaging method, device, equipment and storage medium | |
CN110602056B (en) | Service parameter transmission method and device | |
CN102158541B (en) | Shared information acquisition method, device, mobile terminal and server | |
CN109597643A (en) | Using gray scale dissemination method, device, electronic equipment and storage medium | |
CN108200077B (en) | Method and device for calling interface | |
TW200928777A (en) | Data processing method and apparatus based on cluster | |
CN111163130A (en) | Network service system and data transmission method thereof | |
CN111988418B (en) | Data processing method, device, equipment and computer readable storage medium | |
CN110263581A (en) | Contract signs method, system, terminal device and storage medium | |
CN109274705A (en) | Service providing method, apparatus and system based on user identity | |
CN103581040A (en) | Server distributing device and server distributing method | |
US9910725B2 (en) | Error-specific advertisement display in electronic device | |
CN108600255A (en) | Mock service management method, device, computer equipment and storage medium | |
CN111694582A (en) | Application program resource package processing method, device, equipment and readable storage medium | |
CN106028311B (en) | A kind of terminal registration method and device | |
US7925788B2 (en) | Systems and methods for universal protocol for case management systems | |
CN103248654A (en) | Negotiation method, device and system for virtual desktop service parameters | |
CN104270357A (en) | Service information sending method and device | |
WO2004019208A2 (en) | Method and apparatus for just-in-time provisioning application-related information at a communication device | |
CN109032693A (en) | Method and device for loading display information, electronic equipment and readable storage medium | |
CN111200645B (en) | Service request processing method, device, equipment and readable storage medium | |
JP5961471B2 (en) | Output comparison method in multiple information systems |
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 |