Movatterモバイル変換


[0]ホーム

URL:


CN110704296B - Calling method and device - Google Patents

Calling method and device
Download PDF

Info

Publication number
CN110704296B
CN110704296BCN201810753312.8ACN201810753312ACN110704296BCN 110704296 BCN110704296 BCN 110704296BCN 201810753312 ACN201810753312 ACN 201810753312ACN 110704296 BCN110704296 BCN 110704296B
Authority
CN
China
Prior art keywords
test
target
calling
identifier
function module
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
CN201810753312.8A
Other languages
Chinese (zh)
Other versions
CN110704296A (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.)
Alibaba Singapore Holdings Pte Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding LtdfiledCriticalAlibaba Group Holding Ltd
Priority to CN201810753312.8ApriorityCriticalpatent/CN110704296B/en
Publication of CN110704296ApublicationCriticalpatent/CN110704296A/en
Application grantedgrantedCritical
Publication of CN110704296BpublicationCriticalpatent/CN110704296B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application provides a calling method and a calling device, and the calling method comprises the following steps: providing at least one group of test function modules; the test function module is associated with a service identifier, a user identifier and an isolation identifier; receiving a test request; the test request comprises a target service identifier and a target user identifier; determining a target isolation identifier according to the target service identifier and the target user identifier; acquiring a calling link according to the target service identifier; the target test function module that the sign corresponds is kept apart to the target according to transferring the link and is called, this application sets up the service identification through the function module to the examination of awaiting measuring, the corresponding relation of user identification and isolation sign, when carrying out the business test, the test flow can keep apart the sign through the target of confirming the correspondence, according to transferring the link and calling the function module that includes the sign is kept apart to the target in proper order, realize the isolation between the test service, research and development team is when carrying out the business test, only be used for being absorbed in the test service of oneself, avoid work conflict between the different research and development teams.

Description

Translated fromChinese
一种调用方法及装置A calling method and device

技术领域technical field

本申请涉及信息技术领域,特别是涉及一种调用方法及装置。The present application relates to the field of information technology, in particular to a calling method and device.

背景技术Background technique

随着世界经济全球化的不断发展,越来越多的公司和科研机构的研发团队分布在全球各个地方,研发团队在开发软件时通常要搭建研发测试环境,目的是开发和测试分布式应用,通过建立一个兼容的分布式计算机环境,开发分布式应用。With the continuous development of the globalization of the world economy, more and more R&D teams of companies and scientific research institutions are distributed all over the world. When developing software, R&D teams usually need to build a R&D testing environment for the purpose of developing and testing distributed applications. Develop distributed applications by establishing a compatible distributed computer environment.

在先技术中,全球各个地方的研发团队使用一套研发环境,各种业务下的应用只布设一套。那么对于某个业务,当存在多个团队在开发时,在测试时需要将各个团队开发的各个应用的应用代码进行区分,然后进行测试。比如一个业务有a、b、c、d四个应用组成调用链路,其依赖关系为a依赖b、b依赖c、c依赖d,该依赖关系也可以理解为调用关系,在实际运行过程中a调用b,b调用c,c调用d。假设团队A对应用a更新了一个功能1,团队B对应用a更新了一个功能2,那么要将功能1的代码和功能2的代码进行合并,得到更新后的应用a,然后再根据a、b、c、d组成的调用链路,进行对应用的依次调用,实现对调用链路中应用的测试。In the previous technology, R&D teams in various parts of the world use one set of R&D environments, and only one set is deployed for applications under various businesses. Then, for a certain business, when there are multiple teams developing, it is necessary to distinguish the application codes of each application developed by each team during testing, and then test them. For example, a business has four applications called a, b, c, and d to form a calling link. The dependency relationship is that a depends on b, b depends on c, and c depends on d. This dependency relationship can also be understood as a calling relationship. In the actual operation process a calls b, b calls c, and c calls d. Assuming that team A has updated afunction 1 to application a, and team B has updated afunction 2 to application a, then the code offunction 1 and the code offunction 2 must be merged to obtain the updated application a, and then according to a, The calling link composed of b, c, and d is used to call the application sequentially, and realize the test of the application in the calling link.

但是,发明人在研究过程中发现,上述方案中,当在业务的测试过程中出现问题,需要协调各地的与该业务相关的团队进行处理,而由于各个团队分布在全球各地,很难协调,并且从一个研发环境中找出是哪个团队开发的代码出现问题,也要耗费大量精力,效率低。However, the inventor found during the research process that in the above scheme, when a problem occurs during the business testing process, it is necessary to coordinate the teams related to the business in various places to deal with it, and since the teams are distributed all over the world, it is difficult to coordinate. In addition, finding out from a research and development environment which team developed a problem with the code also consumes a lot of energy and is inefficient.

发明内容Contents of the invention

鉴于上述问题,本申请实施例提供一种调用方法,通过对待测试的功能模块设置业务标识、用户标识及隔离标识的对应关系,在进行业务测试时,测试流量可以通过确定对应的目标隔离标识,按照调用链路依次调用包含有目标隔离标识的功能模块,实现测试业务之间的隔离,研发团队在进行业务测试时,只用专注于自己的测试业务,避免不同研发团队之间工作相冲突,解决现有技术中各个团队分布在全球各地,很难协调一个研发环境中各个团队的测试任务的问题。In view of the above problems, the embodiment of the present application provides a calling method. By setting the corresponding relationship between the service ID, the user ID and the isolation ID for the functional module to be tested, during the service test, the test traffic can be determined by determining the corresponding target isolation ID. Invoke the functional modules containing the target isolation identifier in turn according to the call link to realize the isolation between test services. When conducting business tests, the R&D team only needs to focus on their own test services to avoid work conflicts between different R&D teams. Solve the problem that in the existing technology, each team is distributed all over the world, and it is difficult to coordinate the testing tasks of each team in a research and development environment.

相应的,本申请实施例还提供了一种调用装置,用以保证上述方法的实现及应用。Correspondingly, the embodiment of the present application also provides a calling device to ensure the implementation and application of the above method.

为了解决上述问题,本申请实施例公开了一种调用方法,包括:In order to solve the above problems, the embodiment of the present application discloses a calling method, including:

提供至少一组测试功能模块;所述测试功能模块关联有业务标识、用户标识、及隔离标识;Provide at least one group of test function modules; the test function modules are associated with business identification, user identification, and isolation identification;

接收测试请求;所述测试请求包括目标业务标识和目标用户标识;Receive a test request; the test request includes a target service identifier and a target user identifier;

根据所述目标业务标识和目标用户标识确定目标隔离标识;Determine the target isolation ID according to the target service ID and the target user ID;

根据所述目标业务标识获取调用链路;Obtain an invocation link according to the target service identifier;

根据所述调用链路对所述目标隔离标识对应的目标测试功能模块进行调用。The target test function module corresponding to the target isolation identifier is called according to the call link.

相应的,本申请实施例还公开了一种调用装置,包括:Correspondingly, the embodiment of the present application also discloses a calling device, including:

第一提供模块,用于提供至少一组测试功能模块;所述测试功能模块关联有业务标识、用户标识、及隔离标识;The first providing module is used to provide at least one group of test function modules; the test function modules are associated with business identification, user identification, and isolation identification;

接收模块,用于接收测试请求;所述测试请求包括目标业务标识和目标用户标识;A receiving module, configured to receive a test request; the test request includes a target service identifier and a target user identifier;

确定模块,用于根据所述目标业务标识和目标用户标识确定目标隔离标识;A determining module, configured to determine a target isolation ID according to the target service ID and the target user ID;

获取模块,用于根据所述目标业务标识获取调用链路;An acquisition module, configured to acquire an invocation link according to the target service identifier;

调用模块,用于根据所述调用链路对所述目标隔离标识对应的目标测试功能模块进行调用。The calling module is configured to call the target test function module corresponding to the target isolation identifier according to the calling link.

相应的,本申请实施例还公开了一种装置,包括:Correspondingly, the embodiment of the present application also discloses a device, including:

一个或多个处理器;和one or more processors; and

其上存储有指令的一个或多个机器可读介质,当由所述一个或多个处理器执行时,使得所述装置执行一种调用方法。One or more machine-readable media having stored thereon instructions that, when executed by the one or more processors, cause the apparatus to perform an invoked method.

相应的,本申请实施例还公开了一个或多个机器可读介质,其上存储有指令,当由一个或多个处理器执行时,使得装置执行一种调用方法。Correspondingly, the embodiment of the present application also discloses one or more machine-readable media, on which instructions are stored, and when executed by one or more processors, the device executes a calling method.

本申请实施例包括以下优点:The embodiment of the present application includes the following advantages:

本申请实施例包括:提供至少一组测试功能模块;测试功能模块关联有业务标识、用户标识、及隔离标识;接收测试请求;测试请求包括目标业务标识和目标用户标识;根据目标业务标识和目标用户标识确定目标隔离标识;根据目标业务标识获取调用链路;根据调用链路对目标隔离标识对应的目标测试功能模块进行调用,本申请通过对待测试的功能模块设置业务标识、用户标识及隔离标识的对应关系,在进行业务测试时,对于一测试流量,系统可以通过确定对应的目标隔离标识,按照调用链路依次调用包含有目标隔离标识的功能模块,实现测试业务之间的隔离,研发团队在进行业务测试时,只用专注于自己的测试业务,避免不同研发团队之间工作相冲突,方便各个研发团队自己管理自己开发的功能模块,使各个研发团队在其测试业务出现问题时,可以独立、快速的对自己开发的应用进行查验;并且,由于进行了逻辑隔离,环境搭建成本低,可移植性强,能够支持不断扩张的全球各地的业务团队对研发环境的需求。The embodiment of the present application includes: providing at least one group of test function modules; the test function modules are associated with service identification, user identification, and isolation identification; receiving a test request; the test request includes a target service identification and a target user identification; The user ID determines the target isolation ID; obtains the calling link according to the target business ID; calls the target test function module corresponding to the target isolation ID according to the calling link, and this application sets the business ID, user ID and isolation ID for the functional module to be tested During business testing, for a test traffic, the system can determine the corresponding target isolation ID and call the functional modules containing the target isolation ID in turn according to the call link to realize the isolation between test services. The R&D team When conducting business testing, you only need to focus on your own testing business to avoid work conflicts between different R&D teams, so that each R&D team can manage the functional modules they develop by themselves, so that each R&D team can solve problems when their testing business has problems. Independently and quickly check the applications developed by ourselves; and, due to the logical isolation, the environment construction cost is low and the portability is strong, which can support the needs of the expanding business teams around the world for the R&D environment.

附图说明Description of drawings

图1是本申请一实施例提供的一种调用方法的系统架构图;Fig. 1 is a system architecture diagram of a calling method provided by an embodiment of the present application;

图2是本申请一实施例提供的另一种调用方法的系统架构图;Fig. 2 is a system architecture diagram of another calling method provided by an embodiment of the present application;

图3是本申请一实施例提供的一种调用方法的步骤流程图;Fig. 3 is a flow chart of steps of a calling method provided by an embodiment of the present application;

图4是本申请一实施例提供的应用于一种调用方法的系统结构图;Fig. 4 is a system structure diagram applied to a calling method provided by an embodiment of the present application;

图5是本申请一实施例提供的一种调用方法的具体步骤流程图;Fig. 5 is a flow chart of specific steps of a calling method provided by an embodiment of the present application;

图6是本申请一实施例提供的一种调用装置的结构图;Fig. 6 is a structural diagram of a calling device provided by an embodiment of the present application;

图7是本申请一实施例提供的一种调用装置的具体结构图;Fig. 7 is a specific structural diagram of a calling device provided by an embodiment of the present application;

图8是本申请另一实施例提供的一种装置的结构示意图。Fig. 8 is a schematic structural diagram of a device provided by another embodiment of the present application.

具体实施方式Detailed ways

为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。In order to make the above objects, features and advantages of the present application more obvious and comprehensible, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

参照图1,其示出了本申请实施例的一种系统架构,其可以包括:With reference to Fig. 1, it shows a kind of system architecture of the embodiment of the present application, it may comprise:

测试环境、基础环境和生产环境。各个环境之间是相互逻辑隔离的。其中,测试环境和基础环境是基于软件开发者建立的,图1中,测试环境和基础环境可以架构在测试服务器中,另外,测试环境和基础环境也可以以服务器集群的形式进行实现,测试环境和基础环境之间通过预发布中间件进行资源的共享,其中预发布中间件可以设置在中间件服务器中。环境是指软件研发过程中的运维概念,测试环境和基础环境可以运行在正式生产机房里,连接正式数据库的机器,但是可以不设置在正式的线上负载均衡集群内,也就是说这两种环境,可以进行线上环境的测试,但是不影响正式环境中用户的访问。Test environment, base environment and production environment. Each environment is logically isolated from each other. Among them, the test environment and the basic environment are established based on software developers. In Figure 1, the test environment and the basic environment can be constructed in the test server. In addition, the test environment and the basic environment can also be implemented in the form of server clusters. The test environment Resources are shared between the basic environment and the pre-release middleware through the pre-release middleware, where the pre-release middleware can be set in the middleware server. The environment refers to the concept of operation and maintenance in the software development process. The test environment and the basic environment can run in the formal production computer room and the machine connected to the formal database, but they do not need to be set in the formal online load balancing cluster. That is to say, the two This environment can be used to test the online environment, but it does not affect the access of users in the formal environment.

