CN111274150B - 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
CN111274150B
CN111274150B CN202010083579.8A CN202010083579A CN111274150B CN 111274150 B CN111274150 B CN 111274150B CN 202010083579 A CN202010083579 A CN 202010083579A CN 111274150 B CN111274150 B CN 111274150B
Authority
CN
China
Prior art keywords
service
access request
instance
indication information
online
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010083579.8A
Other languages
Chinese (zh)
Other versions
CN111274150A (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

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 invention discloses a service instance access method, a device and electronic equipment. One embodiment of the method comprises the following steps: receiving a first access request for a first service; determining whether the first access request contains test indication information of the second service; responding to the test indication information of the second service contained in the first access request, and acquiring a first service address of an off-line service instance of the second service; and sending a second access request to the server indicated by the first service address to access the non-online service instance of the second service. The embodiment realizes the association test of the non-online service instance of the second service and the first service.

Description

Service instance access method and device and electronic equipment
Technical Field
The disclosure relates to the technical field of internet, and in particular relates to a service instance access method, a service instance access device and electronic equipment.
Background
In the internet industry, complex services (services) may be deployed using a micro-service architecture. In a micro-service architecture, a complex service may be split into multiple sub-services, and each sub-service may deploy one or more service instances (serviceinstances).
For sub-services in the micro-service architecture, corresponding services can be provided through their service instances. In practice, service instances of sub-services need to be tested before being online. After the test passes, the service instance of the sub-service may be deployed in a 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 lack of associated testing with services that are already online in the micro-service architecture results in lower accuracy testing of service instances.
Disclosure of Invention
This disclosure is provided in part 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 device and electronic equipment, and realizes the association test of an off-line 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, including: receiving a first access request for a first service; determining whether the first access request contains test indication information of the second service; responding to the test indication information of the second service contained in the first access request, and acquiring a first service address of an off-line service instance of the second service; and sending a second access request to the server indicated by the first service address to access the non-online service instance of the second service.
In a second aspect, embodiments of the present disclosure provide a service instance access apparatus, the 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 the 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 instruction 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 non-online 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; and 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, embodiments of the present disclosure provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the steps of the service instance access method according to the first aspect.
According to the service instance access method, the device and the electronic equipment provided by the embodiment of the disclosure, first, a first access request aiming at a first service can be received, then, whether the first access request contains test indication information of a second service can be determined, further, in response to determining that the first access request contains the test indication information of the second service, a first service address of an off-line service instance of the second service can be acquired, and finally, the second access request can be sent to a server indicated by the first service address so as to access the off-line service instance of the second service. Thus, the association test of the non-online service instance of the second service and the first service is realized.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of one embodiment of a service instance access method according to the present disclosure;
FIG. 2 is a schematic illustration of one application scenario of a service instance access method according to the present disclosure;
FIG. 3 is a flow chart of yet another embodiment of a service instance access method according to the present disclosure;
FIG. 4 is a schematic diagram of an embodiment of a service instance access apparatus according to the present disclosure;
FIG. 5 is an exemplary system architecture to which a 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 have been shown in the accompanying 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 are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present 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. Furthermore, 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 "including" and variations thereof as used herein are intended to be 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. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such 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 as shown in fig. 1 comprises the following steps:
step 101, a first access request for a first service is received.
In this embodiment, an electronic device executing the 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 the first service.
In some scenarios, the first access request may be an access request sent by a server at which an upstream service of the first service resides. That means that when the first service needs to be accessed, the server where the upstream service of the first service is located may send the first access request to the electronic device executing 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). The method includes that a user can execute corresponding triggering operation, and the electronic equipment of the user is triggered to send a first access request to the electronic equipment executing the service instance access method.
Step 102, determining whether the first access request includes 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 instruction 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 instruction information may be information indicating that the service instance that is not online for the service is tested. It is to be appreciated that the non-online service instance can be a service instance that is not deployed in a micro-service architecture.
In some scenarios, an electronic device executing the service instance access method may determine, at a preset location of the first access request, whether test indication information of the second service is included. The preset location may be, for example, a location 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 test instruction information is included in the first access request, the electronic device executing the service instance access method may determine whether the service name included in the test instruction information in the first access request is the service name of the second service.
In some scenarios, an electronic device executing the service instance access method may determine whether the first access request includes test indication information. 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 instruction 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 instruction 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, so that during the process of the first service accessing the second service, by determining whether the first access request contains the service name of the second service, it is determined whether the first access request contains the test indication information of the second service.
Step 103, in response to determining that the first access request includes the test indication information of the second service, a first service address of an offline service instance of the second service is obtained.
In this embodiment, in response to determining that the first access request includes the test instruction information of the second service, the electronic device executing the service instance access method may acquire the first service address of the non-online 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 an off-line service instance deployment of the second service. It is understood that an off-line service instance of the second service may provide the second service under the first service address. In practice, the service address may contain an IP address (Internet Protocol Address ) and a port number.
In some scenarios, an electronic device executing the service instance access method may obtain a first service address of an off-line 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 the service address of the non-online service instance of the second service from the test instruction information of the second service.
In these alternative implementations, the service address of the non-online service instance is set in the access request, whereby, during the process of the first service accessing the second service, the service address of the non-online service instance of the second service may be extracted from the first access request.
Step 104, sending a second access request to the server indicated by the first service address to access the non-online service instance of the second service.
In this embodiment, after the first service address is acquired, 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 where the non-online 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 verify the second access request. If the verification is passed, the electronic device executing the service instance access method can access the non-online 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. The server 201 may then determine whether the first access request 202 contains test indication information 203 for the second service. Further, in response to determining that the first access request 202 includes the test indication information 203 for the second service, the server 201 may obtain the first service address 204 of the non-online service instance for 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 an offline service instance of the second service under the first service address 204.
In the related art, in order to implement the test of the non-online service instance, the non-online service instance may be tested separately at the server where it is located. It should be appreciated that the off-line service instance employs a separate test, even if the test passes, the probability of failure is high after deployment in the micro-service architecture because no associated test is 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 non-online 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, to enable 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, the first service may access the non-online service instance of the second service, that is, the second service is provided through the non-online service instance of the second service. Therefore, in the process that the first service accesses the second service, the test of the non-online service instance of the second service is completed, namely, the association test of the non-online service instance of the second service and the online service in the micro-service architecture is realized. The correlation test of the online service in the micro-service architecture can improve the test accuracy of the non-online service instance of the second service, thereby reducing the probability of failure of the non-online service instance of the second service after being deployed in the micro-service architecture.
With continued reference to FIG. 3, a flow 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:
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 instruction information of the second service, the electronic device executing the service instance access method may continue to execute steps 303 and 304. If it is determined that the first access request does not include the test instruction information of the second service, the electronic device executing the service instance access method may continue to execute 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, a first service address of an offline service instance of the second service is obtained.
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.
The steps 301, 302, 303, 304 may be performed in a similar manner as the steps 101, 102, 103, 104 in the embodiment shown in fig. 1, and the descriptions of the steps 101, 102, 103, 104 are also applicable to the steps 301, 302, 303, 304, which are not repeated herein.
In step 305, in response to determining that the first access request does not include the test indication information of the second service, a target online service instance is determined 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 instruction information of the second service, the electronic device executing the service instance access method may determine the target online service instance from among a plurality of online service instances of the second service.
The online service instance may be a service instance that has been deployed in a micro-service 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 micro-service 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 from a plurality of online service instances of a second service as a target online service instance.
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 acquire registration information of each of a plurality of online service instances of the second service.
The registration information may be information registered by the online service instance at a registry. The registration information may include: service name of the service to which the online service instance belongs, service address of the online service instance, working status of the online service instance, and the like.
The operating state of the online service instance may include: state accessed by other services, idle state.
The registry may be a storage space in the micro-service architecture that stores mappings between services and service addresses of service instances. For example, the service a has a service instance A1 and a service instance A2, the service address of the service instance A1 is D1, and the service address of the service instance A2 is D2, and then the registry may store the mapping relationship between the service a and the service addresses D1 and D2.
In some scenarios, the electronic device executing the service instance access method may acquire, in advance, registration information of each online service instance of the second service from a server where the registry is located. At this time, the electronic device performing the service instance access method may directly acquire registration information of each online service instance of the second service from the local.
In another scenario, an electronic device executing the service instance access method may obtain registration information for 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 acquired plurality of registration information and the preset load balancing policy.
The load balancing policy may be a policy set for adjusting load balancing of servers where online service instances in the micro service architecture are located.
In some scenarios, the electronic device executing the service instance access method may analyze the acquired multiple registration information according to a preset load balancing policy, so as to 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 alternative implementations, the target online service instance is determined through the registration information and the load balancing policy, where the target online service instance for providing the second service may be determined on the premise of satisfying load balancing of the servers where the plurality of online service instances of the second service are located.
Step 306, a second service address of the target online service instance is obtained.
In this embodiment, after determining the target online service instance, the electronic device executing the service instance access method may acquire the 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 at 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, a third access request is sent to the server indicated by the second service address to access the target online service instance.
In this embodiment, after the second service address is acquired, the electronic device executing the service instance access method may send a third access request to the server indicated by the second service address to access the target online service instance.
It will be appreciated that the server indicated by the second service address may be the server where 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 verify 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 alternative implementations, the second access request or the third access request may include test indication information extracted from the first access request.
In these alternative implementations, the second access request or the third access request includes the slave test indication information, which means that, during the process that the first service accesses the second service, the test indication information included in the first access request is transferred to the second access request or the third access request. Thus, during the process of the second service accessing the downstream service, the server where 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 that described in the embodiment shown in fig. 3. Therefore, the test of one or more off-line 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 in the process that the first service accesses the second service, the service instance that provides the second service may be determined from the multiple online service instances of the second service. Further, the second service address of the target online service instance is obtained, and the 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 can provide the second service on the premise that the first access request does not contain the test indication information of the second service. Thus, in the process that the first service accesses the second service, if the first access request contains the test instruction information of the second service, the non-online service instance of the second service is accessed, and if the first access request does not contain the test instruction information of the second service, the online service instance of the second service target is accessed. Therefore, on the premise that the first service accesses the second service in the micro-service architecture, the association test of the non-online service instance of the second service and the first service is realized.
With further reference to fig. 4, as an implementation of the method shown in the foregoing figures, the present disclosure provides an embodiment of a service instance access apparatus, where an embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be specifically applied in various electronic devices.
As shown in fig. 4, the service instance access apparatus of the present embodiment includes: a receiving unit 401, a determining unit 402, an obtaining unit 403, and a first accessing unit 404. Wherein the receiving unit 401 may be configured to: a first access request is received for a first service. The determining unit 402 may be configured to: it is determined whether the first access request contains test indication information for the second service. The acquisition unit 403 may be configured to: and responding to the determination that the first access request contains the test indication information of the second service, and acquiring the first service address of the non-online 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 non-online service instance of the second service.
In this embodiment, the specific processes 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 the technical effects thereof may refer to the relevant descriptions of the steps 101, 102, 103, and 104 in the corresponding embodiment of fig. 1, and are not repeated herein.
In some alternative implementations, the test indication information may include a service address of an offline service instance of the service. The acquisition unit 403 may be further configured to: and acquiring the service address of the non-online 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; in response to determining that the service name included in the test instruction information in the first access request is the service name of the second service, the test instruction information of the second service is included in the first access request.
In some alternative implementations, the service instance access apparatus may further include a second access unit (not shown in the figure). The second access unit may be for: 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; 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.
In some alternative 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 the 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 alternative implementations, the second access request or the third access request may include test indication information extracted from the first access request.
With further reference to fig. 5, fig. 5 illustrates an exemplary system architecture in which a service instance access method of an 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 is the medium used to provide communications links between servers 501 and 503. Network 502 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The server 501 may be the server where the first service is located. The server 503 may be a server where an off-line service instance of the second service is located. The second service may be a service downstream 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 at which a service upstream of a first service resides may send a first access request to server 501 to access the first service. Upon 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 non-online service instance of the second service. It is understood that the first service address may be a service address of an off-line service instance of the second service in the server 503. Further, the server 501 may send a second access request to the server 503 to enable access to an off-line service instance of the second service.
The server 501 and the server 503 may be hardware or software. When the server 501 and the server 503 are hardware, the server may be implemented as a distributed server cluster formed by a plurality of servers, or may be implemented as a single server. When the server 501 and the server 503 are software, they may be implemented as a plurality of software or software modules (for example, a plurality of software or software modules for providing distributed services), or may be implemented as a single software or software module. The present invention 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 apparatus may be provided 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 schematic 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 merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
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 required 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 through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic 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 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this 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 the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, 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 communication 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 networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated 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; responding to the test indication information of the second service contained in the first access request, and acquiring a first service address of an off-line service instance of the second service; and sending a second access request to the server indicated by the first service address to access the non-online service instance of the second service.
Computer program code for carrying out operations of the present disclosure may be written in 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts 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 involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Where the name of the unit does not constitute a limitation of the unit itself in some cases, for example, the receiving unit may also be described as a unit "receiving a first access request for a first service".
The functions described above herein 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: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), 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. The 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 of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although 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. In 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 limiting the scope of the present 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 example forms of implementing the claims.

