CN111274150A - Service instance access method and device and electronic equipment - Google Patents

Service instance access method and device and electronic equipment Download PDF

Info

Publication number
CN111274150A
CN111274150A CN202010083579.8A CN202010083579A CN111274150A CN 111274150 A CN111274150 A CN 111274150A CN 202010083579 A CN202010083579 A CN 202010083579A CN 111274150 A CN111274150 A CN 111274150A
Authority
CN
China
Prior art keywords
service
access request
instance
indication information
service instance
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
CN202010083579.8A
Other languages
Chinese (zh)
Other versions
CN111274150B (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010083579.8A priority Critical patent/CN111274150B/en
Publication of CN111274150A publication Critical patent/CN111274150A/en
Application granted granted Critical
Publication of CN111274150B publication Critical patent/CN111274150B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The embodiment of the disclosure discloses a service instance access method, a service instance access device and electronic equipment. One embodiment of the method comprises: receiving a first access request for a first service; determining whether the first access request contains test indication information of the second service; in response to determining that the first access request contains test indication information of the second service, acquiring a first service address of an offline service instance of the second service; and sending a second access request to the server indicated by the first service address to access the offline service instance of the second service. The embodiment realizes the association test of the offline service instance of the second service and the first service.

Description

Service instance access method and device and electronic equipment
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method and an apparatus for accessing a service instance, and an electronic device.
Background
In the internet industry, complex services (services) may be deployed using microservice architectures. In a microservice architecture, a complex service may be split into multiple sub-services, and each sub-service may deploy one or more service instances (service instances).
For the sub-services in the micro-service architecture, the corresponding services can be provided through the service instances thereof. In practice, the service instance of the sub-service needs to be tested before being brought online. After the test passes, the service instance of the sub-service may be deployed in the micro-service architecture.
In the related art, a service instance is individually tested to correct errors existing in the code of the service instance. The test accuracy of the service instance is low due to the lack of associated testing with services already online in the micro service architecture.
Disclosure of Invention
This disclosure is provided to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The embodiment of the disclosure provides a service instance access method, a service instance access device and electronic equipment, and realizes the association test between the offline service instance of a second service and a first service.
In a first aspect, an embodiment of the present disclosure provides a service instance access method, where the method includes: receiving a first access request for a first service; determining whether the first access request contains test indication information of the second service; in response to determining that the first access request contains test indication information of the second service, acquiring a first service address of an offline service instance of the second service; and sending a second access request to the server indicated by the first service address to access the offline service instance of the second service.
In a second aspect, an embodiment of the present disclosure provides a service instance access apparatus, including: a receiving unit configured to receive a first access request for a first service; a determining unit, configured to determine whether the first access request includes test indication information of the second service; the obtaining unit is used for responding to the fact that the first access request contains the test indication information of the second service, and obtaining a first service address of an offline service instance of the second service; and the first access unit is used for sending a second access request to the server indicated by the first service address so as to access the offline service instance of the second service.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the service instance access method as described in the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the steps of the service instance access method according to the first aspect.
The service instance access method, the service instance access device, and the electronic device provided by the embodiments of the present disclosure may first receive a first access request for a first service, then may determine whether the first access request includes test indication information of a second service, further may obtain a first service address of an offline service instance of the second service in response to determining that the first access request includes the test indication information of the second service, and finally may send a second access request to a server indicated by the first service address to access the offline service instance of the second service. Thereby, the association test of the offline service instance of the second service with the first service is realized.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a flow diagram for one embodiment of a service instance access method according to the present disclosure;
FIG. 2 is a schematic diagram of one application scenario of a service instance access method according to the present disclosure;
FIG. 3 is a flow diagram of yet another embodiment of a service instance access method according to the present disclosure;
FIG. 4 is a schematic diagram illustrating one embodiment of a service instance access device, according to the present disclosure;
FIG. 5 is an exemplary system architecture to which the service instance access method of one embodiment of the present disclosure may be applied;
fig. 6 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Referring to FIG. 1, a flow diagram of one embodiment of a service instance access method according to the present disclosure is shown. The service instance access method shown in fig. 1 includes the following steps:
step 101, a first access request for a first service is received.
In this embodiment, an electronic device executing a service instance access method may receive a first access request for a first service.
The first access request may be an access request requesting access to a first service.
In some scenarios, the first access request may be an access request sent by a server on which an upstream service of the first service is located. That means, when the first service needs to be accessed, the server where the service upstream of the first service is located may send the first access request to the electronic device that performs the service instance access method.
In other scenarios, the first access request may be an access request sent by the user's electronic device (terminal device or server). That means, the user may perform a corresponding trigger operation, which triggers the electronic device of the user to send the first access request to the electronic device performing the service instance access method.
Step 102, determining whether the first access request contains test indication information of the second service.
In this embodiment, after receiving the first access request, the electronic device executing the service instance access method may determine whether the first access request includes test indication information of the second service
The second service may be a downstream service of the first service. That is, the second service may be a service at a location downstream from the first service.
The test indication information may be information indicating that a non-online service instance of the service is to be tested. It is to be appreciated that the offline service instance can be a service instance that is not deployed in the microservice architecture.
In some scenarios, an electronic device executing the service instance access method may determine whether to include test indication information for the second service at a preset location of the first access request. The preset position may be, for example, a position where the custom field in the first access request is located, and may also be, for example, a request header of the first access request.
In some alternative implementations, the test indication information may include a service name of the service. Accordingly, the test indication information of the second service may include a service name of the second service. At this time, the electronic device performing the service instance access method may perform step 102 as follows.
First, in response to determining that the first access request includes the test indication information, the electronic device executing the service instance access method may determine whether a service name included in the test indication information in the first access request is a service name of the second service.
In some scenarios, an electronic device executing the service instance access method may determine whether test indication information is included in the first access request. If the first access request includes the test indication information, the electronic device executing the service instance access method may further determine whether the service name included in the test indication information is the service name of the second service.
Then, in response to determining that the service name included in the test indication information in the first access request is the service name of the second service, the electronic device executing the service instance access method may determine that the test indication information of the second service is included in the first access request.
In these alternative implementations, the service name is set in the access request, and thus, in the process of accessing the second service by the first service, it is determined whether the first access request includes the test indication information of the second service by determining whether the first access request includes the service name of the second service.
Step 103, in response to determining that the first access request includes the test indication information of the second service, acquiring a first service address of an offline service instance of the second service.
In this embodiment, in response to determining that the first access request includes the test indication information of the second service, the electronic device executing the service instance access method may acquire the first service address of the offline service instance of the second service.
The service address may be an address of a service instance deployment. Accordingly, the first service address may be an address of a second service that is not deployed to an online service instance. It is to be appreciated that an offline service instance of the second service can provide the second service under the first service address. In practice, the service Address may include an IP Address (Internet Protocol Address) and a port number.
In some scenarios, an electronic device performing a service instance access method may obtain a first service address of an offline service instance of a second service from a local or communicatively connected database server.
In some alternative implementations, the test indication information may include a service address of an offline service instance of the service. Accordingly, the test indication information of the second service may include the address of the first service. At this time, the electronic device performing the service instance access method may perform step 103 as follows.
Specifically, the electronic device executing the service instance access method may obtain a service address of an offline service instance of the second service from the test indication information of the second service.
In these alternative implementations, the service address of the offline service instance of the second service may be extracted from the first access request during the process of accessing the second service by the first service.
And 104, sending a second access request to the server indicated by the first service address so as to access the offline service instance of the second service.
In this embodiment, after obtaining the first service address, the electronic device executing the service instance access method may send a second access request to the server indicated by the first service address to access the offline service instance of the second service.
It will be appreciated that the server indicated by the first service address may be the server on which the offline service instance of the second service is located.
In some scenarios, after receiving the second access request, the server indicated by the first service address may authenticate the second access request. If the verification is passed, the electronic device executing the service instance access method can access the offline service instance of the second service under the first service address.
Referring to fig. 2, an application scenario of a service instance access method according to an embodiment of the present disclosure is shown. As shown in fig. 2, first, a server 201 may receive a first access request 202 for a first service. Then, the server 201 may determine whether the first access request 202 includes the test indication information 203 of the second service. Further, in response to determining that the first access request 202 includes the test indication information 203 of the second service, the server 201 may obtain the first service address 204 of the offline service instance of the second service. Finally, the server 201 may send a second access request 206 to the server 205 indicated by the first service address 204, thereby accessing the offline service instance of the second service at the first service address 204.
In the related art, in order to realize the test of the offline service instance, the offline service instance can be tested separately at the server where the offline service instance is located. It should be appreciated that the offline service instance employs a separate test, even if the test passes, after deployment in the micro service architecture, the probability of failure is high because no associated tests are performed with other services in the micro service architecture.
In this embodiment, if it is determined that the first access request includes the test indication information of the second service, the first service address of the offline service instance of the second service may be obtained. Further, a second access request may be sent to the server indicated by the first service address, so as to implement access to an offline service instance of the second service. As can be seen from the above, in the micro service architecture, when the first service accesses the second service, if it is determined that the first access request includes the test indication information of the second service, it may be implemented that the first service accesses the offline service instance of the second service, that is, the second service is provided through the offline service instance of the second service. Therefore, in the process that the first service accesses the second service, the test of the offline service instance of the second service is completed, namely, the correlation test of the offline service instance of the second service and the online service in the micro-service architecture is realized. The test of the correlation with the online service in the micro-service architecture can improve the test accuracy of the offline service instance of the second service, thereby reducing the probability of the failure of the offline service instance of the second service after being deployed in the micro-service architecture.
Continuing to refer to FIG. 3, a flow diagram of yet another embodiment of a service instance access method according to the present disclosure is shown. As shown in fig. 3, the service instance access method includes the following steps:
in step 301, a first access request for a first service is received.
Step 302, determining whether the first access request includes test indication information of the second service.
In this embodiment, if it is determined that the first access request includes the test indication information of the second service, the electronic device executing the service instance access method may continue to perform step 303 and step 304. If it is determined that the first access request does not include the test indication information of the second service, the electronic device executing the service instance access method may continue to perform steps 305, 306, and 307.
Step 303, in response to determining that the first access request includes the test indication information of the second service, acquiring a first service address of the offline service instance of the second service.
And step 304, sending a second access request to the server indicated by the first service address to access the offline service instance of the second service.
Step 301, step 302, step 303, and step 304 may be performed in a similar manner as step 101, step 102, step 103, and step 104 in the embodiment shown in fig. 1, and the above description for step 101, step 102, step 103, and step 104 also applies to step 301, step 302, step 303, and step 304, and is not repeated here.
Step 305, in response to determining that the first access request does not include the test indication information of the second service, determining a target online service instance from a plurality of online service instances of the second service.
In this embodiment, in response to determining that the first access request does not include the test indication information of the second service, the electronic device executing the service instance access method may determine a target online service instance from a plurality of online service instances of the second service.
The online service instance may be a service instance already deployed in the microservice architecture. Accordingly, the online service instance of the second service may be a service instance of the second service that has been deployed in the microservice architecture.
The target online service instance may be a service instance of a second service to be accessed.
In some scenarios, an electronic device executing the service instance access method may randomly determine one service instance as a target online service instance from a plurality of online service instances of the second service.
In some alternative implementations, the electronic device performing the service instance access method may perform step 305 as follows.
First, an electronic device executing the service instance access method may obtain registration information of each of a plurality of online service instances of the second service.
The registration information may be information that the online service instance is registered with a registry. The registration information may include: the service name of the service to which the online service instance belongs, the service address of the online service instance, the working state of the online service instance, and the like.
The operational state of the online service instance may include: a state accessed by other services, an idle state.
The registry may be a storage space in the microservice architecture that stores mappings between services and service addresses of service instances. For example, service a has service instance a1 and service instance a2, service instance a1 has a service address D1, and service instance a2 has a service address D2, then the registry can store the mapping relationship between service a and service addresses D1 and D2.
In some scenarios, the electronic device executing the service instance access method may obtain, in advance, registration information of each online service instance of the second service from a server in which the registry is located. At this time, the electronic device executing the service instance access method may directly obtain the registration information of each online service instance of the second service from the local.
In another scenario, the electronic device executing the service instance access method may obtain registration information of each online service instance of the second service from a server where the registry is located.
Then, the electronic device executing the service instance access method may determine a target online service instance from a plurality of online service instances of the second service according to the obtained plurality of registration information and a preset load balancing policy.
The load balancing policy may be a policy set to adjust load balancing of a server where each online service instance is located in the micro service architecture.
In some scenarios, the electronic device executing the service instance access method may analyze the acquired multiple pieces of registration information according to a preset load balancing policy, and further determine the target online service instance on the premise of meeting the load balancing of the server where the multiple online service instances of the second service are located.
In these optional implementation manners, the target online service instance is determined through the registration information and the load balancing policy, and the target online service instance providing the second service can be determined on the premise of meeting the load balancing requirement of the server where the plurality of online service instances of the second service are located.
Step 306, obtain the second service address of the target online service instance.
In this embodiment, after determining that the target online service instance is online, the electronic device executing the service instance access method may obtain a second service address of the target online service instance.
The second service address may be an address of a target online service instance deployment. Meaning that the target online service instance of the second service may provide the second service under the second service address.
In some scenarios, an electronic device executing the service instance access method may obtain a second service address of a target online service instance from a local or registry.
Step 307, sending a third access request to the server indicated by the second service address to access the target online service instance.
In this embodiment, after obtaining the second service address, the electronic device executing the service instance access method may send a third access request to the server indicated by the second service address, so as to access the target online service instance.
It will be appreciated that the server indicated by the second service address may be the server on which the target online service instance is located.
In some scenarios, after receiving the third access request, the server indicated by the second service address may authenticate the third access request. If the verification is passed, the electronic device executing the service instance access method can access the target online service instance of the second service under the second service address.
In some optional implementations, the second access request or the third access request may include the test indication information extracted from the first access request.
In these alternative implementations, the second access request or the third request includes the slave test indication information, which means that, in the process of accessing the second service by the first service, the test indication information included in the first access request is transferred to the second access request or the third access request. Thus, in the process of accessing the downstream service by the second service, the server in which the second service is located may test the offline service instance of the downstream service of the second service in a manner similar to that described in the embodiment shown in fig. 1 or the embodiment shown in fig. 3. Therefore, the test of one or more offline service instances in the micro-service architecture is realized by transmitting the test indication information contained in the access request.
In this embodiment, if it is determined that the first access request does not include the test indication information of the second service, the target online service instance is determined from the multiple online service instances of the second service, and a service instance providing the second service may be determined from the multiple online service instances of the second service in the process of accessing the second service by the first service. Further, a second service address of the target online service instance is obtained, and a third access request is sent to the server indicated by the second service address, so that the target online service instance of the second service provides the second service on the premise that the first access request does not include test indication information of the second service. Therefore, in the process that the first service accesses the second service, if the first access request contains the test indication information of the second service, the offline service instance of the second service is accessed, and if the first access request does not contain the test indication information of the second service, the online service instance of the second service target is accessed. Therefore, on the premise of not influencing the access of the first service to the second service in the micro-service architecture, the correlation test between the offline service instance of the second service and the first service is realized.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of a service instance access apparatus, which corresponds to the method embodiment shown in fig. 1, and which is specifically applicable to various electronic devices.
As shown in fig. 4, the service instance access apparatus of the present embodiment includes: receiving unit 401, determining unit 402, obtaining unit 403, and first accessing unit 404. Wherein, the receiving unit 401 may be configured to: a first access request for a first service is received. The determining unit 402 may be configured to: it is determined whether the first access request includes test indication information for the second service. The obtaining unit 403 may be configured to: and in response to determining that the first access request contains the test indication information of the second service, acquiring a first service address of the offline service instance of the second service. The first access unit 404 may be configured to: and sending a second access request to the server indicated by the first service address to access the offline service instance of the second service.
In this embodiment, specific processing of the receiving unit 401, the determining unit 402, the obtaining unit 403, and the first accessing unit 404 of the service instance accessing apparatus and technical effects thereof may refer to related descriptions of step 101, step 102, step 103, and step 104 in the corresponding embodiment of fig. 1, which are not described herein again.
In some alternative implementations, the test indication information may include a service address of an offline service instance of the service. The obtaining unit 403 may be further configured to: and acquiring the service address of the offline service instance of the second service from the test indication information of the second service.
In some alternative implementations, the test indication information may include a service name of the service. The determining unit 402 may be further configured to: in response to determining that the first access request contains the test indication information, determining whether a service name contained in the test indication information in the first access request is a service name of the second service; and in response to determining that the service name contained in the test indication information in the first access request is the service name of the second service, determining that the test indication information of the second service is contained in the first access request.
In some alternative implementations, the service instance access device may further include a second access unit (not shown in the figure). The second access unit may be to: in response to determining that the first access request does not include test indication information for the second service, determining a target online service instance from a plurality of online service instances for the second service; acquiring a second service address of a target online service instance; and sending a third access request to the server indicated by the second service address to access the target online service instance.
In some optional implementations, the second access unit may be further configured to: acquiring registration information of each online service instance in a plurality of online service instances of a second service; and determining a target online service instance from a plurality of online service instances of the second service according to the acquired registration information and a preset load balancing test.
In some optional implementations, the second access request or the third access request may include the test indication information extracted from the first access request.
With further reference to fig. 5, fig. 5 illustrates an exemplary system architecture to which the service instance access method of one embodiment of the present disclosure may be applied.
As shown in fig. 5, the system architecture may include a server 501, a network 502, and a server 503. Network 502 serves as a medium for providing communication links between server 501 and server 503. Network 502 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The server 501 may be the server where the first service is located. The server 503 may be a server where an offline service instance of the second service is located. The second service may be a downstream service of the first service. The access of the second service may be involved in the process of the first service being accessed.
In some scenarios, a server on which the upstream service of the first service resides may send a first access request to server 501 to access the first service. After receiving the first access request, the server 501 may determine whether the first access request includes test indication information of the second service. If it is determined that the first access request includes the test indication information of the second service, the server 501 may obtain the first service address of the offline service instance of the second service. It is to be appreciated that the first service address can be a service address of an offline service instance of the second service in the server 503. Further, server 501 may send a second access request to server 503 to enable access to an offline service instance of a second service.
The server 501 and the server 503 may be hardware or software. When the server 501 and the server 503 are hardware, they may be implemented as a distributed server cluster composed of multiple servers, or implemented as a single server. When server 501 and server 503 are software, they may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the service instance access method provided by the embodiment of the present disclosure may be executed by the server 501, and accordingly, the service instance access device may be disposed in the server 501.
It should be understood that the number of servers and networks in fig. 5 is merely illustrative. There may be any number of servers and networks, as desired for implementation.
Referring now to FIG. 6, a block diagram of an electronic device (e.g., server 501 in FIG. 5) suitable for use in implementing embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a first access request for a first service; determining whether the first access request contains test indication information of the second service; in response to determining that the first access request contains test indication information of the second service, acquiring a first service address of an offline service instance of the second service; and sending a second access request to the server indicated by the first service address to access the offline service instance of the second service.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation of the element itself, for example, a receiving element may also be described as an element "receiving a first access request for a first service".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (9)

1. A method for accessing a service instance, comprising:
receiving a first access request for a first service;
determining whether the first access request contains test indication information of a second service;
in response to determining that the first access request contains test indication information of the second service, acquiring a first service address of an offline service instance of the second service;
and sending a second access request to the server indicated by the first service address to access the offline service instance of the second service.
2. The method of claim 1, wherein the test indication information includes a service address of an offline service instance of the service; and
the obtaining the service address of the offline service instance of the second service includes:
and acquiring the service address of the offline service instance of the second service from the test indication information of the second service.
3. The method of claim 1, wherein the test indication information includes a service name of the service; and
the determining whether the first access request includes test indication information of the second service includes:
in response to determining that the first access request contains test indication information, determining whether a service name contained in the test indication information in the first access request is a service name of the second service;
and in response to determining that the service name included in the test indication information in the first access request is the service name of the second service, determining that the test indication information of the second service is included in the first access request.
4. The method of claim 1, further comprising:
in response to determining that the first access request does not include test indication information for the second service, determining a target online service instance from a plurality of online service instances for the second service;
acquiring a second service address of the target online service instance;
and sending a third access request to the server indicated by the second service address to access the target online service instance.
5. The method of claim 4, wherein determining a target online service instance from a plurality of online service instances of the second service comprises:
acquiring registration information of each online service instance in a plurality of online service instances of the second service;
and determining the target online service instance from a plurality of online service instances of the second service according to the acquired registration information and a preset load balancing test.
6. The method of claim 4, wherein the second access request or the third access request includes test indication information extracted from the first access request.
7. A service instance access apparatus, comprising:
a receiving unit configured to receive a first access request for a first service;
a determining unit, configured to determine whether the first access request includes test indication information of a second service;
an obtaining unit, configured to obtain a first service address of an offline service instance of the second service in response to determining that the first access request includes test indication information of the second service;
and the first access unit is used for sending a second access request to the server indicated by the first service address so as to access the offline service instance of the second service.
8. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
9. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202010083579.8A 2020-02-07 2020-02-07 Service instance access method and device and electronic equipment Active CN111274150B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010083579.8A CN111274150B (en) 2020-02-07 2020-02-07 Service instance access method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010083579.8A CN111274150B (en) 2020-02-07 2020-02-07 Service instance access method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111274150A true CN111274150A (en) 2020-06-12
CN111274150B CN111274150B (en) 2023-08-22

Family

ID=71000219

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010083579.8A Active CN111274150B (en) 2020-02-07 2020-02-07 Service instance access method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111274150B (en)

Citations (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130212264A1 (en) * 2012-02-14 2013-08-15 International Business Machines Corporation Controlling access of clients to service in cluster environment
US20140258778A1 (en) * 2013-03-07 2014-09-11 Samsung Electronics Co., Ltd. Automated test equipment and control method thereof
US20150143341A1 (en) * 2013-11-21 2015-05-21 International Business Machines Corporation Selective object testing in a client-server environment
US9588799B1 (en) * 2015-09-29 2017-03-07 Amazon Technologies, Inc. Managing test services in a distributed production service environment
US20170180238A1 (en) * 2015-12-16 2017-06-22 Software Ag Systems and/or methods for automated testing and monitoring of backend services
US20170177464A1 (en) * 2015-12-18 2017-06-22 Dell Products, Lp System and Method for Production Testing of an Application
CN107154976A (en) * 2017-05-10 2017-09-12 北京微影时代科技有限公司 Website testing method, device and system
CN107395464A (en) * 2017-09-11 2017-11-24 北京奇艺世纪科技有限公司 A kind of server test method, apparatus and API gateway
CN107967206A (en) * 2016-10-20 2018-04-27 腾讯科技(深圳)有限公司 A kind of data testing system, request hold-up interception method and request blocking apparatus
US20180137026A1 (en) * 2016-11-16 2018-05-17 Paypal, Inc. Service Test Validation Framework
CN108427644A (en) * 2018-03-27 2018-08-21 深圳市买买提信息科技有限公司 Service test method, service testing system and service testing device
US20180276109A1 (en) * 2017-03-24 2018-09-27 International Business Machines Corporation Distributed system test device
CN108683562A (en) * 2018-05-18 2018-10-19 深圳壹账通智能科技有限公司 Abnormality detection localization method, device, computer equipment and storage medium
CN109150978A (en) * 2018-07-24 2019-01-04 北京百度网讯科技有限公司 The method and apparatus for debugging micro services
CN109218041A (en) * 2017-06-29 2019-01-15 北京京东尚科信息技术有限公司 Request processing method and device for server system
CN109308266A (en) * 2018-11-30 2019-02-05 北京微播视界科技有限公司 Construction method, test method, device, equipment and the medium of test case
CN109408369A (en) * 2018-09-13 2019-03-01 北京奇艺世纪科技有限公司 A kind of system detection method, device and electronic equipment
CN109446071A (en) * 2018-09-26 2019-03-08 深圳壹账通智能科技有限公司 Interface test method, interface test device, electronic equipment and storage medium
CN109542796A (en) * 2018-12-28 2019-03-29 深圳云天励飞技术有限公司 Test method and Related product
CN109726132A (en) * 2019-01-03 2019-05-07 京东方科技集团股份有限公司 A kind of method for testing software and software test automation management system
US20190197231A1 (en) * 2017-12-21 2019-06-27 Bitstrata Systems Inc. Secure association of an installed application instance with a service
CN110032454A (en) * 2018-01-12 2019-07-19 北京京东尚科信息技术有限公司 Remote invocation method, system and relevant device and computer readable storage medium
CN110096437A (en) * 2019-04-12 2019-08-06 平安普惠企业管理有限公司 The test method and Related product of micro services framework
CN110209583A (en) * 2019-06-03 2019-09-06 中国银联股份有限公司 Safety detecting method, device, system, equipment and storage medium
CN110430275A (en) * 2019-08-09 2019-11-08 中国工商银行股份有限公司 Data processing method, system, calculates equipment and medium at device
CN110460584A (en) * 2019-07-16 2019-11-15 北京奇艺世纪科技有限公司 Access request processing method, device, electronic equipment and computer-readable medium
US20200004665A1 (en) * 2018-06-29 2020-01-02 International Business Machines Corporation Unit test framework for testing code in a gateway service
CN110659206A (en) * 2019-08-30 2020-01-07 平安普惠企业管理有限公司 Simulation architecture establishing method, device, medium and electronic equipment based on microservice

Patent Citations (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130212264A1 (en) * 2012-02-14 2013-08-15 International Business Machines Corporation Controlling access of clients to service in cluster environment
US20140258778A1 (en) * 2013-03-07 2014-09-11 Samsung Electronics Co., Ltd. Automated test equipment and control method thereof
US20150143341A1 (en) * 2013-11-21 2015-05-21 International Business Machines Corporation Selective object testing in a client-server environment
US9588799B1 (en) * 2015-09-29 2017-03-07 Amazon Technologies, Inc. Managing test services in a distributed production service environment
US20170180238A1 (en) * 2015-12-16 2017-06-22 Software Ag Systems and/or methods for automated testing and monitoring of backend services
US20170177464A1 (en) * 2015-12-18 2017-06-22 Dell Products, Lp System and Method for Production Testing of an Application
CN107967206A (en) * 2016-10-20 2018-04-27 腾讯科技(深圳)有限公司 A kind of data testing system, request hold-up interception method and request blocking apparatus
US20180137026A1 (en) * 2016-11-16 2018-05-17 Paypal, Inc. Service Test Validation Framework
US20180276109A1 (en) * 2017-03-24 2018-09-27 International Business Machines Corporation Distributed system test device
CN107154976A (en) * 2017-05-10 2017-09-12 北京微影时代科技有限公司 Website testing method, device and system
CN109218041A (en) * 2017-06-29 2019-01-15 北京京东尚科信息技术有限公司 Request processing method and device for server system
CN107395464A (en) * 2017-09-11 2017-11-24 北京奇艺世纪科技有限公司 A kind of server test method, apparatus and API gateway
US20190197231A1 (en) * 2017-12-21 2019-06-27 Bitstrata Systems Inc. Secure association of an installed application instance with a service
CN110032454A (en) * 2018-01-12 2019-07-19 北京京东尚科信息技术有限公司 Remote invocation method, system and relevant device and computer readable storage medium
CN108427644A (en) * 2018-03-27 2018-08-21 深圳市买买提信息科技有限公司 Service test method, service testing system and service testing device
CN108683562A (en) * 2018-05-18 2018-10-19 深圳壹账通智能科技有限公司 Abnormality detection localization method, device, computer equipment and storage medium
US20200004665A1 (en) * 2018-06-29 2020-01-02 International Business Machines Corporation Unit test framework for testing code in a gateway service
CN109150978A (en) * 2018-07-24 2019-01-04 北京百度网讯科技有限公司 The method and apparatus for debugging micro services
CN109408369A (en) * 2018-09-13 2019-03-01 北京奇艺世纪科技有限公司 A kind of system detection method, device and electronic equipment
CN109446071A (en) * 2018-09-26 2019-03-08 深圳壹账通智能科技有限公司 Interface test method, interface test device, electronic equipment and storage medium
CN109308266A (en) * 2018-11-30 2019-02-05 北京微播视界科技有限公司 Construction method, test method, device, equipment and the medium of test case
CN109542796A (en) * 2018-12-28 2019-03-29 深圳云天励飞技术有限公司 Test method and Related product
CN109726132A (en) * 2019-01-03 2019-05-07 京东方科技集团股份有限公司 A kind of method for testing software and software test automation management system
CN110096437A (en) * 2019-04-12 2019-08-06 平安普惠企业管理有限公司 The test method and Related product of micro services framework
CN110209583A (en) * 2019-06-03 2019-09-06 中国银联股份有限公司 Safety detecting method, device, system, equipment and storage medium
CN110460584A (en) * 2019-07-16 2019-11-15 北京奇艺世纪科技有限公司 Access request processing method, device, electronic equipment and computer-readable medium
CN110430275A (en) * 2019-08-09 2019-11-08 中国工商银行股份有限公司 Data processing method, system, calculates equipment and medium at device
CN110659206A (en) * 2019-08-30 2020-01-07 平安普惠企业管理有限公司 Simulation architecture establishing method, device, medium and electronic equipment based on microservice

Also Published As

Publication number Publication date
CN111274150B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN110753089B (en) Method, device, medium and electronic equipment for managing client
CN111581291A (en) Data processing method and device, electronic equipment and readable medium
CN108494860B (en) WEB access system, WEB access method and device for client
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN110377440B (en) Information processing method and device
CN112597047A (en) Test method, test device, electronic equipment and computer readable medium
CN110764983A (en) Test method, device, medium and electronic equipment
CN112714042B (en) Pressure testing method and device, electronic equipment and storage medium
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN116627849A (en) System test method, device, equipment and storage medium
CN111274150B (en) Service instance access method and device and electronic equipment
CN115022328B (en) Server cluster, testing method and device of server cluster and electronic equipment
CN114465919B (en) Network service testing method, system, electronic equipment and storage medium
CN112306858A (en) Test method and device and electronic equipment
CN112184406A (en) Data processing method, system, electronic device and computer readable storage medium
CN112667119A (en) Measuring point batch correlation method and device, electronic equipment and computer readable medium
CN112346870A (en) Model processing method and system
CN111800779B (en) Device source identification method and apparatus, computer system, and readable storage medium
CN110489341B (en) Test method and device, storage medium and electronic equipment
CN109005084B (en) Method, electronic device, and computer-readable medium for verifying network connection
CN115373972A (en) Interface testing method and device, storage medium and electronic equipment
CN115904921A (en) Service registration information sending method, device, equipment and computer readable medium
CN112084183A (en) Data verification method and device, electronic equipment and computer readable medium
CN113722206A (en) Data annotation method and device, electronic equipment and computer readable medium
CN116599846A (en) Inter-tenant network connection method, inter-tenant network connection device, electronic equipment and computer readable medium

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