其中,测试环境和基础环境可以共用一套预发布中间件。在本申请实施例中,环境可以指软件开发环境(Software Development Environment,SDE),其是指在基本硬件和宿主软件的基础上,为支持系统软件和应用软件的工程化开发和维护而使用的一组软件,简称SDE。它由软件工具和环境集成机制构成,前者用以支持软件开发的相关过程、活动和任务,后者为工具集成和软件的开发、维护及管理提供统一的支持。测试环境提供给各个研发团队测试该团队开发的测试功能模块,测试功能模块可以安装与所述测试环境中,以前述测试服务器为例,测试服务器可以基于测试环境接收测试客户端发送的测试流量,可以对对应的测试业务进行测试等。不同的测试业务之间通过不同的业务标识进行区分,例如,进行网页展示的业务采用业务标识:1、进行视频播放的业务采用业务标识:2、在网站中对某个商品进行下单的下单业务采用业务标识:3、对某个订单进行支付的支付业务采用业务标识:4,等等。在本申请实施例中可以由测试服务器将各个团队为测试业务开发的测试功能模块打上唯一的隔离标识,从而在后续的预发中间件调用时,可以针对同一隔离标识的测试功能模块进行调用,在图1中,预发布测试环境具有三组相互隔离的测试业务,其中分别包括业务标识分别为1、2、3的测试业务。Among them, the test environment and the basic environment can share a set of pre-release middleware. In the embodiment of the present application, the environment may refer to a software development environment (Software Development Environment, SDE), which refers to the environment used to support the engineering development and maintenance of system software and application software on the basis of basic hardware and host software. A set of software, referred to as SDE. It is composed of software tools and environment integration mechanism, the former is used to support the related processes, activities and tasks of software development, and the latter provides unified support for tool integration and software development, maintenance and management. The test environment is provided for each R&D team to test the test function modules developed by the team. The test function modules can be installed in the test environment. Taking the aforementioned test server as an example, the test server can receive the test traffic sent by the test client based on the test environment. The corresponding test service may be tested and the like. Different test services are distinguished by different business identifiers. For example, the service for displaying web pages adopts the service identifier: 1. The service for video playback adopts the service identifier: 2. The service for placing an order for a product on the website A single service adopts a business identifier: 3, a payment service that pays for an order adopts a service identifier: 4, and so on. In the embodiment of this application, the test server can mark the test function modules developed by each team for the test business with unique isolation marks, so that when the subsequent pre-release middleware is called, the test function modules with the same isolation mark can be called. In FIG. 1 , the pre-release test environment has three groups of test services isolated from each other, including test services withservice identifiers 1, 2, and 3 respectively.

需要说明的是,功能模块是实现基本功能的程序,功能模块实现的功能可以较为单一,其自身可以实现某一特定的业务逻辑,使得功能模块在整个系统中可以作为一个微粒,在实现较为复杂的业务功能时,可以通过功能模块的组合实现,进一步的,通过将指向业务功能的业务请求与功能模块的执行条件匹配得出执行链路,实现通过功能模块的组合进行业务处理。具体的,例如,展示网站首页的业务功能,可以包括展示标题的功能模块,展示图片标识的功能模块,在网站中对商品对象进行下单的功能模块,对某个订单进行支付的支付功能模块等。上述程序可以运行在用户模式,可以具有与用户进行交互的可视的用户界面,也可以是无交互页面的系统服务。It should be noted that a function module is a program that realizes basic functions. The function realized by a function module can be relatively simple, and it can realize a specific business logic by itself, so that the function module can be used as a particle in the entire system, and the implementation is relatively complicated. For business functions, it can be realized through the combination of function modules. Further, the execution link can be obtained by matching the business request pointing to the business function with the execution conditions of the function modules, so as to realize the business processing through the combination of function modules. Specifically, for example, the business function of displaying the homepage of the website may include a function module for displaying titles, a function module for displaying image logos, a function module for placing an order on a product object on the website, and a payment function module for paying for an order wait. The above-mentioned program can run in the user mode, can have a visual user interface for interacting with the user, or can be a system service without interactive pages.

基础环境,主要用于软件正式上线前的预发测试。本申请实施例中的预发中间件可以针对由第三方平台发出的预发流量,对预发布的测试业务进行测试,在图1中,具有一组与测试环境隔离的基础环境,其中包括基础功能模块。The basic environment is mainly used for pre-release testing before the software is officially launched. The pre-release middleware in the embodiment of this application can test the pre-release test service for the pre-release traffic sent by the third-party platform. In Figure 1, there is a group of basic environments isolated from the test environment, including the basic functional module.

上述生产环境是面向用户建立的,是业务在测试完成后,正式上线需要部署的环境,其主要用于处理用户流量,图1中的生产流量可以理解为大众用户的用户端发出的用户浏览。该生产环境可以理解为功能模块通过在基础环境中测试后,可以上线部署的环境,在生产环境中的部署的功能模块可以理解为的正式线上版本。The above-mentioned production environment is established for users. It is the environment that needs to be deployed after the business is officially launched after the test is completed. It is mainly used to process user traffic. The production traffic in Figure 1 can be understood as user browsing sent by the client of the public user. The production environment can be understood as an environment in which functional modules can be deployed online after passing the test in the basic environment, and the functional modules deployed in the production environment can be understood as the official online version.

具体的,为了在全球化业务下,方便不同时区的研发团队在测试环境进行业务测试的工作,对于各个团队对某个测试业务各自开发的一组测试功能模块,比如测试时侧服务器调用的测试功能模块相互之间耦合,本申请在实施例在测试环境中为不同的测试业务包括的测试功能模块进行了逻辑隔离,每个测试业务包括至少一组带有隔离标识的测试功能模块,其中同一团队针对一个测试业务开发的一组测试功能模块的隔离标识一致。Specifically, in order to facilitate R&D teams in different time zones to conduct business testing in the test environment under globalized business conditions, each team develops a set of test function modules for a certain test business, such as the test called by the side server during the test. The functional modules are coupled with each other. In the embodiment of the present application, in the test environment, the test functional modules included in different test services are logically isolated. Each test service includes at least one group of test functional modules with an isolation mark, wherein the same A group of test function modules developed by the team for a test business have the same isolation identification.

其中,逻辑隔离可以通过逻辑隔离器实现,逻辑隔离器是一种不同网络间的隔离部件,被隔离的测试业务之间仍然存在物理上数据通道连线,但通过技术手段保证被隔离的测试业务之间没有数据通道,即逻辑上隔离。针对一组测试业务,逻辑隔离的具体实现可以是对该组测试业务中的所有测试功能模块关联有业务标识、用户标识、及隔离标识,然后利用预发布中间件对打上隔离标识的测试功能模块进行调用,使得通过隔离标识来隔离不同的测试业务,达到逻辑上的隔离。其中,中间件是一种独立的系统软件或服务程序,在集群中的分布式应用借助中间件在不同的系统之间共享资源,中间件位于客户机/服务器的操作系统之上,管理计算资源和网络通信。Among them, the logical isolation can be realized by a logical isolator, which is an isolation component between different networks. There are still physical data channel connections between the isolated test services, but the isolated test services are guaranteed by technical means. There is no data channel between them, that is, they are logically isolated. For a group of test services, the specific implementation of logical isolation can be to associate service IDs, user IDs, and isolation IDs with all test function modules in the group of test services, and then use pre-release middleware to test function modules marked with isolation IDs Calling makes it possible to isolate different test services by means of isolation identifiers to achieve logical isolation. Among them, middleware is an independent system software or service program. Distributed applications in the cluster use middleware to share resources between different systems. Middleware is located on the client/server operating system and manages computing resources. and network communication.

如图1,测试服务器中同时设置了测试环境和基础环境,测试环境和基础环境共用一套预发布中间件,该预发布中间件相对于正式的生产环境的生产中间件独立部署,保证对测试环境和基础环境中的功能模块的调用不会调用到生产环境的功能模块,在本申请实施例中,测试环境的测试业务的处理可以依靠预发布中间件来实现,例如,预发布中间件可以包括:hsf(High-Speed Service Framework)\notify\metaq这几个组件,这几个组件都是为了实现远程调用,hsf是实时调用的远程过程调用协议(rpc,Remote Procedure Call)中间件,notify\metaq是消息类异步调用的rpc中间件,测试业务的功能模块之间都是通过这些中间件进行相互通信的。As shown in Figure 1, the test environment and the basic environment are set up in the test server at the same time. The test environment and the basic environment share a set of pre-release middleware. The invocation of the function modules in the environment and the basic environment will not call the function modules in the production environment. In the embodiment of this application, the processing of the test business in the test environment can be realized by relying on the pre-release middleware. For example, the pre-release middleware can Including: hsf (High-Speed Service Framework)\notify\metaq these components, these components are for remote calls, hsf is a remote procedure call protocol (rpc, Remote Procedure Call) middleware for real-time calls, notify \metaq is the rpc middleware for asynchronous calls of the message class, and the functional modules of the test business communicate with each other through these middleware.

例如,在图1中,测试环境提供了三组测试功能模块,其对应的测试业务的业务标识分别都为1,可以理解为三个团队分别为测试业务1分别在进行开发,那么三组测试功能模块分别对应有隔离标识m1、隔离标识m2和隔离标识m3,在对于每组测试功能模块的功能模块标识打上隔离标识以及业务标识,使得研发团队在进行业务测试时,其调用的测试功能模块仅限于本团队的测试业务的隔离标识对应的测试功能模块,而不会调用到其他团队测试的业务中的测试功能模块,研发团队的测试流量也只会在本团队的测试业务的隔离标识对应的测试功能模块中流通,达到了测试业务之间逻辑隔离,使得每个研发团队能够专注于自己的测试业务进行软件开发,提高了研发效率。For example, in Figure 1, the test environment provides three sets of test function modules, and the service identifiers of the corresponding test services are all 1. It can be understood that three teams are developing fortest service 1 respectively. Then the three sets of test The functional modules correspond to the isolation identification m1, the isolation identification m2 and the isolation identification m3 respectively. The isolation identification and the business identification are marked on the functional module identification of each group of test function modules, so that when the R&D team conducts business testing, the test function modules it calls It is limited to the test function modules corresponding to the isolation ID of the test business of this team, and will not call the test function modules in the business tested by other teams, and the test traffic of the R&D team will only correspond to the isolation ID of the test business of this team It circulates among the test function modules, achieving logical isolation between test businesses, enabling each R&D team to focus on its own test business for software development, and improving R&D efficiency.

需要说明的是,在实际应用中,在图1的服务器中,还可以有多组基础功能模块,也还可以有与其他业务对应的一组或者多组测试功能模块,每种业务的每组测试功能模块的业务标识一致,隔离标识唯一。同一个业务的不同组的功能模块的功能模块标识一致,业务标识一致,隔离标识不同。It should be noted that, in practical applications, in the server in Figure 1, there may be multiple groups of basic function modules, and there may also be one or more groups of test function modules corresponding to other businesses, each group of each business The business identifiers of the test function modules are consistent, and the isolation identifiers are unique. The function modules of different groups of the same business have the same function module identifier, the same service identifier, and different isolation identifiers.

当然,在实际应用中,可以按照划分多个区域,在多个区域设置测试服务器,每个测试服务器设置置一套或者多套测试环境。当然,基础环境也可以在每个区域设置一套或者多套,也可以所有区域共享一套基础环境。Of course, in practical applications, test servers can be set up in multiple areas according to the division, and each test server can be set with one or more sets of test environments. Of course, one or more sets of basic environments can be set in each region, or one set of basic environments can be shared by all regions.

可以理解,研发团队在需要测试时,可以如图4通过测试客户端向分配服务器发送一个第一设置请求,申请对某一业务标识关联的所有的测试功能模块打上具有全局唯一性的隔离标识。在实际应用中,第一设置请求包括该业务标识关联的所有的测试功能模块,分配服务器根据该请求,将接收到的该业务标识关联的所有的测试功能模块部署至测试环境中,并对测试功能模块添加对应的隔离标识,并对某一业务标识关联的所有的测试功能模块打上具有唯一性的隔离标识,完成测试业务的部署和隔离。It can be understood that when the R&D team needs to test, it can send a first setting request to the allocation server through the test client as shown in Figure 4, and apply for marking all the test function modules associated with a certain business identifier with a globally unique isolation identifier. In practical applications, the first setting request includes all the test function modules associated with the service identifier, and the distribution server deploys all the test function modules associated with the received service identifier to the test environment according to the request, and performs test The function module adds the corresponding isolation identification, and puts a unique isolation identification on all the test function modules associated with a certain business identification, and completes the deployment and isolation of the test business.

需要说明的是,在实际应用中,根据不同研发团队负责业务的不同,其测试的业务中包含的测试功能模块可能不同,当然,不同研发团队测试的业务中包含的测试功能模块也可能相同,并且,由于测试环境相较于正式生产环境还具有业务上需求的多变性,因此,测试环境中测试业务包括的测试功能模块与生产环境中生产业务包括的功能模块也可能不相同,本申请对此不作限定。It should be noted that in practical applications, according to the different businesses that different R&D teams are responsible for, the test function modules contained in the business tested by them may be different. Of course, the test function modules contained in the business tested by different R&D teams may also be the same. Moreover, since the test environment has variability in business requirements compared with the formal production environment, the test functional modules included in the test business in the test environment may also be different from the functional modules included in the production business in the production environment. This is not limited.

进一步的,一个测试业务中,通常预设有调用链路,即一个测试业务中各个功能模块之间的存在调用关系,在进行业务测试时,可以按照调用链路的顺序进行测试功能模块的调用,例如,当打开网购应用访问购物车测试功能模块A的页面渲染的时候,需要查购物车里的产品数量,则进一步需要调用产品测试功能模块B,产品测试功能模块B需要调用会员测试功能模块C等等,每个业务都需要跟上下游几百个应用进行相互调用,该调用链路比如:功能模块标识A-功能模块标识B-功能模块标识C-功能模块标识D。需要说明的是,在测试环境中,必须要有具有隔离标识的测试功能模块A,测试功能模块A起到测试业务入口的目的。Furthermore, in a test service, there is usually a call link preset, that is, there is a call relationship between various functional modules in a test service. When performing a service test, the test function modules can be called in the order of the call link , for example, when opening the online shopping application and accessing the page rendering of the shopping cart test function module A, you need to check the number of products in the shopping cart, then you need to call the product test function module B, and the product test function module B needs to call the membership test function module C and so on, each business needs to make mutual calls with hundreds of upstream and downstream applications. The call link is for example: function module ID A-function module ID B-function module ID C-function module ID. It should be noted that in the test environment, there must be a test function module A with an isolation identifier, and the test function module A serves the purpose of testing the service entrance.