Claims (9)

1. A service instance access method, comprising:
receiving a first access request for a first service;
determining whether the first access request contains test indication information of a second service; the first service is an online service in a micro-service architecture, the second service is a service which is not deployed in the micro-service architecture, and the second service is a downstream service of the first service;
responding to the test indication information of the second service contained in the first access request, and acquiring a first service address of an off-line service instance of the second service;
sending a second access request to a server indicated by the first service address to access an offline service instance of the second service;
the second service further comprises an online service instance, and the online service instance is accessed when the first access request does not contain the test indication information 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 non-online 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 the 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 determining that the test indication information of the second service is contained in the first access request 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.
4. The method according to claim 1, wherein the method further comprises:
In response to determining that the first access request does not contain 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;
acquiring a second service address of the target online service instance;
and sending a third access request to a server indicated by the second service address to access the target online service instance.
5. The method of claim 4, wherein the 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 the 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; the first service is an online service in a micro-service architecture, the second service is a service which is not deployed in the micro-service architecture, and the second service is a downstream service of the first 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 instruction information of the second service;
a first access unit, configured to send a second access request to a server indicated by the first service address, so as to access an offline service instance of the second service;
the second service further comprises an online service instance, and the online service instance is accessed when the first access request does not contain the test indication information of the second service.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any 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 CN111274150A (en) 2020-06-12
CN111274150B true 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 (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9588799B1 (en) * 2015-09-29 2017-03-07 Amazon Technologies, Inc. Managing test services in a distributed production service environment
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
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
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
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
CN110659206A (en) * 2019-08-30 2020-01-07 平安普惠企业管理有限公司 Simulation architecture establishing method, device, medium and electronic equipment based on microservice

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2815323B1 (en) * 2012-02-14 2017-03-08 International Business Machines Corporation Method for controlling access of clients to a service in a cluster environment
KR102030385B1 (en) * 2013-03-07 2019-10-10 삼성전자주식회사 Automated Test Equipment and Method of Controlling thereof
US10042742B2 (en) * 2013-11-21 2018-08-07 International Business Machines Corporation Selective object testing in a client-server environment
US10158551B2 (en) * 2015-12-16 2018-12-18 Software Ag Systems and/or methods for automated testing and monitoring of backend services
US10380005B2 (en) * 2015-12-18 2019-08-13 Dell Products, Lp System and method for production testing of an application
US20180137026A1 (en) * 2016-11-16 2018-05-17 Paypal, Inc. Service Test Validation Framework
US10372596B2 (en) * 2017-03-24 2019-08-06 International Business Machines Corporation Distributed system test device
US11657136B2 (en) * 2017-12-21 2023-05-23 Bitstrata Systems Inc. Secure association of an installed application instance with a service
US10628276B2 (en) * 2018-06-29 2020-04-21 International Business Machines Corporation Unit test framework for testing code in a gateway service

Patent Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9588799B1 (en) * 2015-09-29 2017-03-07 Amazon Technologies, Inc. Managing test services in a distributed production service environment
CN107967206A (en) * 2016-10-20 2018-04-27 腾讯科技(深圳)有限公司 A kind of data testing system, request hold-up interception method and request blocking apparatus
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
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
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
CN111274150A (en) 2020-06-12

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
WO2022105591A1 (en) Cache server performance test method and apparatus, device, and medium
CN110377440B (en) Information processing method and device
CN112597047A (en) Test method, test device, electronic equipment and computer readable medium
CN111679990A (en) Test data generation method and device, readable medium and electronic equipment
CN113485918A (en) Test method, test device, electronic equipment and storage medium
CN113793128A (en) Method, device, equipment and computer readable medium for generating business fault reason information
CN111596992B (en) Navigation bar display method and device and electronic equipment
CN109194706A (en) Internet resources dial testing method and terminal
CN112714042A (en) Pressure testing method and device, electronic 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
CN110764995B (en) Method, device, medium and electronic equipment for detecting file access abnormality
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN114115941A (en) Resource sending method, page rendering method, device, electronic equipment and medium
CN113778850A (en) Data processing method and device, electronic equipment and computer readable medium
CN110489341B (en) Test method and device, storage medium and electronic equipment
CN111800779B (en) Device source identification method and apparatus, computer system, and readable storage medium
CN116319322B (en) Power equipment node communication connection method, device, equipment and computer medium
CN109005084B (en) Method, electronic device, and computer-readable medium for verifying network connection
CN116545729A (en) Multi-application security test method, device, electronic equipment and computer readable medium
CN114124533A (en) Data interception method and device, electronic equipment and computer readable medium
CN115277362A (en) Fault diagnosis method, fault diagnosis 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