参照图1,对本申请提供的一种调用方法的实现过程进行详细说明,例如,在网购应用中的一件商品的页面展示的测试业务的业务标识为1,某个开发团队2设置了一组测试功能模块,该测试功能模块包括了测试功能模块a、测试功能模块b、测试功能模块c、测试功能模块d四个测试功能模块,这四个应用分别打上了隔离标识m2和业务标识,则存储时可以记录为:测试功能模块a-m2、测试功能模块b-m2、测试功能模块c-m2、测试功能模块d-m2,隔离标识m2还与业务标识1研发团队2的测试客户端的用户标识2及关联,通过业务标识1以及研发团队2的用户标识2可以唯一确定隔离标识。需要说明的是,在本申请实施例中对于一个业务,一个测试客户端的用户标识只绑定一次,防止逻辑耦合,如果该研发团队要同时对一个业务,测试多组测试功能模块,则每组测试功能模块可以用不同的测试客户端的用户ID关联。Referring to Figure 1, the implementation process of a calling method provided by this application will be described in detail. For example, the business identifier of the test business displayed on a product page in an online shopping application is 1, and acertain development team 2 has set a group of Test function module, the test function module includes test function module a, test function module b, test function module c, test function module d four test function modules, these four applications are marked with isolation logo m2 and business logo, then When storing, it can be recorded as: test function module a-m2, test function module b-m2, test function module c-m2, test function module d-m2, and the isolation identifier m2 is also related to the user of the test client ofbusiness identifier 1R&D team 2Identifier 2 and association, the isolation identifier can be uniquely determined through thebusiness identifier 1 and theuser identifier 2 of theR&D team 2. It should be noted that, in the embodiment of this application, for a business, the user ID of a test client is only bound once to prevent logical coupling. If the R&D team wants to test multiple groups of test function modules for a business at the same time, each group Test function modules can be associated with different test client user IDs.

可以理解,上述测试功能模块a-m2处理该商品的整体页面框架展示,测试功能模块b-m2处理该商品的图片相关展示,测试功能模块c-m2处理该商品的文字描述相关展示,测试功能模块d-m2处理该商品的相关链接展示,则根据预设业务逻辑,针对业务标识1预设了功能模块a-功能模块b-功能模块c-功能模块d的调用链路,标识该测试业务的开展顺序是先展示该商品的整体页面框架,之后展示该商品的图片,之后该展示商品的文字描述,最后展示该商品的相关链接。那么假设研发团队2通过测试客户端发送了包括用户标识2的测试流量,因此,当测试服务器的预发布中间件接收到该研发团队发送的针对测试业务1的该测试请求时,预发布中间件可以根据测试请求中的用户标识2以及业务标识1确定隔离标识,用业务标识确定调用链路“功能模块标识A-功能模块标识B-功能模块标识C-功能模块标识D”,那么后续则先调用包括隔离标识m2的测试功能模块a-m2,之后根据隔离标识m2,调用同样具有隔离标识m2的目标测试功能模块b-m2,之后调用具有隔离标识m2的目标测试功能模块c-m2,最后调用具有隔离标识m2的目标测试功能模块d-m2,以实现对商品的页面展示的测试,并且达到了各组测试功能模块之间的逻辑隔离,避免调用到其他组功能模块。It can be understood that the above-mentioned test function module a-m2 handles the overall page frame display of the product, the test function module b-m2 handles the image-related display of the product, and the test function module c-m2 handles the text description related display of the product, and the test function Module d-m2 handles the display of related links of this product, and according to the preset business logic, the invocation link of function module a-function module b-function module c-function module d is preset forbusiness identifier 1 to identify the test business The order of development is to first display the overall page frame of the product, then display the picture of the product, then display the text description of the product, and finally display the relevant links of the product. Then supposeR&D team 2 sends test traffic includinguser ID 2 through the test client. Therefore, when the pre-release middleware of the test server receives the test request fortest service 1 sent by the R&D team, the pre-release middleware The isolation ID can be determined according to theuser ID 2 andservice ID 1 in the test request, and the service ID can be used to determine the call link "function module ID A-function module ID B-function module ID C-function module ID D", then the follow-up will first Call the test function module a-m2 including the isolation mark m2, then call the target test function module b-m2 that also has the isolation mark m2 according to the isolation mark m2, then call the target test function module c-m2 with the isolation mark m2, and finally The target test function module d-m2 with the isolation identifier m2 is called to realize the test of the page display of the product, and achieve the logical isolation between each group of test function modules, avoiding calling other groups of function modules.

另外,又假使接收到测试客户端1的针对业务1的测试请求,则根据用户标识1和业务标识1确定隔离标识m1,还根据业务标识确定调用链路a-b-c-d,然后调用隔离标识为m1的测试功能模块a-m1,以及b-m1,由于没有隔离标识m41的测试功能模块c-m1,则调用基础功能模块c,然后调用隔离标识为m1的测试功能模块d-m1。达到了各组测试功能模块之间的逻辑隔离,避免调用到其他组功能模块。In addition, assuming that the test request forservice 1 fromtest client 1 is received, the isolation identifier m1 is determined according to theuser identifier 1 and theservice identifier 1, and the invocation link a-b-c-d is determined according to the service identifier, and then the test with the isolation identifier m1 is invoked Since the function modules a-m1 and b-m1 do not have the test function module c-m1 with the isolation identifier m41, they call the basic function module c, and then call the test function module d-m1 with the isolation identifier m1. It achieves the logical isolation between each group of test function modules, and avoids calling other groups of function modules.

而对于线上正式用户端发送的生产流量,即正式用户端对网站发送的正式请求,则由正式服务器接收该请求,按照相应的业务标识对应的调用链路对其中的功能模块进行调用,具体的线上调用过程本申请实施例不对其加以限制。For the production traffic sent by the online official client, that is, the official request sent by the official client to the website, the official server receives the request, and calls the functional modules in it according to the call link corresponding to the corresponding service ID. The online calling process is not limited in this embodiment of the present application.

进一步的,本申请实施例提供的一种调用方法还可以在服务器集群的环境中进行实现,具体参照图2,其示出了本申请实施例的另一种系统架构,其中,可以将每个功能模块分别部署在对应的节点服务器中,每组测试功能模块关联有不同隔离标识,每个隔离标识与用户标识以及业务标识关联,使得所有节点服务器组合形成服务器集群,当形成服务器集群时,因为服务器集群包括了多个节点服务器,因此可以通过测试管理服务器接收测试流量,并按照调用链路,通过测试管理服务器中架设的预发布中间件对对应节点服务器包括的测试功能模块进行依次调用,实现业务的测试,针对生产环境,也可以将各个功能模块部署在对应的节点服务器中,并由生产管理服务器接收测试流量,并按照负载均衡规则,通过生产管理服务器中架设的生产中间件对对应节点服务器包括的功能模块进行依次调用。Further, the calling method provided by the embodiment of the present application can also be implemented in the server cluster environment, specifically refer to FIG. 2 , which shows another system architecture of the embodiment of the present application, where each The functional modules are respectively deployed in the corresponding node servers. Each group of test functional modules is associated with different isolation IDs. Each isolation ID is associated with user IDs and business IDs, so that all node servers are combined to form a server cluster. When forming a server cluster, because The server cluster includes multiple node servers, so the test traffic can be received through the test management server, and the test function modules included in the corresponding node server can be called sequentially through the pre-release middleware set up in the test management server according to the call link to realize For business testing, for the production environment, each functional module can also be deployed in the corresponding node server, and the production management server receives the test traffic, and according to the load balancing rules, through the production middleware set up in the production management server, the corresponding node The function modules included in the server are called sequentially.

如图2中,针对业务标识2的业务,其调用链路为功能模块e-f-g-h。图2中选择了一系列节点服务器设置为预发布基础环境,在这些节点服务器中分别设置了基础功能模块e、f、g、h。也有3个研发团队分别针对该业务标识2的业务提供了一组测试功能模块。第一个研发团队提供了测试功能模块e、f、h,则选择设置为预发布测试环境的节点服务器部署上述测试功能模块,在存储时,该节点服务器以隔离标识m4打上标记,则为测试功能模块e-m4、测试功能模块f-m4、测试功能模块h-m4。第二个研发团队提供了测试功能模块e、f、g、h,则选择设置为预发布测试环境的节点服务器部署上述测试功能模块,在存储时,该节点服务器以隔离标识m5打上标记,则为测试功能模块e-m5、测试功能模块f-m5、测试功能模块g-m5、测试功能模块h-m5。第二个研发团队提供了测试功能模块e、h,则选择设置为预发布测试环境的节点服务器部署上述测试功能模块,在存储时,该节点服务器以隔离标识m6打上标记,则为测试功能模块e-m6、测试功能模块h-m6。As shown in Figure 2, for the service withservice ID 2, its calling link is the function module e-f-g-h. In Figure 2, a series of node servers are selected as the pre-release basic environment, and basic function modules e, f, g, and h are respectively set in these node servers. There are also three R&D teams that provide a set of test function modules for the business of thebusiness identifier 2 respectively. The first R&D team provides the test function modules e, f, and h, and then selects the node server set as the pre-release test environment to deploy the above test function modules. When storing, the node server is marked with the isolation identifier m4, which is the test Function module e-m4, test function module f-m4, test function module h-m4. The second R&D team provides the test function modules e, f, g, and h, and then selects the node server set as the pre-release test environment to deploy the above test function modules. When storing, the node server is marked with the isolation identifier m5, then These are test function module e-m5, test function module f-m5, test function module g-m5, and test function module h-m5. The second R&D team provides the test function modules e and h, and then selects the node server set as the pre-release test environment to deploy the above test function modules. When storing, the node server is marked with the isolation identifier m6, which is the test function module e-m6, test function module h-m6.

还有设置为生产环境的节点服务器,其中部署了多套正式上线版本的功能模块e、f、g、h。同理在服务器集群中,还可以有其他业务的基础功能模块的节点服务器,其他业务的测试功能模块的节点服务器和其他业务的线上正式版本的功能模块的节点服务器,本申请实施例不对其加以限制。There is also a node server set up as a production environment, in which multiple sets of functional modules e, f, g, and h of the official online version are deployed. Similarly, in the server cluster, there may also be node servers of basic function modules of other businesses, node servers of test function modules of other businesses, and node servers of function modules of online official versions of other businesses. be restricted.

然后对于测试管理服务器,假使接收到测试客户端4的针对业务2的测试请求,则根据用户标识4和业务标识2确定隔离标识m4,还根据业务标识确定调用链路e-f-g-h,然后调用隔离标识为m4的测试功能模块e-m4,以及f-m4,由于没有隔离标识m4的测试功能模块f-m4,则调用基础功能模块f,然后调用隔离标识为m4的测试功能模块h-m4。Then for the test management server, if the test request forbusiness 2 of thetest client 4 is received, the isolation identification m4 is determined according to theuser identification 4 and theservice identification 2, and the call link e-f-g-h is also determined according to the service identification, and then the isolation identification is called as The test function modules e-m4 and f-m4 of m4, since there is no test function module f-m4 with the isolation identifier m4, call the basic function module f, and then call the test function module h-m4 with the isolation identifier m4.

而对于线上正式用户端发送的生产流量,即正式用户端对网站发送的正式请求,则由生产管理器接收该请求,然后按照相应的业务标识对应的调用链路对集群中为生产环境的各个节点服务器中的功能模块进行调用,具体的线上调用过程本申请实施例不对其加以限制。For the production traffic sent by the online official client, that is, the official request sent by the official client to the website, the production manager receives the request, and then calls the production traffic in the cluster according to the call link corresponding to the corresponding service ID. The function modules in each node server are called, and the specific online calling process is not limited in this embodiment of the present application.

因此,本申请可以提供至少一组测试功能模块;测试功能模块关联有业务标识、用户标识、及隔离标识;接收测试请求;测试请求包括目标业务标识和目标用户标识;根据目标业务标识和目标用户标识确定目标隔离标识;根据目标业务标识获取调用链路;根据调用链路对目标隔离标识对应的目标测试功能模块进行调用,本申请通过对待测试的功能模块设置业务标识、用户标识及隔离标识的对应关系,在进行业务测试时,测试流量可以通过确定对应的目标隔离标识,按照调用链路依次调用包含有目标隔离标识的功能模块,实现测试业务之间的隔离,研发团队在进行业务测试时,只用专注于自己的测试业务,避免不同研发团队之间工作相冲突,方便各个研发团队自己管理自己开发的应用,使各个研发团队在其测试业务出现问题时,可以独立、快速的对自己开发的应用进行查验;并且,由于进行了逻辑隔离,环境搭建成本低,可移植性强,能够支持不断扩张的全球各地的业务团队对研发环境的需求。Therefore, the present application can provide at least one group of test function modules; the test function modules are associated with service identification, user identification, and isolation identification; receive a test request; the test request includes a target service identification and a target user identification; Identify the target isolation ID; obtain the calling link according to the target business ID; call the target test function module corresponding to the target isolation ID according to the calling link, and this application sets the business ID, user ID and isolation ID for the functional module to be tested Correspondence, when performing business testing, the test traffic can determine the corresponding target isolation ID, and call the functional modules containing the target isolation ID in turn according to the call link, so as to realize the isolation between test services. When the R&D team conducts business testing , only need to focus on their own test business, avoid work conflicts between different R&D teams, facilitate each R&D team to manage their own developed applications, and enable each R&D team to independently and quickly respond to their own testing business problems. The developed application is inspected; and, due to the logical isolation, the environment construction cost is low, and the portability is strong, which can support the needs of the ever-expanding business teams around the world for the R&D environment.

参照图3,示出了本申请提供的一种调用方法的步骤流程图,具体可以包括如下步骤:Referring to FIG. 3 , it shows a flow chart of the steps of a calling method provided by the present application, which may specifically include the following steps:

步骤101,提供至少一组测试功能模块;所述测试功能模块关联有业务标识、用户标识、及隔离标识。Step 101, providing at least one group of test function modules; the test function modules are associated with a service ID, a user ID, and an isolation ID.

在本申请实施例中,功能模块是实现基本功能的程序,功能模块实现的功能可以较为单一,其自身可以实现某一特定的业务逻辑,使得功能模块在整个系统中可以作为一个微粒,在实现较为复杂的业务功能时,可以通过功能模块的组合实现,进一步的,通过将指向业务功能的业务请求与功能模块的执行条件匹配得出执行链路,实现通过功能模块的组合进行业务处理。具体的,例如,展示网站首页的业务功能,可以包括展示标题的功能模块,展示图片标识的功能模块等。In this embodiment of the application, a function module is a program that realizes basic functions. The function realized by a function module can be relatively simple, and it can realize a specific business logic by itself, so that the function module can be used as a particle in the entire system. For more complex business functions, it can be realized through the combination of functional modules. Further, the execution link is obtained by matching the business request directed to the business function with the execution conditions of the functional modules, and the business processing is realized through the combination of functional modules. Specifically, for example, the business function of displaying the homepage of the website may include a function module for displaying a title, a function module for displaying a picture logo, and the like.

参照图4,示出了本申请提供的应用于一种调用方法的系统结构图,其中,可以由分配服务器来完成提供至少一组测试功能模块的操作,测试服务器是独立于正式生产服务器的一种测试服务器,主要面向研发人员,用于软件研发测试,为了满足处于不同时区的多个研发团队的研发需求,研发团队可以通过测试客户端发送包括同一业务标识对应的至少一组测试功能模块的第二设置请求至分配服务器,分配服务器可以根据第二设置请求,生成包括相同的测试功能模块的第一设置请求并将第一设置请求发送至某个测试服务器,以供测试服务器将第一设置请求中的至少一组测试功能模块进行部署,并根据测试功能模块的隔离标识,完成不同测试业务之间的隔离,使得研发团队可以根据自己的需求,通过测试服务器对完成隔离的测试功能模块进行测试,解决了现有技术中多个研发团队共用一个测试业务的问题,也避免了多个测试业务同时进行时产生的应用调用冲突的情况,提高了测试环境的稳定性。Referring to FIG. 4, it shows a system structure diagram applied to a calling method provided by the present application, wherein the operation of providing at least one group of test function modules can be completed by the distribution server, and the test server is a separate from the official production server. A test server, mainly for R&D personnel, used for software R&D testing. In order to meet the R&D needs of multiple R&D teams in different time zones, the R&D team can send at least one group of test function modules corresponding to the same business identifier through the test client. The second setting request is sent to the distribution server, and the distribution server can generate a first setting request including the same test function module according to the second setting request and send the first setting request to a certain test server, so that the test server can transfer the first setting request to the distribution server. Deploy at least one group of test function modules in the request, and complete the isolation between different test services according to the isolation identification of the test function modules, so that the R&D team can perform isolation on the test function modules through the test server according to their own needs. The test solves the problem in the prior art that multiple R&D teams share one test service, avoids application call conflicts when multiple test services are performed simultaneously, and improves the stability of the test environment.

需要说明的是,如果有多个测试服务器,其架构可以都如测试服务器1的架构。It should be noted that, if there are multiple test servers, their architectures may all be the same as the architecture of thetest server 1 .

需要说明的是,分配服务器将测试功能模块在测试服务器中时,通常可以选择与研发团队的物理距离最近的测试服务器进行部署,以达到降低研发团队与测试服务器的通信延迟的目的,另外,也可以由研发团队自行选择需要使用的测试服务器,例如,分配服务器提供给测试客户端一个选择列表,选择列表里具有各个部署在不同国家的测试服务器,研发团队根据自己的需求,在选择列表中选取一个测试服务器并告知分配服务器,分配服务器则可以根据所选择的测试服务器进行部署。It should be noted that when assigning servers to test functional modules in the test server, usually the test server with the closest physical distance to the R&D team can be selected for deployment, so as to reduce the communication delay between the R&D team and the test server. The R&D team can choose the test server to be used. For example, the allocation server provides a selection list for the test client. The selection list has test servers deployed in different countries. The R&D team can select from the selection list according to their own needs. A test server and inform the distribution server, the distribution server can be deployed according to the selected test server.

需要说明的是,如果是服务器集群,其每个功能模块可以存到单独的节点服务器中。而节点服务器可以按区域划分,比如按国家划分,在各个区域中设置一组节点服务器,对于一个选择该区域的设置请求,则可以将相应的一组测试功能模块都按上述逻辑部署于该区域的节点服务器中。It should be noted that, if it is a server cluster, each functional module can be stored in a separate node server. The node servers can be divided by region, such as by country, and a group of node servers are set in each region. For a setting request to select the region, a corresponding group of test function modules can be deployed in the region according to the above logic in the node server.

步骤102,接收测试请求;所述测试请求包括目标业务标识和目标用户标识。Step 102, receiving a test request; the test request includes a target service ID and a target user ID.

在该步骤中,当完成测试环境中的测试功能模块的部署和隔离后,分配服务器可以将完成部署的测试服务器的互联协议地址(IP,Internet Protocol)打包在hosts文件中发送给测试客户端,测试客户端解析该hosts文件获得测试服务器的IP地址并进行绑定,使得测试客户端可以通过该IP地址发送针对测试服务器的测试请求,以进行后续测试操作。In this step, after completing the deployment and isolation of the test function modules in the test environment, the distribution server can package the Internet protocol address (IP, Internet Protocol) of the test server that has completed the deployment in the hosts file and send it to the test client. The test client parses the hosts file to obtain the IP address of the test server and binds it, so that the test client can send a test request for the test server through the IP address for subsequent test operations.

具体的,测试请求包括目标业务标识和目标用户标识,目标业务标识可以是测试客户端申请测试的业务对应的业务标识,例如,用户想针对网购应用中的页面展示功能进行测试,则可以将对应页面展示功能的目标业务标识添加进测试请求进行发送,目标用户标识是发生该测试请求的设备的标识信息,如设备的IP地址、设备相关信息等。Specifically, the test request includes the target service ID and the target user ID. The target service ID may be the service ID corresponding to the service that the test client applies for testing. For example, if the user wants to test the page display function in the online shopping application, the corresponding The target service ID of the page display function is added to the test request for sending, and the target user ID is the identification information of the device where the test request occurs, such as the IP address of the device, device-related information, etc.

步骤103,根据所述目标业务标识和目标用户标识确定目标隔离标识。Step 103: Determine the target isolation ID according to the target service ID and the target user ID.

在该步骤中,由于如前述逻辑,在部署时将用户标识与业务标识与隔离标识关联,那么当测试服务器接收到测试请求时,可以将目标业务标识和目标用户标识与测试功能模块关联的业务标识、用户标识、及隔离标识进行匹配,以确定对应的目标隔离标识,确定目标隔离标识后,则可以进一步确定带有目标隔离标识的目标测试功能模块,并在获取到调用链路后进行测试。In this step, due to the aforementioned logic, the user ID is associated with the business ID and the isolation ID during deployment, so when the test server receives the test request, it can associate the target business ID and target user ID with the business associated with the test function module ID, user ID, and isolation ID are matched to determine the corresponding target isolation ID. After the target isolation ID is determined, the target test function module with the target isolation ID can be further determined and tested after the call link is obtained. .

步骤104,根据所述目标业务标识获取调用链路。Step 104, acquiring a call link according to the target service identifier.

在该步骤中,由于如前述逻辑,对于一个业务而言,在其设定好后,其业务标识与其调用链路关联,那么当测试服务器接收到测试请求时,可以利用从测试请求中得到的目标业务标识,去查找相应的调用链路。In this step, due to the aforementioned logic, for a service, after it is set, its service identifier is associated with its invocation link, then when the test server receives the test request, it can use the Target service ID to find the corresponding call link.

在本申请实施例中,不同的测试业务对应有不同的调用链路,例如,当打开网购应用访问购物车测试功能模块A的页面渲染的时候,需要查购物车里的产品数量,则进一步需要调用产品测试功能模块B,产品测试功能模块B需要调用会员测试功能模块C等等,每个业务都需要跟上下游几百个应用进行相互调用,不同的调用链路可以与对应的业务标识进行绑定,该绑定关系可以存储在分配服务器中,因此,根据测试请求中的目标业务标识,可以查找到对应的调用链路,使得后续测试可以顺利进行。In the embodiment of this application, different test services correspond to different call links. For example, when opening the online shopping application to access the page rendering of the shopping cart test function module A, it is necessary to check the number of products in the shopping cart, then further need Call product test function module B, product test function module B needs to call member test function module C, etc., each business needs to call each other with hundreds of upstream and downstream applications, different call links can be linked with the corresponding business ID Binding, the binding relationship can be stored in the distribution server, therefore, according to the target business identifier in the test request, the corresponding call link can be found, so that the subsequent test can be carried out smoothly.

步骤105,根据所述调用链路对所述目标隔离标识对应的目标测试功能模块进行调用。Step 105, call the target test function module corresponding to the target isolation identifier according to the call link.

在实际应用中,全球化业务的研发团队通常分布在世界各地的不同时区,导致多个研发团队之间在协同作业时时间难以协调,因此,研发团队通常需要尽心处理自己的研发业务,避免由于测试业务的调用冲突这种错误,导致协作时间被用来排查错误。In practical applications, the R&D teams of global business are usually distributed in different time zones around the world, which makes it difficult to coordinate the time when multiple R&D teams work together. This kind of error in the call conflict of the test business caused the collaboration time to be used to troubleshoot the error.

在本申请实施例中,针对一组测试业务通常预设有调用链路,即一组测试业务中各个目标测试功能模块之间的调用关系,在进行业务测试时,可以按照调用链路的顺序进行目标测试功能模块的调用,根据测试业务的多样性,不同测试业务的调用链路可以不同,本申请通过对不同测试业务的目标测试功能模块设置不同的隔离标识,并在进行测试时依次调用包含隔离标识的目标测试功能模块,实现了测试业务之间的逻辑隔离,使得研发团队可以调用其独有的目标测试功能模块进行测试,避免在调用测试功能模块的过程中与其他研发团队发生冲突,提高了研发效率。In this embodiment of the application, a call link is usually preset for a group of test services, that is, the call relationship between each target test function module in a group of test services. When performing service tests, the order of the call links can be followed. To call the target test function modules, according to the diversity of test services, the call links of different test services can be different. This application sets different isolation marks for the target test function modules of different test services, and calls them in turn when testing The target test function module containing the isolation mark realizes the logical isolation between test services, so that the R&D team can call its unique target test function module for testing, avoiding conflicts with other R&D teams in the process of calling the test function module , improving R&D efficiency.

另外,参照图1,正式生产环境中,由于面向大量的用户开放,且独立于测试环境,则可以设置生产业务,即为正式上线业务,生产业务包括了多组并行的功能模块,用于承载正式生产时的较大负载,正式生产业务中功能模块的调用逻辑可以与测试业务相同,但是由于生产流量较大,则需要进行负载均衡处理,在调用下一个功能模块的时候可以选择多个功能模块中负载较低的一个,以达到负载均衡的目的,提高生产效率。In addition, referring to Figure 1, in the official production environment, since it is open to a large number of users and is independent of the test environment, you can set up production services, that is, formally launched services. The production services include multiple sets of parallel functional modules for carrying Larger load during official production, the call logic of the function module in the official production business can be the same as that of the test business, but due to the large production traffic, load balancing processing is required, and multiple functions can be selected when calling the next function module The one with the lower load among the modules can achieve the purpose of load balancing and improve production efficiency.

综上所述,本申请实施例提供的一种调用方法,包括提供至少一组测试功能模块;测试功能模块关联有业务标识、用户标识、及隔离标识;接收测试请求;测试请求包括目标业务标识和目标用户标识;根据目标业务标识和目标用户标识确定目标隔离标识;根据目标业务标识获取调用链路;根据调用链路对目标隔离标识对应的目标测试功能模块进行调用,本申请通过对待测试的功能模块设置业务标识、用户标识及隔离标识的对应关系,在进行业务测试时,测试流量可以通过确定对应的目标隔离标识,按照调用链路依次调用包含有目标隔离标识的功能模块,实现测试业务之间的隔离,研发团队在进行业务测试时,只用专注于自己的测试业务,避免不同研发团队之间工作相冲突,方便各个研发团队自己管理自己开发的应用,使各个研发团队在其测试业务出现问题时,可以独立、快速的对自己开发的应用进行查验;并且,由于进行了逻辑隔离,环境搭建成本低,可移植性强,能够支持不断扩张的全球各地的业务团队对研发环境的需求。In summary, a calling method provided by the embodiment of the present application includes providing at least one group of test function modules; the test function modules are associated with a business identifier, a user identifier, and an isolation identifier; receiving a test request; the test request includes a target service identifier and the target user ID; determine the target isolation ID according to the target business ID and the target user ID; obtain the calling link according to the target business ID; call the target test function module corresponding to the target isolation ID according to the calling link, and the application passes the test to be tested The function module sets the corresponding relationship between the service ID, user ID and isolation ID. When performing business testing, the test traffic can determine the corresponding target isolation ID and call the function modules containing the target isolation ID in sequence according to the calling link to realize the test service The isolation between R&D teams, when conducting business testing, only needs to focus on their own testing business, avoid work conflicts between different R&D teams, facilitate each R&D team to manage their own developed applications, and enable each R&D team to test in its own When business problems arise, the self-developed applications can be checked independently and quickly; moreover, due to the logical isolation, the environment construction cost is low and the portability is strong, which can support the continuously expanding business teams around the world in the research and development environment. need.

参照图5,示出了本申请提供的一种调用方法的具体步骤流程图,具体可以包括如下步骤:Referring to FIG. 5 , it shows a flow chart of specific steps of a calling method provided by the present application, which may specifically include the following steps:

步骤201,提供至少一组测试功能模块;所述测试功能模块关联有业务标识、用户标识、及隔离标识。Step 201, providing at least one group of test function modules; the test function modules are associated with a service ID, a user ID, and an isolation ID.

该步骤可以参照上述步骤101,此处不再赘述。For this step, reference may be made to theabove step 101, which will not be repeated here.

可选的,步骤201还可以包括:Optionally,step 201 may also include:

子步骤2011,接收分配服务器发送的第一设置请求,所述第一设置请求包括至少一组测试功能模块,所述第一设置请求中的测试功能模块关联有所述业务标识、所述用户标识、及所述隔离标识;所述第一设置请求由所述分配服务器在接收到测试客户端发送的第二设置请求后发送,所述第二设置请求包括至少一组测试功能模块,所述第二设置请求中的测试功能模块关联有所述业务标识、所述用户标识;所述隔离标识由所述分配服务器根据所述第二设置请求生成。Sub-step 2011, receiving the first setting request sent by the distribution server, the first setting request includes at least one group of test function modules, and the test function modules in the first setting request are associated with the service identification and the user identification , and the isolation identifier; the first setting request is sent by the allocation server after receiving the second setting request sent by the test client, the second setting request includes at least one group of test function modules, and the second setting request The test function module in the second setting request is associated with the service identifier and the user identifier; the isolation identifier is generated by the distribution server according to the second setting request.

在本申请实施例中,参照图4,可以由分配服务器统筹完成不同研发团队的测试客户端对于要测试的测试功能模块的部署操作,为了达到逻辑隔离的目的,可以将不同团队的不同测试功能模块部署在测试服务器中的不同隔离环境。In the embodiment of the present application, referring to Fig. 4, the distribution server can coordinate and complete the deployment operation of the test function modules to be tested by the test clients of different R&D teams. In order to achieve the purpose of logical isolation, different test functions of different teams can be Modules are deployed in different isolated environments in the test server.

具体的,针对上述实现过程,在一具体示例中,测试客户端1发送第二设置请求至分配服务器。第二设置请求包括至少一组测试功能模块,第二设置请求中的测试功能模块关联有业务标识、用户标识;隔离标识由分配服务器根据第二设置请求生成。Specifically, for the above implementation process, in a specific example, thetest client 1 sends a second setting request to the distribution server. The second setting request includes at least one group of test function modules, and the test function modules in the second setting request are associated with business identifiers and user identifiers; the isolation identifier is generated by the distribution server according to the second setting request.

进一步的,当分配服务器接收到第二设置请求时,会对第二设置请求中的测试功能模块添加对应的隔离标识,将添加了隔离标识的测试功能模块导入第一设置请求,并将第一设置请求发送至分配服务器。Further, when the allocation server receives the second setting request, it will add a corresponding isolation identifier to the test function module in the second setting request, import the test function module with the isolation identifier into the first setting request, and transfer the first A setup request is sent to the allocation server.

子步骤2012,根据所述第一设置请求,设置所述至少一组测试功能模块,并将所述测试功能模块与所述业务标识、所述用户标识、及所述隔离标识关联。Sub-step 2012, according to the first setting request, set the at least one group of test function modules, and associate the test function modules with the service ID, the user ID, and the isolation ID.

在本申请实施例中,参照图4,S2,分配服务器根据第二设置请求,将第一设置请求发送至测试服务器,以供测试服务器设置至少一组测试功能模块,例如,测试服务器根据分配服务器发送的第一设置请求,可以将第一设置请求包括的添加有隔离标识的测试功能模块部署在测试服务器中,通过部署的测试功能模块带有的隔离标识,使得测试客户端1申请测试的功能模块和其他测试客户端申请测试的功能模块相互隔离。In the embodiment of the present application, referring to FIG. 4, S2, the distribution server sends the first setting request to the test server according to the second setting request, so that the test server can set at least one group of test function modules, for example, the test server according to the distribution server In the first setting request sent, the test function module with the isolation mark included in the first setting request can be deployed in the test server, and thetest client 1 can apply for the function of the test through the isolation mark of the deployed test function module. Modules are isolated from other functional modules that test clients apply for testing.

进一步的,当测试服务器完成测试功能模块的部署和隔离后,分配服务器可以将完成部署的测试服务器的互联协议地址(IP,Internet Protocol)打包在hosts文件中发送给测试客户端,测试客户端解析该hosts文件获得测试服务器的IP地址并进行绑定,使得测试客户端可以通过该IP地址发送针对测试服务器的测试请求进行后续测试。Further, after the test server completes the deployment and isolation of the test function modules, the distribution server can package the Internet Protocol address (IP, Internet Protocol) of the test server that has been deployed in the hosts file and send it to the test client, and the test client resolves The hosts file obtains the IP address of the test server and binds it, so that the test client can send a test request for the test server through the IP address for subsequent testing.

可选的,调用方法应用于测试服务器,所述测试客户端的地理位置与所述测试服务器的地理位置距离最近,其中与所述测试客户端距离最近的测试服务器由所述分配服务器确定。Optionally, the invoking method is applied to a test server, and the geographic location of the test client is closest to the geographic location of the test server, wherein the test server closest to the test client is determined by the allocation server.

需要说明的是所述调用方法,可以应用于测试管理服务器,该测试管理服务器对于一组节点服务器。所述测试客户端的地理位置与所述测试管理服务器的地理位置距离最近。实际中,该测试管理服务器和其对应的节点服务器可以在同一个区域的机房中布设。It should be noted that the calling method can be applied to a test management server, and the test management server is for a group of node servers. The geographic location of the test client is closest to the geographic location of the test management server. In practice, the test management server and its corresponding node server can be deployed in a computer room in the same area.

相应的在分配服务器中,还可以包括如下步骤:Correspondingly, in the allocation server, the following steps may also be included:

子步骤A1,提供与测试客户端距离最近的测试服务器。Sub-step A1, providing the test server closest to the test client.

在本申请实施例中,全球化业务的研发团队通常分布在世界各地的不同时区,而测试服务器分布于几个固定地点,有时会产生研发团队与测试服务器之间物理距离较大的情况,全球化的距离问题体现在,正常一次中美网络访问的延迟在200毫秒左右,一次业务请求的网络往复调用会非常多,最后业务表现的响应时长就达到几秒钟或者更长时间,因此,对于这种情况,需要提供给世界各地的研发团队进行就近访问的测试服务器,以尽量减少物理距离带来的延迟。In the embodiment of this application, the R&D teams of the globalized business are usually distributed in different time zones around the world, while the test servers are distributed in several fixed locations, sometimes the physical distance between the R&D team and the test server is relatively large. The distance problem of globalization is reflected in the fact that the delay of a normal network access between China and the United States is about 200 milliseconds, and there will be a lot of network reciprocating calls for a business request, and the response time of the final business performance will reach several seconds or longer. Therefore, for In this case, it is necessary to provide nearby test servers for R&D teams around the world to minimize the delay caused by physical distance.

具体的,提供与测试客户端距离最近的测试服务器的方式可以包括:可以对研发团队的测试客户端的当前所在地点,以及当前所在地点的经纬度信息。将所述当前所在地点的经纬度信息在地址哈希模型中进行匹配,确定测试客户端的当前所在地点的经纬度在设定距离内的一个或多个测试服务器,地址哈希模型根据测试服务器所在地的经纬度信息训练得到。其中,地址哈希模型可以基于Geohash算法,该算法为一种将经纬度转换成字符串的方法,并且使得在大部分情况下,字符串前缀匹配越多的距离越近。通过将测试请求发出地的经纬度导入预先训练得到的地址哈希模型,匹配出预设公里范围以内的一个或多个测试服务器,并且根据经纬度计算出测试请求发出地距离这些测试服务器的公里数。Specifically, the manner of providing the test server closest to the test client may include: the current location of the test client of the research and development team, and the latitude and longitude information of the current location. Match the latitude and longitude information of the current location in the address hash model to determine one or more test servers whose current location latitude and longitude of the test client is within a set distance, and the address hash model is based on the latitude and longitude of the test server location Information is trained. Among them, the address hash model can be based on the Geohash algorithm, which is a method of converting latitude and longitude into strings, and in most cases, the more string prefix matches, the closer the distance. By importing the latitude and longitude of the place where the test request is sent into the pre-trained address hash model, one or more test servers within the preset kilometer range are matched, and the distance between the place where the test request is sent and these test servers is calculated according to the latitude and longitude.

进一步的,如果通过地址哈希模型的匹配,得到了一个测试服务器,则可以将该测试服务器提供给对应的研发团队,该测试服务器为离研发团队所在的最近的一个测试服务器,可以有效降低物理距离带来的延迟。Further, if a test server is obtained through the matching of the address hash model, the test server can be provided to the corresponding R&D team. The test server is the nearest test server from the R&D team, which can effectively reduce the physical delay due to distance.

另外,假设通过地址哈希模型的匹配,得到了多个测试服务器,则可以将这些测试服务器与这些测试服务器距离研发团队所在地之间的距离排列成表发送给研发团队,以供研发团队根据实际需求从中选取一个进行测试。In addition, assuming that multiple test servers are obtained through the matching of the address hash model, these test servers and the distances between these test servers and the location of the R&D team can be arranged in a table and sent to the R&D team for the R&D team to use according to the actual situation. One needs to be selected for testing.

另外,分配服务器还可以执行如下步骤:In addition, the allocation server can also perform the following steps:

子步骤B1,分配服务器为所述测试客户端提供所述测试服务器的选择界面。In sub-step B1, the allocation server provides the test client with an interface for selecting the test server.

子步骤B2,分配服务器接收所述测试客户端通过所述选择界面发送的所述第二设置请求;所述第二设置请求中的测试服务器由用户在所述选择界面中确定。In sub-step B2, the allocation server receives the second setting request sent by the test client through the selection interface; the test server in the second setting request is determined by the user in the selection interface.

在本申请实施例中,分配服务器将测试功能模块部署在测试服务器中时,通常优选的可以选择与研发团队的物理距离最近的测试服务器进行部署,以达到降低研发团队与测试服务器的通信延迟的目的,另外,也可以由分配服务器提供一个测试服务器的选择界面,使得研发团队可以自行选择需要使用的测试服务器,例如,分配服务器提供给测试客户端一个选择列表,选择列表里具有各个部署在不同国家的测试服务器,研发团队根据自己的需求,在选择列表中选取一个测试服务器并告知分配服务器,分配服务器则可以根据所选择的测试服务器进行部署。In this embodiment of the application, when the distribution server deploys the test function module in the test server, it is usually preferred to select the test server with the closest physical distance to the R&D team for deployment, so as to reduce the communication delay between the R&D team and the test server. In addition, the distribution server can also provide a test server selection interface, so that the R&D team can choose the test server to be used. For example, the distribution server provides a selection list for the test client. For the test server in the country, the R&D team selects a test server from the selection list according to their own needs and informs the distribution server, and the distribution server can be deployed according to the selected test server.

步骤202,提供至少一组基础功能模块;所述基础功能模块关联有业务标识;所述基础功能模块与所述调用链路完全匹配。Step 202, providing at least one set of basic function modules; the basic function modules are associated with service identifiers; and the basic function modules fully match the calling links.

在本申请实施例中,参照图1,基础环境中每天都会有大量的系统进入发布前的预发布测试,然后进行业务验证,这些预发布的环境是要跟测试环境进行隔离,不相互影响,基础环境面向软件研发团队和第三方合作团队,主要用于软件正式上线前的预发测试或与第三方合作团队的合作测试,基础环境中不需要进行逻辑隔离,因此,预发布基础环境中的基础功能模块可以不带有所述隔离标识,基础功能模块的功能和作用和测试环境中测试功能模块的功能和作用相同,区别之处在于基础功能模块不带有隔离标识,测试功能模块带有隔离标识。In the embodiment of this application, referring to Figure 1, a large number of systems in the basic environment will enter the pre-release test before release every day, and then perform business verification. These pre-release environments must be isolated from the test environment without mutual influence. The basic environment is for software R&D teams and third-party cooperation teams, and is mainly used for pre-release testing before the software is officially launched or cooperative testing with third-party cooperation teams. Logic isolation is not required in the basic environment. Therefore, the pre-release basic environment The basic function module may not have the isolation mark, and the functions and functions of the basic function module are the same as those of the test function module in the test environment. The difference is that the basic function module does not have an isolation mark, and the test function module has Quarantine sign.

另外,基础环境中测试的基础功能模块可以是正式上线前的最后一个版本的业务,因此,基础功能模块可以至少包括调用链路中含有的测试功能模块,以达到基础环境负载较低时,通过测试环境可以调用基础环境进行利用的目的,减少了研发环境建立的成本。In addition, the basic functional modules tested in the basic environment can be the last version of the business before the official launch. Therefore, the basic functional modules can at least include the test functional modules contained in the calling link, so that when the basic environment load is low, through The test environment can call the basic environment for utilization, reducing the cost of establishing the R&D environment.

步骤203,接收测试请求;所述测试请求包括目标业务标识和目标用户标识。Step 203, receiving a test request; the test request includes a target service ID and a target user ID.

该步骤具体可以参照上述步骤102,此处不再赘述。For this step, reference may be made to the above-mentionedstep 102 for details, which will not be repeated here.

步骤204,根据所述目标业务标识和目标用户标识确定目标隔离标识。Step 204: Determine the target isolation ID according to the target service ID and the target user ID.

该步骤具体可以参照上述步骤103,此处不再赘述。For this step, reference may be made to the above-mentionedstep 103 for details, which will not be repeated here.

步骤205,根据所述目标业务标识获取调用链路。Step 205, acquiring a calling link according to the target service identifier.

该步骤具体可以参照上述步骤104,此处不再赘述。For this step, reference may be made to the above-mentionedstep 104 for details, which will not be repeated here.

步骤206,根据所述调用链路对所述目标隔离标识对应的目标测试功能模块进行调用。Step 206: Call the target test function module corresponding to the target isolation identifier according to the call link.

该步骤具体可以参照上述步骤105,此处不再赘述。For this step, reference may be made to the above-mentionedstep 105 for details, which will not be repeated here.

可选的,在本申请实施例的另一种实施方式中,步骤204还可以包括以下子步骤:Optionally, in another implementation manner of the embodiment of this application,step 204 may also include the following sub-steps:

子步骤C1,通过中间件,根据所述调用链路对所述目标隔离标识对应的目标测试功能模块进行调用。In sub-step C1, the middleware is used to call the target test function module corresponding to the target isolation identifier according to the call link.

在本申请实施例中,测试环境的目标测试功能模块的调用处理可以依靠预发布中间件来实现,中间件是一种独立的系统软件或服务程序,分布式应用系统可以借助这种软件在不同的技术之间共享资源,例如,预发布中间件可以包括:hsf(High-Speed ServiceFramework)\notify\metaq这几个组件,这几个组件都是为了实现远程调用,hsf是实时调用的远程过程调用协议(rpc,Remote Procedure Call)中间件,notify\metaq是消息类异步调用的rpc中间件,测试业务的目标测试功能模块之间都是通过这些中间件进行相互通信的。In the embodiment of this application, the call processing of the target test function module of the test environment can be realized by relying on the pre-release middleware, which is an independent system software or service program, and the distributed application system can use this software in different Resources are shared between technologies. For example, pre-release middleware can include: hsf (High-Speed ServiceFramework)\notify\metaq These components are all for remote calls, and hsf is a remote process for real-time calls Call protocol (rpc, Remote Procedure Call) middleware, notify\metaq is the rpc middleware for asynchronous call of message type, and the target test function modules of the test business communicate with each other through these middleware.

具体的,中间件分为预发布中间件和生产中间件,预发布中间件主要用于测试环境和基础环境之间的资源共享,生产中间件主要用于生产环境之间的资源共享,其中,预发布中间件可以接收接收针对测试环境中的目标测试功能模块的测试请求,并处理该测试请求,调用相应的带有隔离标识的目标测试功能模块进行测试。Specifically, middleware is divided into pre-release middleware and production middleware. Pre-release middleware is mainly used for resource sharing between the test environment and the basic environment, and production middleware is mainly used for resource sharing between production environments. Among them, The pre-release middleware can receive a test request for a target test function module in the test environment, process the test request, and call the corresponding target test function module with an isolation flag for testing.

在调用过程中,预发布中间件通过隔离标识来通知其rpc调用相同隔离标识的下游目标测试功能模块,具体为测试业务中的每个带有隔离标识的目标测试功能模块都会被自动加入一个插件包用来给发布中间件传递这个隔离标识,保证基础环境内带有隔离标识的目标测试功能模块之间可以相互调用,不会调用其他测试业务的测试功能模块,即预发布中间件可以识别目标测试功能模块对应的隔离标识,以达到调用链路上具有同一隔离标识的目标测试功能模块之间的调用,避免调用到其他测试功能模块。另外,预发布中间件还可以包括入口接口的功能,用于接收预发流量和测试流量,并将预发流量导入基础环境,将测试流量导入测试环境。During the calling process, the pre-release middleware notifies its rpc to call the downstream target test function module with the same isolation mark through the isolation mark, specifically, each target test function module with the separation mark in the test business will be automatically added to a plug-in The package is used to pass this isolation identifier to the release middleware, to ensure that the target test function modules with isolation identifiers in the basic environment can call each other, and will not call the test function modules of other test services, that is, the pre-release middleware can identify the target The isolation identification corresponding to the test function module is used to achieve the call between the target test function modules with the same isolation identification on the call link, and avoid calling other test function modules. In addition, the pre-release middleware may also include the function of an ingress interface for receiving pre-release traffic and test traffic, importing pre-release traffic into the basic environment, and importing test traffic into the test environment.

参照图1,基于测试环境和基础环境,可以分别对应建立影子表和正式表,影子表示对正式表的一个映射拷贝,具有与其相同的数据结构,正式表用于接收生产中间件传输的生产环境中的相关业务数据,影子表用于接收预发布中间件传输的测试环境和基础环境中的相关业务数据,以达到对预发布测试数据和生产数据的存储。Referring to Figure 1, based on the test environment and the basic environment, a shadow table and an official table can be established respectively. The shadow represents a mapped copy of the official table and has the same data structure as the official table. The official table is used to receive the production environment for production middleware transmission. The relevant business data in the shadow table is used to receive the relevant business data in the test environment and basic environment transmitted by the pre-release middleware, so as to store the pre-release test data and production data.

可选的,在所述测试功能模块与所述调用链路完全匹配的情况下,步骤204还可以包括以下子步骤:Optionally, in the case that the test function module completely matches the calling link, step 204 may also include the following sub-steps:

D1,按照所述调用链路中对功能模块的调用顺序,依次调用所述目标隔离标识对应的目标测试功能模块。D1. Calling the target test function modules corresponding to the target isolation identifiers sequentially according to the calling sequence of the function modules in the calling link.

在本申请实施例中,参照图1,当测试服务器或者测试管理服务器的预发布中间件接收到研发团队的用户标识2的测试客户端,针对业务标识为1的测试功能模块发送的测试请求时,预发布中间件可以根据测试请求,先调用包括隔离标识m2的目标测试功能模块a-m2,之后根据隔离标识m2,调用同样具有隔离标识m2的目标测试功能模块b-m2,之后调用具有隔离标识m2的目标测试功能模块c-m2,最后调用具有隔离标识2的目标测试功能模块d-m2,以达到对测试功能模块a-m2、测试功能模块b-m2、测试功能模块c-m2、测试功能模块d-m2、的调用链路的实现。In the embodiment of the present application, referring to Fig. 1, when the pre-release middleware of the test server or the test management server receives the test client of the R&D team with theuser ID 2, the test request sent for the test function module with thebusiness ID 1 , according to the test request, the pre-release middleware can first call the target test function module a-m2 including the isolation flag m2, and then call the target test function module b-m2 with the isolation flag m2 according to the isolation flag m2, and then call the target test function module b-m2 with the isolation flag Identify the target test function module c-m2 of m2, and finally call the target test function module d-m2 with theisolation mark 2, to achieve the test function module a-m2, test function module b-m2, test function module c-m2, Test the implementation of the call link of the function module d-m2.

当在所述测试功能模块与所述调用链路部分匹配的情况下,即缺失调用链路中的一个或多个测试功能模块时,步骤204还可以包括以下子步骤:When the test function module partially matches the call link, that is, when one or more test function modules in the call link are missing,step 204 may also include the following substeps:

子步骤E1,对于所述调用链路中与所述测试功能模块匹配的第一位置,选取所述目标隔离标识对应的目标测试功能模块进行调用。Sub-step E1, for the first position in the call link that matches the test function module, select the target test function module corresponding to the target isolation identifier to call.

子步骤E2,对于所述调用链路中不与所述测试功能模块匹配的第二位置,选取与所述第二位置对应的基础功能模块进行调用。Sub-step E2, for the second position in the call link that does not match the test function module, select the basic function module corresponding to the second position to call.

在本申请实施例中,针对一组测试功能模块调用时,其调用链路中的第一位置为存在隔离标识的测试功能模块的位置,其调用链路中的第二位置为不存在隔离标识的测试功能模块,而存在基础功能模块的位置。In the embodiment of the present application, when calling a group of test function modules, the first position in the call link is the position of the test function module with the isolation mark, and the second position in the call link is the position without the isolation mark The test function module of the test function module, and the position of the basic function module exists.

具体的,参照图1,当测试服务器或者测试管理服务器的预发布中间件接收到研发团队的用户标识1的测试客户端,针对业务标识为1的测试功能模块发送的测试请求时,可以采用调用基础环境中的不包含隔离标识的基础功能模块c,使得调用链路为测试功能模块a-m1、测试功能模块b-m1、基础功能模块c、测试功能模块d-m1。以达到利用基础环境的资源完成业务测试的目的,提高测试环境的利用率,避免研发团队对不需要该次开发的功能模块也需要处理以便的目的,提高研发团队的开发效率。Specifically, referring to Figure 1, when the pre-release middleware of the test server or the test management server receives a test request sent by the test client with theuser ID 1 of the R&D team for the test function module with thebusiness ID 1, it can use the call The basic function module c in the basic environment that does not include the isolation identifier makes the call link be the test function module a-m1, the test function module b-m1, the basic function module c, and the test function module d-m1. In order to achieve the purpose of using the resources of the basic environment to complete the business test, improve the utilization rate of the test environment, prevent the R&D team from processing the functional modules that do not need this development, and improve the development efficiency of the R&D team.

需要说明的是,当调用至基础功能模块c之后,根据调用链路:功能模块标识a-功能模块标识b-功能模块标识c-功能模块标识d,此时应该自动调用基础功能模块c之后的下一个测试功能模块d-m1,以实现全链路的调用。It should be noted that, after calling the basic function module c, according to the call link: function module ID a-function module ID b-function module ID c-function module ID d, at this time the function after the basic function module c should be automatically called The next test function module d-m1, in order to realize the call of the whole link.

可选的,在本申请实施例的另一种实现方式中,子步骤E1可以包括:Optionally, in another implementation manner of the embodiment of this application, substep E1 may include:

子步骤E11、在调用所述调用链路中,第一个与所述目标隔离标识对应的目标测试功能模块的情况下,生成针对所述测试请求的识别标识。Sub-step E11 , in the case of invoking the first target test function module corresponding to the target isolation identifier in the calling link, generating an identification identifier for the test request.

在本申请实施例中,基于对测试服务器建立的成本等因素的考虑,可以通过测试服务器中测试环境与基础环境之间进行资源共享,使得对于测试环境中需要测试的某些带有隔离标识的测试功能模块,可以在测试环境中将其删除,进而通过调用基础环境中相同功能的基础功能模块来完成业务测试,达到了利用基础环境的资源的目的,例如,当基础环境的使用负载较低时,测试环境就可以调用基础环境中的基础功能模块用来完成业务测试,从而降低测试环境的负载。In this embodiment of the application, based on the consideration of factors such as the cost of establishing the test server, resource sharing between the test environment and the basic environment in the test server can be carried out, so that some isolation marks that need to be tested in the test environment The test function module can be deleted in the test environment, and then the business test can be completed by calling the basic function module with the same function in the basic environment, so as to achieve the purpose of using the resources of the basic environment. For example, when the usage load of the basic environment is low When , the test environment can call the basic functional modules in the basic environment to complete the business test, thereby reducing the load on the test environment.

需要说明的是,基于上述需求,在预发布中间件调用至不带有隔离标识的基础功能模块时,由于此时基础功能模块不包含隔离标识,因此预发布中间件无法通过隔离标识进一步识别后续调用的是具有隔离标识的测试功能模块,还是进一步调用不含隔离标识的基础功能模块,此时,可以通过生成一个识别标识,通过对识别标识的查询,获取完整的调用链路进行查询对应的隔离标识。It should be noted that, based on the above requirements, when the pre-release middleware calls the basic function module without the isolation identifier, since the basic function module does not contain the isolation identifier at this time, the pre-release middleware cannot further identify the subsequent Whether to call a test function module with an isolation ID or to further call a basic function module without an isolation ID, at this time, you can generate an identification ID and query the identification ID to obtain a complete call link to query the corresponding Quarantine sign.

识别标识也可以称为鹰眼标识或者说鹰眼ID,通常研发团队发送测试请求时,会将研发团队的用户标识跟鹰眼ID建立对应关系,从而与该测试请求绑定,鹰眼ID在调用过程中是按照预设链路顺序透传下去的,具体为该研发团队的用户标识发起测试请求进行访问的时候,第一个被调用的带有隔离标识的测试功能模块就会产生唯一的鹰眼ID与该用户标识进行绑定,然后测试请求的对应的预发布中间件在调用下游带有隔离标识的测试功能模块的时候都会把这个鹰眼ID带上,并将该鹰眼ID所调用的所有测试功能模块的信息打印到预发布中间件的调用日志中,这样通过基于大数据搜索该鹰眼ID就可以算出一次测试业务所调用经过的所有带有隔离标识的测试功能模块,可以实现调用链路的分析。在调用完成后,可以将该鹰眼ID与用户标识的对应关系解除。当然,在实际应用中鹰眼ID可以根据测试请求中的用户标识生成,也可以根据测试请求中的用户标识、业务标识生成,也可以根据其他信息生成,只需要保证鹰眼ID具有全局唯一性即可,本申请实施例不对其加以限制。The identification mark can also be called Hawkeye logo or Hawkeye ID. Usually, when the R&D team sends a test request, it will establish a corresponding relationship between the user ID of the R&D team and the Hawkeye ID, so as to be bound to the test request. The Hawkeye ID is in The calling process is transparently transmitted in accordance with the preset link sequence. Specifically, when the user ID of the R&D team initiates a test request for access, the first called test function module with an isolation ID will generate a unique The Eagle Eye ID is bound to the user ID, and then the corresponding pre-release middleware of the test request will bring the Eagle Eye ID with it when calling the downstream test function module with the isolation ID, and the The information of all the test function modules called is printed to the call log of the pre-release middleware, so that by searching the Eagle Eye ID based on big data, all the test function modules with isolation identifiers that have been called by a test service can be calculated. Realize the analysis of calling links. After the call is completed, the corresponding relationship between the Eagle Eye ID and the user ID can be released. Of course, in practical applications, the Hawkeye ID can be generated based on the user ID in the test request, or based on the user ID and service ID in the test request, or based on other information, as long as the Hawkeye ID is globally unique. That is, the embodiment of the present application does not limit it.

可选的,子步骤E11还可以包括:Optionally, sub-step E11 may also include:

子步骤F1、在调用所述调用链路中,第一个与所述目标隔离标识对应的目标测试功的情况下,获取所述测试请求对应的用户标识。Sub-step F1, in the case of invoking the first target test function corresponding to the target isolation ID in the calling link, obtain the user ID corresponding to the test request.

在该步骤中,测试客户端在发送测试请求时可以附加上相应的用户标识,例如用户IP。当设置限定条件为一个用户标识只能上传一组测试功能模块时,则可以用该用户ID生成识别标识,从而方便该识别标识与该用户标识等信息进行绑定,方便后续通过识别标识在配置文件中查询对应的用户标识,以及用户标识对应的测试环境的访问地址以及测试功能模块的隔离标识之间的对应关系,使得后续调用链路畅通无阻。In this step, the test client may attach a corresponding user identifier, such as user IP, when sending the test request. When the limit condition is set that a user ID can only upload a set of test function modules, the user ID can be used to generate an identification ID, so as to facilitate the binding of the identification ID with the user ID and other information, and facilitate subsequent configuration through the identification ID Query the corresponding user ID in the file, and the corresponding relationship between the access address of the test environment corresponding to the user ID and the isolation ID of the test function module, so that the subsequent call link is unimpeded.

需要说明的是,如果一个用户标识可以上传多组测试功能模块时,则可以将鹰眼标识与其他能够唯一指示该组测试功能模块的信息进行绑定,本申请实施例不对其加以限制。It should be noted that if a user ID can upload multiple sets of test function modules, the Eagle Eye ID can be bound with other information that can uniquely indicate the set of test function modules, which is not limited in this embodiment of the present application.

子步骤F2、根据所述用户标识生成所述识别标识。Sub-step F2, generating the identification mark according to the user identity.

在本申请实施例中,将用户标识、测试服务器的访问地址以及隔离标识之间的对应关系保存至配置文件中,可以形成该测试客户端的用户标识对应的相关配置,以便后续根据透传的识别标识,在该相关配置中查找对应的访问地址以及隔离标识,使得测试客户端确定所需要访问测试服务器的访问地址,进行访问,并进一步确定对应的隔离标识,以避免访问到其他测试客户端的隔离环境。其中,测试服务器的访问地址可以理解为前述业务标识。In the embodiment of this application, the corresponding relationship between the user ID, the access address of the test server and the isolation ID is saved in the configuration file, and the relevant configuration corresponding to the user ID of the test client can be formed, so that the subsequent identification based on the transparent transmission ID, find the corresponding access address and isolation ID in the relevant configuration, so that the test client can determine the access address of the test server that needs to be accessed, access it, and further determine the corresponding isolation ID to avoid access to other test clients. environment. Wherein, the access address of the test server can be understood as the aforementioned service identifier.

在该步骤中,根据用户标识生成识别标识的逻辑可以为,先获取用户的用户标识,在配置文件中查询是否有该用户标识所对应的相关配置存在,若有,则可以将用户标识的前若干位字符设定为识别标识,若无先关配置存在,则因为配置中心存在测试服务器对应的机器标识于测试服务器的访问地址、以及测试功能模块的隔离标识之间的对应关系,则可以将测试服务器对应的机器标识的前若干位字符设定为识别标识,以便对有或无用户标识的测试流量进行区分。In this step, the logic of generating the identification ID according to the user ID can be as follows: first obtain the user ID of the user, and check whether there is a relevant configuration corresponding to the user ID in the configuration file; A number of characters are set as the identification mark. If there is no pre-closed configuration, then because the configuration center has a corresponding relationship between the machine mark corresponding to the test server, the access address of the test server, and the isolation mark of the test function module, the The first few characters of the machine ID corresponding to the test server are set as the identification ID, so as to distinguish the test traffic with or without the user ID.

需要说明的是,生成的识别标识需要与对应用户标识进行绑定,以便于通过用户标识,在预发布中间件的调用日志中查找相关的调用链路。该用户标识可以为测试客户端的设备ID,也可以为其他能够表明身份的标识信息。It should be noted that the generated identification ID needs to be bound with the corresponding user ID, so as to find the relevant call link in the call log of the pre-release middleware through the user ID. The user identification may be the device ID of the test client, or other identification information that can indicate the identity.

子步骤E12、对于所述调用链路中的第一位置,当所述第一位置的上一个位置为所述第二位置的情况下,如果所述第二位置对应的基础功能模块调用完毕,则根据所述测试请求对应的识别标识,确定所述目标隔离标识。Sub-step E12, for the first position in the call link, when the previous position of the first position is the second position, if the basic function module corresponding to the second position has been called, Then, the target isolation identifier is determined according to the identification identifier corresponding to the test request.

在识别标识与用户绑定后,当后续的基础功能模块调用完毕后,由于基础功能模块本身不带有隔离标识,因此通过该基础功能模块不能确定后续是调用有隔离标识的测试功能模块还是继续调用基础功能模块,因此需要根据测试请求对应的识别标识确定隔离标识。那么可以根据生成的识别标识,在预发布中间件的调用日志中查找到该识别标识对应的用户针对第一测试业务所调用经过的所有带有隔离标识的测试功能模块,可以实现调用链路的分析,确定对应的隔离标识。其中,该调用日志是预发布中间件在对各个功能模块进行调用后生成的,即预发布中间件对各个功能模块调用后,都会将功能模块标识、隔离标识、鹰眼标识之间的对应关系存储到调用日志中。After the identification logo is bound to the user, when the subsequent basic function module is called, because the basic function module itself does not have an isolation logo, it cannot be determined whether to call the test function module with the isolation logo or continue through the basic function module. Call the basic function module, so the isolation ID needs to be determined according to the identification ID corresponding to the test request. Then, according to the generated identification, all the test function modules with isolation identifications that the user corresponding to the identification has called for the first test service can be found in the call log of the pre-release middleware, and the call link can be realized. Analyze and determine the corresponding isolation identification. Among them, the call log is generated by the pre-release middleware after calling each function module, that is, after the pre-release middleware calls each function module, it will record the corresponding relationship between the function module ID, the isolation ID, and the eagle-eye ID stored in the call log.

子步骤E13、根据所述隔离标识,查找所述第一位置对应的目标测试功能模块。Sub-step E13, according to the isolation identifier, search for the target test function module corresponding to the first location.

子步骤E14、调用所述目标测试功能模块。Sub-step E14, calling the target test function module.

在本申请实施例中,参照图1,当测试服务器或者测试管理服务器的预发布中间件接收到研发团队的用户标识1的测试客户端,针对业务标识为1的测试功能模块发送的测试请求时,由于不存在带有隔离标识m1的测试功能模块c-m1,那么可以调用基础环境中的不包含隔离标识的基础功能模块c,从而可以依次测试功能模块a-m1、测试功能模块b-m、基础功能模块c-测试功能模块d-m1,使业务可以完整执行以达到利用基础环境的资源进行业务测试的目的,提高测试环境的利用率。In the embodiment of the present application, referring to FIG. 1, when the test server or the pre-release middleware of the test management server receives the test client of theuser ID 1 of the R&D team, the test request sent for the test function module with the service ID of 1 , since there is no test function module c-m1 with isolation identifier m1, then the basic function module c in the basic environment that does not contain the isolation identifier can be called, so that the function module a-m1, test function module b-m, and basic The functional module c-testing functional module d-m1 enables the business to be fully executed to achieve the purpose of using the resources of the basic environment for business testing and improve the utilization rate of the testing environment.

需要说明的是,当调用至基础功能模块c之后,可以根据测试请求对应的识别标识在预发布中间件的调用日志中确定隔离标识为m1,根据隔离标识m1,调用下一个调用链路中的测试功能模块d-m1-1,以实现全链路的调用。It should be noted that after the call to the basic function module c, the isolation identifier can be determined as m1 in the call log of the pre-release middleware according to the identification identifier corresponding to the test request, and according to the isolation identifier m1, call the Test the function module d-m1-1 to realize the call of the whole link.

综上所述,本申请实施例提供的一种调用方法,提供至少一组测试功能模块;测试功能模块关联有业务标识、用户标识、及隔离标识;接收测试请求;测试请求包括目标业务标识和目标用户标识;根据目标业务标识和目标用户标识确定目标隔离标识;根据目标业务标识获取调用链路;根据调用链路对目标隔离标识对应的目标测试功能模块进行调用,且在调用过程中,当缺失调用链路中的一个或多个带有隔离标识的测试功能模块时,则选取提供的基础环境中对应的一个或多个不带有隔离标识的基础功能模块进行调用,达到利用基础环境进行业务测试的目的,本申请通过对待测试的功能模块设置业务标识、用户标识及隔离标识的对应关系,在进行业务测试时,测试流量可以通过确定对应的目标隔离标识,按照调用链路依次调用包含有目标隔离标识的功能模块,实现测试业务之间的隔离,研发团队在进行业务测试时,只用专注于自己的测试业务,避免不同研发团队之间工作相冲突,方便各个研发团队自己管理自己开发的应用,使各个研发团队在其测试业务出现问题时,可以独立、快速的对自己开发的应用进行查验;并且,由于进行了逻辑隔离,环境搭建成本低,可移植性强,能够支持不断扩张的全球各地的业务团队对研发环境的需求。To sum up, a calling method provided by the embodiment of the present application provides at least one group of test function modules; the test function modules are associated with business identifiers, user identifiers, and isolation identifiers; receive test requests; test requests include target service identifiers and target user ID; determine the target isolation ID according to the target business ID and target user ID; obtain the calling link according to the target business ID; call the target test function module corresponding to the target isolation ID according to the calling link, and during the calling process, when When one or more test function modules with isolation identifiers in the call link are missing, one or more corresponding basic function modules without isolation identifiers in the provided basic environment are selected to call, so as to use the basic environment to perform For the purpose of business testing, this application sets the corresponding relationship between business ID, user ID and isolation ID for the functional modules to be tested. When performing business testing, the test traffic can determine the corresponding target isolation ID, and call the included ID in sequence according to the calling link The functional modules with target isolation marks realize the isolation between test services. When conducting business tests, the R&D team only needs to focus on their own test services, avoiding work conflicts between different R&D teams, and making it easier for each R&D team to manage themselves The developed application enables each R&D team to independently and quickly check the application developed by itself when there is a problem with its testing business; moreover, due to the logical isolation, the environment construction cost is low, the portability is strong, and it can support continuous Expanded business teams around the world require R&D environments.

参照图6,示出了本申请一个调用装置的结构图。该实施例可以应用于前述的测试服务器,也可以应用于前述的测试管理服务器。该调用装置具体可以包括:Referring to FIG. 6 , it shows a structural diagram of a calling device of the present application. This embodiment can be applied to the aforementioned test server, and can also be applied to the aforementioned test management server. The calling device may specifically include:

第一提供模块301,用于提供至少一组测试功能模块;所述测试功能模块关联有业务标识、用户标识、及隔离标识;The first providing module 301 is configured to provide at least one group of test function modules; the test function modules are associated with a business identifier, a user identifier, and an isolation identifier;

接收模块302,用于接收测试请求;所述测试请求包括目标业务标识和目标用户标识;A receiving module 302, configured to receive a test request; the test request includes a target service identifier and a target user identifier;

确定模块303,用于根据所述目标业务标识和目标用户标识确定目标隔离标识;A determining module 303, configured to determine a target isolation ID according to the target service ID and the target user ID;

获取模块304,用于根据所述目标业务标识获取调用链路;An acquisition module 304, configured to acquire an invocation link according to the target service identifier;

调用模块305,用于根据所述调用链路对所述目标隔离标识对应的目标测试功能模块进行调用。The calling module 305 is configured to call the target test function module corresponding to the target isolation identifier according to the calling link.

综上所述,本申请实施例提供的一种调用装置,包括提供至少一组测试功能模块;测试功能模块关联有业务标识、用户标识、及隔离标识;接收测试请求;测试请求包括目标业务标识和目标用户标识;根据目标业务标识和目标用户标识确定目标隔离标识;根据目标业务标识获取调用链路;根据调用链路对目标隔离标识对应的目标测试功能模块进行调用,本申请通过对待测试的功能模块设置业务标识、用户标识及隔离标识的对应关系,在进行业务测试时,测试流量可以通过确定对应的目标隔离标识,按照调用链路依次调用包含有目标隔离标识的功能模块,实现测试业务之间的隔离,研发团队在进行业务测试时,只用专注于自己的测试业务,避免不同研发团队之间工作相冲突,方便各个研发团队自己管理自己开发的应用,使各个研发团队在其测试业务出现问题时,可以独立、快速的对自己开发的应用进行查验;并且,由于进行了逻辑隔离,环境搭建成本低,可移植性强,能够支持不断扩张的全球各地的业务团队对研发环境的需求。In summary, a calling device provided by the embodiment of the present application includes providing at least one group of test function modules; the test function modules are associated with a business identifier, a user identifier, and an isolation identifier; receiving a test request; the test request includes a target service identifier and the target user ID; determine the target isolation ID according to the target business ID and the target user ID; obtain the calling link according to the target business ID; call the target test function module corresponding to the target isolation ID according to the calling link, and the application passes the test to be tested The function module sets the corresponding relationship between the service ID, user ID and isolation ID. When performing business testing, the test traffic can determine the corresponding target isolation ID and call the function modules containing the target isolation ID in sequence according to the calling link to realize the test service The isolation between R&D teams, when conducting business testing, only needs to focus on their own testing business, avoid work conflicts between different R&D teams, facilitate each R&D team to manage their own developed applications, and enable each R&D team to test in its own When business problems arise, the self-developed applications can be checked independently and quickly; moreover, due to the logical isolation, the environment construction cost is low and the portability is strong, which can support the continuously expanding business teams around the world in the research and development environment. need.

参照图7,示出了本申请一个具体示例中的一种调用装置的具体结构图。该实施例可以应用于前述的测试服务器,也可以应用于前述的测试管理服务器。该装置具体可以包括:Referring to FIG. 7 , it shows a specific structural diagram of a calling device in a specific example of the present application. This embodiment can be applied to the aforementioned test server, and can also be applied to the aforementioned test management server. Specifically, the device may include:

第一提供模块401,用于提供至少一组测试功能模块;所述测试功能模块关联有业务标识、用户标识、及隔离标识;The first providing module 401 is configured to provide at least one group of test function modules; the test function modules are associated with service identifiers, user identifiers, and isolation identifiers;

可选的,第一提供模块401还包括:Optionally, the first providing module 401 also includes:

接收子模块,用于接收分配服务器发送的第一设置请求,所述第一设置请求包括至少一组测试功能模块,所述第一设置请求中的测试功能模块关联有所述业务标识、所述用户标识、及所述隔离标识;所述第一设置请求由所述分配服务器在接收到测试客户端发送的第二设置请求后发送,所述第二设置请求包括至少一组测试功能模块,所述第二设置请求中的测试功能模块关联有所述业务标识、所述用户标识;所述隔离标识由所述分配服务器根据所述第二设置请求生成;The receiving submodule is configured to receive the first setting request sent by the distribution server, the first setting request includes at least one group of test function modules, and the test function modules in the first setting request are associated with the service identifier, the User ID, and the isolation ID; the first setting request is sent by the distribution server after receiving the second setting request sent by the test client, and the second setting request includes at least one group of test function modules, so The test function module in the second setting request is associated with the business identifier and the user identifier; the isolation identifier is generated by the distribution server according to the second setting request;

设置子模块,用于根据所述第一设置请求,设置所述至少一组测试功能模块,并将所述测试功能模块与所述业务标识、所述用户标识、及所述隔离标识关联。The setting sub-module is configured to set the at least one group of test function modules according to the first setting request, and associate the test function modules with the service identifier, the user identifier, and the isolation identifier.

可选的,所述调用方法应用于测试服务器,所述测试客户端的地理位置与所述测试服务器的地理位置距离最近,其中与所述测试客户端距离最近的测试服务器由所述分配服务器确定。Optionally, the invoking method is applied to a test server, and the geographic location of the test client is closest to the geographic location of the test server, wherein the test server closest to the test client is determined by the distribution server.

第二提供模块402,用于提供至少一组基础功能模块;所述基础功能模块关联有业务标识;所述基础功能模块与所述调用链路完全匹配。The second providing module 402 is configured to provide at least one set of basic function modules; the basic function modules are associated with service identifiers; and the basic function modules fully match the calling link.

接收模块403,用于接收测试请求;所述测试请求包括目标业务标识和目标用户标识;A receiving module 403, configured to receive a test request; the test request includes a target service identifier and a target user identifier;

确定模块404,用于根据所述目标业务标识和目标用户标识确定目标隔离标识;A determining module 404, configured to determine a target isolation ID according to the target service ID and the target user ID;

获取模块405,用于根据所述目标业务标识获取调用链路;An acquisition module 405, configured to acquire an invocation link according to the target service identifier;

调用模块406,用于根据所述调用链路对所述目标隔离标识对应的目标测试功能模块进行调用。The calling module 406 is configured to call the target test function module corresponding to the target isolation identifier according to the calling link.

可选的,调用模块406包括:Optionally, calling module 406 includes:

第一调用子模块,用于按照所述调用链路中对功能模块的调用顺序,依次调用所述目标隔离标识对应的目标测试功能模块。The first invoking sub-module is configured to sequentially invoke the target test function module corresponding to the target isolation identifier according to the invocation sequence of the function modules in the invocation link.

第二调用子模块,用于对于所述调用链路中与所述测试功能模块匹配的第一位置,选取所述目标隔离标识对应的目标测试功能模块进行调用;The second calling sub-module is used to select the target test function module corresponding to the target isolation identifier for the first position matching the test function module in the call link to call;

可选的,第二调用子模块,包括:Optionally, the second call submodule includes:

确定单元,用于对于所述调用链路中的第一位置,当所述第一位置的上一个位置为所述第二位置的情况下,如果所述第二位置对应的基础功能模块调用完毕,则根据所述测试请求对应的识别标识,确定所述目标隔离标识;The determining unit is configured to, for the first position in the call chain, when the previous position of the first position is the second position, if the basic function module corresponding to the second position has been called , then determine the target isolation identifier according to the identification identifier corresponding to the test request;

查找单元,用于根据所述隔离标识,查找所述第一位置对应的目标测试功能模块;A search unit, configured to search for the target test function module corresponding to the first position according to the isolation identifier;

调用单元,用于调用所述目标测试功能模块。The calling unit is used to call the target test function module.

第三调用子模块,用于对于所述调用链路中不与所述测试功能模块匹配的第二位置,选取与所述第二位置对应的基础功能模块进行调用。The third invocation sub-module is configured to select a basic function module corresponding to the second location for a second location in the invocation link that does not match the test function module to call.

中间件调用子模块,用于通过中间件,根据所述调用链路对所述目标隔离标识对应的目标测试功能模块进行调用。The middleware call sub-module is used to call the target test function module corresponding to the target isolation identifier according to the call link through the middleware.

生成模块407,用于在调用所述调用链路中,第一个与所述目标隔离标识对应的目标测试功能模块的情况下,生成针对所述测试请求的识别标识。The generating module 407 is configured to generate an identification identifier for the test request when the first target test function module corresponding to the target isolation identifier in the calling link is invoked.

可选的,生成模块407,包括:Optionally, generate module 407, including:

获取子模块,用于在调用所述调用链路中,第一个与所述目标隔离标识对应的目标测试功能模块的情况下,获取所述测试请求对应的用户标识;An acquisition submodule, configured to acquire the user ID corresponding to the test request when calling the first target test function module corresponding to the target isolation ID in the calling link;

生成子模块,用于根据所述用户标识生成所述识别标识。A generating submodule, configured to generate the identification mark according to the user identity.

综上所述,本申请实施例提供的一种调用装置,包括提供至少一组测试功能模块;测试功能模块关联有业务标识、用户标识、及隔离标识;接收测试请求;测试请求包括目标业务标识和目标用户标识;根据目标业务标识和目标用户标识确定目标隔离标识;根据目标业务标识获取调用链路;根据调用链路对目标隔离标识对应的目标测试功能模块进行调用,且在调用过程中,当缺失调用链路中的一个或多个带有隔离标识的测试功能模块时,则选取提供的基础环境中对应的一个或多个不带有隔离标识的基础功能模块进行调用,达到利用基础环境进行业务测试的目的,本申请通过对待测试的功能模块设置业务标识、用户标识及隔离标识的对应关系,在进行业务测试时,测试流量可以通过确定对应的目标隔离标识,按照调用链路依次调用包含有目标隔离标识的功能模块,实现测试业务之间的隔离,研发团队在进行业务测试时,只用专注于自己的测试业务,避免不同研发团队之间工作相冲突,方便各个研发团队自己管理自己开发的应用,使各个研发团队在其测试业务出现问题时,可以独立、快速的对自己开发的应用进行查验;并且,由于进行了逻辑隔离,环境搭建成本低,可移植性强,能够支持不断扩张的全球各地的业务团队对研发环境的需求。In summary, a calling device provided by the embodiment of the present application includes providing at least one group of test function modules; the test function modules are associated with a business identifier, a user identifier, and an isolation identifier; receiving a test request; the test request includes a target service identifier and the target user ID; determine the target isolation ID according to the target business ID and the target user ID; obtain the calling link according to the target business ID; call the target test function module corresponding to the target isolation ID according to the calling link, and during the calling process, When one or more test function modules with isolation identifiers in the calling link are missing, select one or more corresponding basic function modules without isolation identifiers in the provided basic environment to call, so as to use the basic environment For the purpose of business testing, this application sets the corresponding relationship between business ID, user ID and isolation ID for the functional modules to be tested. When performing business testing, the test traffic can be called in sequence according to the call link by determining the corresponding target isolation ID. Contains functional modules with target isolation marks to achieve isolation between test services. When conducting business tests, the R&D team only needs to focus on their own test services, avoiding work conflicts between different R&D teams, and facilitating the management of each R&D team. The self-developed application enables each R&D team to independently and quickly check the self-developed application when there is a problem with its testing business; moreover, due to the logical isolation, the environment construction cost is low, the portability is strong, and it can support The needs of R&D environments for business teams expanding across the globe.

对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.

图8是本申请实施例提供的一种装置的结构示意图。参见图8,装置可以包括服务器500,服务器500可以用于实施上述实施例中提供的调用方法。该服务器500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processingunits,CPU)522(例如,一个或一个以上处理器)和存储器532,一个或一个以上存储应用程序542或数据544的存储介质530(例如一个或一个以上海量存储设备)。其中,存储器532和存储介质530可以是短暂存储的或持久存储的。存储在存储介质530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对服务器中的一系列指令操作。更进一步地,中央处理器522可以设置为与存储介质530通信,在服务器500上执行存储介质530中的一系列指令操作。Fig. 8 is a schematic structural diagram of a device provided by an embodiment of the present application. Referring to FIG. 8 , the device may include aserver 500, and theserver 500 may be used to implement the invocation method provided in the foregoing embodiments. Theserver 500 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (central processing units, CPU) 522 (for example, one or more processors) andmemory 532, one or more A storage medium 530 (such as one or more mass storage devices) storingapplication programs 542 ordata 544 . Wherein, thememory 532 and thestorage medium 530 may be stored temporarily or permanently. The program stored in thestorage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, thecentral processing unit 522 may be configured to communicate with thestorage medium 530 , and execute a series of instruction operations in thestorage medium 530 on theserver 500 .

服务器500还可以包括一个或一个以上电源526,一个或一个以上有线或无线网络接口550,一个或一个以上输入输出接口558,一个或一个以上键盘556,和/或,一个或一个以上操作系统541,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。其中,中央处理器522可以在服务器500上执行以下操作的指令:Theserver 500 can also include one or more power supplies 526, one or more wired or wireless network interfaces 550, one or more input andoutput interfaces 558, one ormore keyboards 556, and/or, one ormore operating systems 541 , such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc. Wherein, thecentral processing unit 522 can execute the following instructions on the server 500:

提供至少一组测试功能模块;所述测试功能模块关联有业务标识、用户标识、及隔离标识;Provide at least one group of test function modules; the test function modules are associated with business identification, user identification, and isolation identification;

接收测试请求;所述测试请求包括目标业务标识和目标用户标识;Receive a test request; the test request includes a target service identifier and a target user identifier;

根据所述目标业务标识和目标用户标识确定目标隔离标识;Determine the target isolation ID according to the target service ID and the target user ID;

根据所述目标业务标识获取调用链路;Obtain an invocation link according to the target service identifier;

根据所述调用链路对所述目标隔离标识对应的目标测试功能模块进行调用。The target test function module corresponding to the target isolation identifier is called according to the call link.

当然,还可以执行其他服务器侧的指令。本申请提供一种装置,其上存储有指令的一个或多个机器可读介质,当由所述一个或多个处理器执行时,使得所述装置执行一种调用方法。Of course, other server-side instructions may also be executed. The present application provides an apparatus, one or more machine-readable media having instructions stored thereon, and when executed by the one or more processors, causes the apparatus to execute an invoking method.

本申请还提供一个或多个机器可读介质,其上存储有指令,当由一个或多个处理器执行时,使得装置执行一种调用方法。The present application also provides one or more machine-readable media, on which are stored instructions, which, when executed by one or more processors, cause an apparatus to execute an invoking method.

本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.

本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiment of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor or processor of other programmable data processing terminal equipment to produce a machine such that instructions executed by the computer or processor of other programmable data processing terminal equipment Produce means for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the The instruction means implements the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded into a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce computer-implemented processing, thereby The instructions executed above provide steps for implementing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。While the preferred embodiments of the embodiments of the present application have been described, additional changes and modifications can be made to these embodiments by those skilled in the art once the basic inventive concept is understood. Therefore, the appended claims are intended to be interpreted to cover the preferred embodiment and all changes and modifications that fall within the scope of the embodiments of the application.

最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should also be noted that in this text, relational terms such as first and second etc. are only used to distinguish one entity or operation from another, and do not necessarily require or imply that these entities or operations, any such actual relationship or order exists. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or terminal equipment comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements identified, or also include elements inherent in such a process, method, article, or end-equipment. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.

以上对本申请所提供的一种调用方法及装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A calling method and device provided by this application has been introduced in detail above. In this paper, specific examples are used to illustrate the principle and implementation of this application. The description of the above embodiment is only used to help understand the method of this application. and its core idea; for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood as limiting the application .

Claims (20)

CN201810753312.8A2018-07-102018-07-10Calling method and deviceActiveCN110704296B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201810753312.8ACN110704296B (en)2018-07-102018-07-10Calling method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201810753312.8ACN110704296B (en)2018-07-102018-07-10Calling method and device

Publications (2)

Publication NumberPublication Date
CN110704296A CN110704296A (en)2020-01-17
CN110704296Btrue CN110704296B (en)2023-03-10

Family

ID=69192870

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201810753312.8AActiveCN110704296B (en)2018-07-102018-07-10Calling method and device

Country Status (1)

CountryLink
CN (1)CN110704296B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111858297A (en)*2020-01-212020-10-30北京嘀嘀无限科技发展有限公司 Online simulation test environment construction method, device and computer-readable storage medium
CN111324530B (en)*2020-02-032023-12-05京东科技控股股份有限公司Prefire testing method, prefire testing device, prefire testing equipment and storage medium
CN111464380B (en)*2020-03-192022-02-08时时同云科技(成都)有限责任公司Method, device and system for parallel testing of multiple service items
CN111464383A (en)*2020-03-302020-07-28中国建设银行股份有限公司System capacity testing method and device based on production environment
CN113542796B (en)*2020-04-222023-08-08腾讯科技(深圳)有限公司Video evaluation method, device, computer equipment and storage medium
CN113761430A (en)*2020-07-172021-12-07北京京东尚科信息技术有限公司Service access method, device, equipment and computer readable storage medium
CN114490336A (en)*2021-12-282022-05-13阿里云计算有限公司Joint debugging test method, access system, front end and storage medium
CN114928566B (en)*2022-05-162024-05-10广州博冠信息科技有限公司Function test method and device of client, storage medium and electronic equipment
CN115185816B (en)*2022-06-162025-04-18平安银行股份有限公司 A code coverage testing method, computer device and storage medium
CN115098155A (en)*2022-06-302022-09-23拉扎斯网络科技(上海)有限公司Service configuration method and device, storage medium and computer equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101360007A (en)*2007-07-302009-02-04辉达公司 Client Server System for Analysis and Performance Tuning of Remote Graphics Devices
CN106484603A (en)*2015-08-262017-03-08阿里巴巴集团控股有限公司A kind of service test method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8370478B2 (en)*2004-09-072013-02-05Hewlett-Packard Development Company, L.P.Testing a data communication architecture

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101360007A (en)*2007-07-302009-02-04辉达公司 Client Server System for Analysis and Performance Tuning of Remote Graphics Devices
CN106484603A (en)*2015-08-262017-03-08阿里巴巴集团控股有限公司A kind of service test method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
业务架构设计方法论-业务与业务隔离、业务与平台隔离;zhifeng687;《公开网址:https://blog.csdn.net/qq_26222859/article/details/48918277》;20151005;第1-2页*

Also Published As

Publication numberPublication date
CN110704296A (en)2020-01-17

Similar Documents

PublicationPublication DateTitle
CN110704296B (en)Calling method and device
CN111290828B (en) Computer-implemented method, system for deploying resources, and computer-readable medium
US8819672B2 (en)Multi-image migration system and method
US11100106B1 (en)Query engine virtualization
US9229759B2 (en)Virtual machine provisioning using replicated containers
US8661103B2 (en)Business application address determination
US20130254761A1 (en)Granular application sessions tagging
US20120078595A1 (en)Method and apparatus for ontology matching
US20130086594A1 (en)Execution of applications distributed across a plurality of computing devices
WO2019057055A1 (en)Task processing method and apparatus, electronic device, and storage medium
CN112149079A (en) Planning review management platform and user access authorization method based on microservice architecture
US11461288B2 (en)Systems and methods for database management system (DBMS) discovery
CN108984202A (en) A method, device and storage medium for sharing electronic resources
CN114385318A (en)Parallel testing method, device and equipment based on kubernets
KR102741074B1 (en)Method of converting and interworking ocf resourse of internet service, and an apparatus performing the same
CN114385382B (en) Light application access method, device, computer equipment and storage medium
CN115599669A (en)Debugging method and device of microservice, electronic equipment and readable storage medium
CN117435456A (en) Debugging method, device, electronic equipment and computer-readable storage medium
WO2025158261A1 (en)Request processing method and apparatus, and task execution method and apparatus
CN117112451A (en)Test method, test device, electronic equipment and computer readable storage medium
US20240028346A1 (en)Linking kubernetes resources with underlying cloud infrastructure
CN116471290A (en)Mobile terminal cloud data evidence obtaining method and system based on protocol simulation
US20150032789A1 (en)Dynamic object oriented remote instantiation
AhyadiDevelopment and deployment of crowd monitoring system using Nodejs and Redis on Infrastructure as a Service Model
Zhang et al.Design and implementation of a third-party developers auditing system based on open API

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
TR01Transfer of patent right

Effective date of registration:20240226

Address after:51 Belarusian Road, Singapore

Patentee after:Alibaba Singapore Holdings Ltd.

Country or region after:Singapore

Address before:A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before:ALIBABA GROUP HOLDING Ltd.

Country or region before:Cayman Islands

TR01Transfer of patent right

[8]ページ先頭

©2009-2025 Movatter.jp