CN115017044A - Method and device for testing search function of application and electronic equipment - Google Patents
Method and device for testing search function of application and electronic equipment Download PDFInfo
- Publication number
- CN115017044A CN115017044A CN202210618365.5A CN202210618365A CN115017044A CN 115017044 A CN115017044 A CN 115017044A CN 202210618365 A CN202210618365 A CN 202210618365A CN 115017044 A CN115017044 A CN 115017044A
- Authority
- CN
- China
- Prior art keywords
- environment
- data
- target
- search
- search engine
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域technical field
本申请涉及应用测试技术领域,特别是涉及对应用进行搜索功能测试的方法、装置及电子设备。The present application relates to the technical field of application testing, and in particular, to a method, an apparatus, and an electronic device for performing search function testing on an application.
背景技术Background technique
对于一个软件应用产品(包括应用程序或者Web页面等)而言,从开发完成到正式发布给用户使用之间,还需要进行测试。通常,具体的开发平台中可以为软件应用产品提供测试环境,在这种测试环境下,可以通过构造一些虚拟数据(例如,虚拟的用户账号,虚拟的商品、金额等)等,对应用的功能等进行测试。由于测试环境中不涉及线上的真实数据,因此,具有比较高的安全性,如果发现一些缺陷,则可以及时进行调整并重新测试无误后再进行上线发布。For a software application product (including an application program or a Web page, etc.), it needs to be tested between the completion of development and the official release to users. Usually, a specific development platform can provide a test environment for software application products. In this test environment, by constructing some virtual data (for example, virtual user accounts, virtual goods, amounts, etc.) etc. to test. Since the real data online is not involved in the test environment, it has relatively high security. If some defects are found, they can be adjusted and re-tested in time and then released online.
其中,很多待测试应用都可能会涉及到搜索功能,对于一些集团型的开发方而言,多个不同产品线可能开发出多个不同应用,但却可以依赖相同的底层搜索器,只需要根据具体应用的场景需求对上层的搜索逻辑等进行修改,即可实现适应于具体应用场景需求的搜索功能。例如,某应用是专注于提供旅游出行方面的服务,另一应用是专注于提供跨境商品信息服务,这两个应用中都需要搜索功能,两者可以使用相同的底层搜索器,只是在上层的搜索逻辑方面有所不同。但是,在一款应用完成开发后,可能需要对搜索功能进行测试,测试目标可以包括:按照具体设定的上层搜索逻辑,搜索引擎系统是否可以正常返回所需的搜索结果,或者,搜索引擎系统返回搜索结果之后,是否可以正常走通后续的处理逻辑,例如,搜索到具体的商品后,是否可以正常执行下单操作,等等。Among them, many applications to be tested may involve search functions. For some group-type developers, multiple different product lines may develop multiple different applications, but they can rely on the same underlying searcher. The search logic of the upper layer can be modified according to the scene requirements of the specific application, and then the search function suitable for the specific application scene requirements can be realized. For example, one application focuses on providing travel services, and another application focuses on providing cross-border commodity information services. Both applications require a search function. Both applications can use the same underlying searcher, but only in the upper layer. The search logic differs. However, after an application is developed, it may be necessary to test the search function. The test objectives may include: whether the search engine system can normally return the required search results according to the specific upper-level search logic, or whether the search engine system can normally return the required search results. After returning the search results, whether the subsequent processing logic can be passed normally, for example, whether the ordering operation can be executed normally after searching for a specific product, and so on.
但是,测试环境与生产(线上)环境通常是相互隔离的,并且属于不同的网络,因此,测试环境不能直接使用生产环境中的搜索引擎系统对具体的应用进行测试。而测试环境中通常不具有专门的搜索引擎系统,虽然可以考虑为测试环境专门搭建一套搜索引擎环境,但是成本会很高(为支持单个应用的搜索服务就需要数百台物理机),而线下测试所需数据量与生产环境中的线上数据相比是非常少,因此,机器负荷率将会很低,以至于单独为测试环境搭建搜索引擎环境是不够经济的。However, the test environment and the production (online) environment are usually isolated from each other and belong to different networks. Therefore, the test environment cannot directly use the search engine system in the production environment to test specific applications. The test environment usually does not have a dedicated search engine system. Although it can be considered to build a search engine environment for the test environment, the cost will be very high (hundreds of physical machines are required to support the search service of a single application), and The amount of data required for offline testing is very small compared to online data in the production environment. Therefore, the machine load rate will be so low that it is not economical to build a search engine environment for the testing environment alone.
为了能够在测试环境下对具体应用的搜索功能进行测试,现有技术中的一种方案是,为测试环境提供简化版的搜索引擎系统,具体待测试的应用可以将具体的数据构建到这种搜索引擎中,并将具体的搜索请求发送给这种简化版的搜索引擎进行处理并对搜索结果进行测试。但是,这种简化版的搜索引擎具有独立的数据分析以及数据规则,需要按照器规则对数据进行处理后才能够构建到这种搜索引擎中,代价会比较大。另外,这种简化版的搜索引擎通常进行实现基础的搜索功能,而不支持搜索统计、搜索排序、搜索自定义、推荐等更多功能,因此,可能存在无法达到测试目标等情况。In order to be able to test the search function of a specific application in a test environment, a solution in the prior art is to provide a simplified version of the search engine system for the test environment, and the specific application to be tested can construct specific data into this In the search engine, specific search requests are sent to this simplified version of the search engine for processing and search results are tested. However, this simplified version of the search engine has independent data analysis and data rules, and the data needs to be processed according to the rules before it can be built into such a search engine, and the cost will be relatively high. In addition, this simplified version of the search engine usually implements basic search functions, but does not support search statistics, search sorting, search customization, recommendation and other functions. Therefore, there may be situations in which the test target cannot be achieved.
发明内容SUMMARY OF THE INVENTION
本申请提供了对应用进行搜索功能测试的方法、装置及电子设备,能够以更低的成本在测试环境中实现对应用的搜索功能更完善的测试。The present application provides a method, device and electronic device for testing the search function of an application, which can realize a more complete test of the search function of the application in a test environment at a lower cost.
本申请提供了如下方案:This application provides the following solutions:
一种对应用进行搜索功能测试的方法,包括:A method of testing an application for search functionality, including:
确定需要在测试环境中进行测试的目标应用;Identify the target applications that need to be tested in the test environment;
如果所述目标应用中包括搜索功能,则确定所述测试环境的数据库中与所述目标应用相关的源数据表;If the target application includes a search function, determining a source data table related to the target application in the database of the test environment;
将所述源数据表中的数据同步到线上的生产环境的数据库中,并处理为目标搜索引擎系统可用的目标数据表;Synchronizing the data in the source data table to the database of the online production environment, and processing it into a target data table available to the target search engine system;
在所述测试环境中对所述目标应用的搜索功能进行测试时,通过在所述测试环境中对所述目标搜索引擎系统进行跨域访问的方式发送搜索请求,使得所述搜索引擎系统通过对所述目标数据表进行检索的方式返回搜索结果,以便基于所述搜索结果对所述目标应用中的搜索功能进行测试。When the search function of the target application is tested in the test environment, a search request is sent by performing cross-domain access to the target search engine system in the test environment, so that the search engine system can The retrieval method of the target data table returns a search result, so that a search function in the target application can be tested based on the search result.
一种对应用进行搜索功能测试的装置,包括:A device for testing the search function of an application, comprising:
应用确定单元,用于确定需要在测试环境中进行测试的目标应用;The application determination unit is used to determine the target application that needs to be tested in the test environment;
源数据表确定单元,用于如果所述目标应用中包括搜索功能,则确定所述测试环境的数据库中与所述目标应用相关的源数据表;a source data table determination unit, configured to determine a source data table related to the target application in the database of the test environment if the target application includes a search function;
数据同步单元,用于将所述源数据表中的数据同步到线上的生产环境的数据库中,并处理为目标搜索引擎系统可用的目标数据表;a data synchronization unit for synchronizing the data in the source data table to the database of the online production environment, and processing it into a target data table available to the target search engine system;
跨域请求单元,用于在所述测试环境中对所述目标应用的搜索功能进行测试时,通过在所述测试环境中对所述目标搜索引擎系统进行跨域访问的方式发送搜索请求,使得所述搜索引擎系统通过对所述目标数据表进行检索的方式返回搜索结果,以便基于所述搜索结果对所述目标应用中的搜索功能进行测试。A cross-domain request unit is configured to send a search request by performing cross-domain access to the target search engine system in the test environment when the search function of the target application is tested in the test environment, so that The search engine system returns search results by retrieving the target data table, so as to test the search function in the target application based on the search results.
一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现前述任一项所述的方法的步骤。A computer-readable storage medium having a computer program stored thereon, the program implementing the steps of any of the foregoing methods when executed by a processor.
一种电子设备,包括:An electronic device comprising:
一个或多个处理器;以及one or more processors; and
与所述一个或多个处理器关联的存储器,所述存储器用于存储程序指令,所述程序指令在被所述一个或多个处理器读取执行时,执行前述任一项所述的方法的步骤。memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the method of any preceding item A step of.
根据本申请提供的具体实施例,本申请公开了以下技术效果:According to the specific embodiments provided by the application, the application discloses the following technical effects:
通过本申请实施例,对于需要在测试环境中测试的目标应用,如果需要对搜索逻辑进行测试,则可以将测试环境的数据库中与所述目标应用相关的源数据表中的数据同步到线上的生产环境的数据库中,并处理为所述生产环境中的搜索引擎系统可用的目标数据表,这样,在所述测试环境中对所述目标应用的搜索功能进行测试时,可以通过在所述测试环境中对所述搜索引擎系统进行跨域访问的方式发送搜索请求,使得所述搜索引擎系统通过对所述目标数据表进行检索的方式返回搜索结果,以便基于所述搜索结果对所述目标应用中的搜索功能进行测试。通过这种方式,不需要为测试环境单独部署搜索引擎系统,因此,可以以较低的成本实现在测试环境中对应用的搜索逻辑的测试;另外,由于是使用生产环境中的搜索引擎系统来完成测试过程,而这种搜索引擎具有比较完善的功能,因此,可以对应用中的搜索逻辑实现更完整更准确的测试。同时,由于具体的测试过程是在测试环境中进行,因此,如果在测试过程中发现缺陷,则仍然可以在测试环境中以较低的成本实现对应用相关代码的修改。Through the embodiments of the present application, for a target application that needs to be tested in the test environment, if the search logic needs to be tested, the data in the source data table related to the target application in the database of the test environment can be synchronized to the online In the database of the production environment, and process the target data table available to the search engine system in the production environment, so that when the search function of the target application is tested in the test environment, it can be In the test environment, a search request is sent by means of cross-domain access to the search engine system, so that the search engine system returns search results by retrieving the target data table, so that the target data table is retrieved based on the search results. Test the search function in the app. In this way, there is no need to deploy the search engine system separately for the test environment, therefore, the test of the search logic of the application in the test environment can be realized at a lower cost; in addition, since the search engine system in the production environment is used to The testing process is completed, and this kind of search engine has relatively complete functions. Therefore, a more complete and accurate test can be implemented for the search logic in the application. At the same time, since the specific testing process is carried out in the testing environment, if a defect is found during the testing process, the modification to the application-related code can still be implemented in the testing environment at a lower cost.
其中,为了将测试环境的数据库中与所述目标应用相关的源数据表中的数据同步到线上的生产环境的数据库中,可以通过全量+增量的方式来实现。对于测试环境数据库中源数据表中的历史存量数据,可以通过离线同步工具,同步到生产环境的开放数据处理服务系统中;对于增量数据,可以通过数据变更监测工具进行监测,并通过消息的方式发送到生产环境中的消息中间件系统。之后,可以由搜索引擎系统对应的离线数据加工系统对同步过来的全量数据以及增量数据进行融合,并处理为搜索引擎可用的目标数据表。Wherein, in order to synchronize the data in the source data table related to the target application in the database of the test environment to the database of the online production environment, it can be implemented in the manner of full amount + increment. For the historical inventory data in the source data table in the test environment database, it can be synchronized to the open data processing service system of the production environment through the offline synchronization tool; for incremental data, it can be monitored through the data change monitoring tool, and through the message way to send to the message middleware system in the production environment. After that, the synchronized full data and incremental data can be fused by the offline data processing system corresponding to the search engine system, and processed into a target data table available to the search engine.
为了避免对生产系统的搜索引擎系统造成干扰,可以通过预发布系统中的搜索引擎系统来实现,使得测试环境中的应用发起的搜索请求,可以由预发布环境对应的独立的服务器集群做出响应。In order to avoid interference with the search engine system of the production system, it can be implemented by the search engine system in the pre-release system, so that the search request initiated by the application in the test environment can be responded to by the independent server cluster corresponding to the pre-release environment .
当然,实施本申请的任一产品并不一定需要同时达到以上所述的所有优点。Of course, implementing any product of the present application does not necessarily need to achieve all of the advantages described above at the same time.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the accompanying drawings required in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the present application. In the embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1是本申请实施例提供的系统架构的示意图;1 is a schematic diagram of a system architecture provided by an embodiment of the present application;
图2是本申请实施例提供的方法的流程图;2 is a flowchart of a method provided by an embodiment of the present application;
图3是本申请实施例提供的交互流程的示意图;3 is a schematic diagram of an interaction process provided by an embodiment of the present application;
图4是本申请实施例提供的装置的示意图;4 is a schematic diagram of a device provided by an embodiment of the present application;
图5是本申请实施例提供的电子设备的示意图。FIG. 5 is a schematic diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the protection scope of this application.
为了便于理解本申请实施例提供的技术方案,下面首先对一些基础概念进行简单介绍。To facilitate understanding of the technical solutions provided by the embodiments of the present application, some basic concepts are briefly introduced below.
在一款应用从开发到用户使用,具体会涉及到多个环境,例如,可以包括开发环境、测试环境、预发环境、生产环境。其中,开发环境就是在对应用进行开发时使用的环境,每位开发人员可以在自己的代码分支上工作,提测前或者开发到一定程度,各位开发人员可以合并代码,进行联调等。In an application from development to user use, it will involve multiple environments, for example, it may include a development environment, a test environment, a pre-release environment, and a production environment. Among them, the development environment is the environment used when developing the application. Each developer can work on his own code branch. Before testing or developing to a certain extent, each developer can merge the code, conduct joint debugging, etc.
测试环境是用于对应用进行测试的环境,可以由测试人员进行部署,在此环境中对应用进行测试,缺陷修复,发版更新,等等。测试环境属于线下运行的环境,可以构造一些虚拟数据以用于测试应用中的各项功能是否可以正常使用,是否存在某些缺陷等等。A test environment is an environment used to test an application and can be deployed by testers, where the application is tested, bug fixes, release updates, etc. The test environment is an offline running environment, and some virtual data can be constructed to test whether various functions in the application can be used normally, whether there are certain defects, and so on.
预发布环境是从测试环境到生产环境的过渡,由于测试环境可能会受到一些限制,一些流程或者数据可能没有测试到,因此,可以在预发布环境中进行验证,从而保证产品上线质量。预发布环境一般会连接生产环境的数据库,使得预发布环境与线上生产环境可以共用数据库,即预发布环境使用的是线上生产环境的数据库。虽然也是用于测试,但是预发布环境与测试环境最大的区别在于,预发布环境与生产系统的同步性比较高,有些测试,比如需要大数据量的,可以通过预发布环境测试程序性能,比在测试环境(一般数据较少)下更准确。需要说明的是,虽然预发布环境的配置等基本与线上的生产环境一致,但是预发布环境的web服务器不在线上生产系统的集成服务器范围之内,为单独的一台或多台机器组成的集群。因此,预发布环境的访问域名也会与线上生产环境的不同,线上生产环境可以提供给外部用户访问,预发布环境只能在内部访问。The pre-release environment is the transition from the test environment to the production environment. Since the test environment may be limited, some processes or data may not be tested. Therefore, verification can be performed in the pre-release environment to ensure the product launch quality. The pre-release environment is generally connected to the database of the production environment, so that the pre-release environment and the online production environment can share the database, that is, the pre-release environment uses the database of the online production environment. Although it is also used for testing, the biggest difference between the pre-release environment and the test environment is that the synchronization between the pre-release environment and the production system is relatively high. Some tests, such as those that require a large amount of data, can test the program performance through the pre-release environment. More accurate in test environments (generally less data). It should be noted that although the configuration of the pre-release environment is basically the same as that of the online production environment, the web server of the pre-release environment is not within the scope of the integrated server of the online production system, but consists of one or more separate machines. the cluster. Therefore, the access domain name of the pre-release environment will also be different from that of the online production environment. The online production environment can be accessed by external users, and the pre-release environment can only be accessed internally.
生产环境,也即线上环境,是正式提供给用户使用的环境。The production environment, that is, the online environment, is the environment that is officially provided to users.
其中,在预发环境下可以正常使用与生产环境中相同的搜索引擎系统,并且可以连接到生产环境的数据库,因此,在预发环境中可以实现对应用的搜索功能的测试。Among them, the same search engine system as that in the production environment can be used normally in the pre-release environment, and can be connected to the database of the production environment. Therefore, the search function of the application can be tested in the pre-release environment.
但是,在本申请实施例中,目的是满足在测试环境中对应用的搜索功能进行测试的需求,为此,本申请实施例提供了新的解决方案。在该方案中,可以由具体待测试应用的开发或者测试人员等用户,将测试环境数据库中与该待测试应用相关的数据表中的数据,同步到线上生产环境的数据库中,并且可以处理为搜索引擎系统可用的数据表,该搜索引擎可以与线上生产环境中实际使用的搜索引擎系统相同。也就是说,可以使得生产环境中的搜索引擎系统可以搜索到来源于测试环境数据库中的数据。从而可以在测试环境中,利用与生产环境中相同的搜索引擎系统,实现对待测试应用中搜索相关逻辑的测试。例如,具体在进行测试时,可以通过从测试环境中对搜索引擎系统进行跨域访问的方式,向搜索引擎系统发起搜索请求,然后,根据搜索引擎返回的搜索结果,对具体应用中的搜索逻辑进行测试。其中,在优选的实施方式下,为了避免对线上的生产环境造成影响,可以从测试环境中对预发布环境中的搜索引擎系统进行跨域访问的方式,使得通过预发布环境对应的独立的服务器集群来响应这种搜索请求。However, in the embodiment of the present application, the purpose is to meet the requirement of testing the search function of the application in the test environment, and for this purpose, the embodiment of the present application provides a new solution. In this solution, users such as developers or testers of the specific application to be tested can synchronize the data in the data table related to the application to be tested in the test environment database to the database of the online production environment, and can process The data sheet available for the search engine system, which may be the same as the search engine system actually used in the online production environment. That is to say, the search engine system in the production environment can search for data originating from the test environment database. Therefore, in the test environment, the same search engine system as in the production environment can be used to implement the test of the search-related logic in the application to be tested. For example, when testing, a search request can be initiated to the search engine system by means of cross-domain access to the search engine system from the test environment, and then, according to the search results returned by the search engine, the search logic in the specific application can be carry out testing. Among them, in a preferred embodiment, in order to avoid the impact on the online production environment, the search engine system in the pre-release environment can be accessed from the test environment across domains, so that through the pre-release environment corresponding to the independent A cluster of servers to respond to such search requests.
需要说明的是,以上方案的实现基础是,应用系统与搜索引擎系统的研发过程相互独立,应用验证只关注应用的代码变更,搜索引擎系统只是一个环境基建存在,应用方对它的要求是搜索引擎系统的数据能匹配上应用所处的测试环境/阶段即可(测试环境希望搜索到日常的数据,线上搜索到线上的数据)。因此,在测试过程中,涉及到的应用代码变更需要部署在线下环境,这样,多变更并行、集成等环境使用成本是最低的。而在本申请实施例中提供的上述方案中,可以在测试环境中实现对具体应用的搜索逻辑的测试,这样,测试应用数据的数据产生仍然是在线下环境,搜索引擎系统则可以使用的是生产环境或者预发布环境中的搜索引擎系统,应用数据从线下测试环境的数据库中往生产环境或预发布环境中的搜索引擎进行同步。这样,由于不需要为测试环境单独部署搜索引擎系统,因此,成本会比较低;另外,生产环境中的搜索引擎系统具有比较完善的功能,因此,可以对应用中的搜索逻辑实现更完整更准确的测试。而如果在测试过程中发现缺陷,则仍然可以在测试环境中以较低的成本实现对应用相关代码的修改。It should be noted that the realization of the above solutions is based on the independent research and development process of the application system and the search engine system. Application verification only focuses on the code changes of the application. The search engine system is only an environmental infrastructure, and the application side requires it to search. The data of the engine system can match the test environment/stage in which the application is located (the test environment hopes to search for daily data, and online search for online data). Therefore, in the testing process, the application code changes involved need to be deployed in the offline environment, so that the environment usage cost such as multi-change parallelism and integration is the lowest. In the above solution provided in the embodiment of the present application, the test of the search logic of a specific application can be implemented in the test environment. In this way, the data generation of the test application data is still in the offline environment, and the search engine system can use the For the search engine system in the production environment or the pre-release environment, the application data is synchronized from the database in the offline test environment to the search engine in the production environment or the pre-release environment. In this way, since there is no need to deploy the search engine system separately for the test environment, the cost will be relatively low; in addition, the search engine system in the production environment has relatively complete functions, so the search logic in the application can be implemented more complete and accurate 's test. And if defects are found during testing, modifications to application-related code can still be implemented in the testing environment at a lower cost.
其中,具体实现时,关于具体如何将测试环境数据库中的数据部署到线上生产环境的数据库中,是需要重点考虑的问题。关于该问题,在本申请的可选实施方式中,可以采用全量+增量的数据同步方式。首先,对于测试环境的数据库中的历史存量数据,如图1所示,可以通过离线数据同步工具,全量的同步到生产环境/预发布环境的开放数据处理服务系统中,该开放数据处理服务系统原本的功能是对生产系统中实时产生的数据进行存储,以用于后续的分析计算、信息推荐等应用。在本申请实施例中,可以将测试环境的数据库中与待测试应用相关的数据表中的数据,同步到这种开放数据处理服务系统中,而该系统是可以作为搜索引擎的数据源的,因此,使得测试环境数据库中的数据,成为生产系统中搜索引擎的数据源。当然,在具体实现时,来自于测试环境数据库中的数据可能并不能直接被搜索引擎系统使用,为此,还可以将其处理为搜索引擎系统可用的数据表。具体的,由于搜索引擎系统通常还会配备有离线数据加工系统,用于将各种来源数据进行转换等加工处理后送入搜索引擎系统中使用,因此,本申请实施例中,在将测试环境的相关数据表中的数据全量同步到开放数据处理服务系统后,还可以通过搜索引擎系统对应的离线数据加工系统,处理为搜索引擎系统可用的目标数据表。Among them, in the specific implementation, how to deploy the data in the test environment database to the database of the online production environment is a key issue that needs to be considered. Regarding this issue, in an optional implementation manner of the present application, a data synchronization method of full amount + increment may be adopted. First, for the historical inventory data in the database of the test environment, as shown in Figure 1, it can be fully synchronized to the open data processing service system of the production environment/pre-release environment through the offline data synchronization tool. The open data processing service system The original function is to store the real-time data generated in the production system for subsequent analysis and calculation, information recommendation and other applications. In the embodiment of the present application, the data in the data table related to the application to be tested in the database of the test environment can be synchronized to this open data processing service system, and the system can be used as the data source of the search engine, Therefore, the data in the test environment database becomes the data source of the search engine in the production system. Of course, in specific implementation, the data from the test environment database may not be directly used by the search engine system, and for this reason, it can also be processed into a data table available to the search engine system. Specifically, because the search engine system is usually also equipped with an offline data processing system, which is used to convert various source data and send it to the search engine system for use. Therefore, in the embodiment of the present application, the test environment is After the data in the relevant data table of the search engine system is fully synchronized to the open data processing service system, it can also be processed into the target data table available to the search engine system through the offline data processing system corresponding to the search engine system.
另外,测试环境的数据库中除了包括一些历史存量数据之外,还会存在一些增量数据,包括增加、删除、修改等操作对应的数据。对于这种增量数据,在本申请实施例中,如图1所示,可以通过测试环境中的变更监测系统对测试环境中相关数据表中的数据变更消息进行监测;然后,可以将监测到的数据变更消息转换为生产环境中的消息中间件系统中定义的消息格式,并通过调用消息中间件系统的接口,将数据变更消息发送给生产环境中的消息中间件系统,以此将测试环境中相关数据表中的增量数据同步到生产环境的数据库中。具体的,对于这种增量数据也可以通过搜索引擎系统对应的离线数据加工系统,与全量数据进行融合后,处理为搜索引擎系统可用的数据表。其中,为了便于进行该数据处理,可以通过搜索引擎系统对应的离线数据加工系统,对同步到生产环境中的全量以及增量数据进行融合,并处理为搜索引擎系统可用的目标数据表,再提供给搜索引擎系统使用。In addition, in addition to some historical inventory data, the database of the test environment also contains some incremental data, including data corresponding to operations such as addition, deletion, and modification. For such incremental data, in the embodiment of the present application, as shown in FIG. 1 , the data change message in the relevant data table in the test environment can be monitored by the change monitoring system in the test environment; The data change message is converted into the message format defined in the message middleware system in the production environment, and the data change message is sent to the message middleware system in the production environment by calling the interface of the message middleware system, so that the test environment The incremental data in the relevant data tables in the database is synchronized to the database in the production environment. Specifically, such incremental data can also be processed into a data table available to the search engine system after being integrated with the full amount of data through an offline data processing system corresponding to the search engine system. Among them, in order to facilitate the data processing, the offline data processing system corresponding to the search engine system can be used to fuse the full and incremental data synchronized to the production environment, and process it into a target data table available to the search engine system, and then provide Used by search engine systems.
在通过上述方式将测试环境数据库中的数据同步到生产环境后,在测试环境中对目标应用进行测试的过程中,则可以从测试环境向具体生产环境或预发布环境的搜索引擎系统发起搜索请求,并获得搜索引擎系统返回的搜索结果,以完成对目标应用中的相关搜索逻辑的测试。After synchronizing the data in the test environment database to the production environment in the above manner, in the process of testing the target application in the test environment, a search request can be initiated from the test environment to the search engine system of the specific production environment or pre-release environment , and obtain the search results returned by the search engine system to complete the test of the relevant search logic in the target application.
其中,由于预发布环境中可以使用与生产环境中相同的搜索引擎系统,并且可以连接到生产环境的数据库,因此,在优选的方式下,为了避免对实际线上的生产环境中的搜索引擎系统造成干扰,可以通过预发布环境中的搜索引擎系统来实现上述测试过程。也即,具体的搜索请求可以通过跨域访问的方式,发送给预发布环境中的搜索引擎系统,从而可以由预发布环境对应的独立的服务器集群提供服务,从而不会影响生产环境中的搜索引擎系统。Among them, since the pre-release environment can use the same search engine system as in the production environment, and can be connected to the database in the production environment, in a preferred manner, in order to avoid the search engine system in the actual online production environment Cause interference, the above test process can be implemented through a search engine system in a pre-release environment. That is, specific search requests can be sent to the search engine system in the pre-release environment by means of cross-domain access, so that the service can be provided by an independent server cluster corresponding to the pre-release environment, so that the search in the production environment will not be affected. engine system.
其中,具体实现时,为了便于通过本申请实施例提供的方案实现对应用中搜索逻辑的测试,还可以将具体的实现方案进行产品化,例如,可以是面向测试人员等用户的服务系统。通过该产品化的服务系统,测试人员等用户可以在该系统中进行待测试应用的指定,并从测试环境的数据库中的各个数据表中,选定或者指定与该待测试应用相关的数据表。之后,该服务系统可以将这种数据表中的数据同步到线上的生产环境的数据库中,并处理为所述生产环境中的搜索引擎系统可用的目标数据表。也就是说,该产品化的服务系统主要可以提供将测试环境数据库中与具体应用相关的数据表中的数据,同步到生产环境的数据库中的相关服务。Wherein, in the specific implementation, in order to facilitate the testing of the search logic in the application through the solutions provided in the embodiments of the present application, the specific implementation solutions can also be commercialized, for example, a service system for users such as testers. Through the productized service system, users such as testers can specify the application to be tested in the system, and select or specify the data table related to the application to be tested from each data table in the database of the test environment. . Afterwards, the service system can synchronize the data in this data table to the database of the online production environment, and process the target data table available to the search engine system in the production environment. That is to say, the productized service system can mainly provide related services for synchronizing the data in the data table related to the specific application in the test environment database to the database in the production environment.
下面对本申请实施例提供的具体实现方案进行详细介绍。The specific implementation solutions provided by the embodiments of the present application are described in detail below.
具体的,本申请实施例首先从上述产品化的服务系统的角度,提供了一种对应用进行搜索功能测试的方法,参见图2,该方法具体可以包括:Specifically, from the perspective of the above-mentioned productized service system, the embodiment of the present application provides a method for testing the search function of an application. Referring to FIG. 2 , the method may specifically include:
S201:确定需要在测试环境中进行测试的目标应用。S201: Determine a target application that needs to be tested in a test environment.
具体的,可以通过在服务系统中输入待测试应用的标识等方式,使得服务系统获知需要在测试环境中进行测试的目标应用,后续在将这种测试环境数据库中与该应用相关的数据表中的数据同步到生产环境时,也可以提供关于目标应用的标识,这样,后续在这种应用向搜索引擎发起搜索请求时,可以对生产环境中这种与该应用相关的数据进行搜索。Specifically, the service system can be informed of the target application that needs to be tested in the test environment by inputting the identifier of the application to be tested in the service system, and subsequently put the application-related data table in the test environment database in the data table. When the data of the target application is synchronized to the production environment, the identifier of the target application can also be provided, so that when the application initiates a search request to the search engine, the application-related data in the production environment can be searched.
S202:如果所述目标应用中包括搜索功能,则确定所述测试环境的数据库中与所述目标应用相关的源数据表。S202: If the target application includes a search function, determine a source data table related to the target application in the database of the test environment.
在确定出待测试应用后,由于该应用中需要提供搜索功能,因此,为了能够在测试环境中实现对搜索逻辑的测试,可以首先确定出测试环境的数据库中与所述目标应用相关的源数据表。具体的,可以由测试人员用户在前述服务系统中输入这种源数据表的名称、所在的数据库等方式,确定上述测试环境的数据库中与所述目标应用相关的源数据表。After the application to be tested is determined, since the application needs to provide a search function, in order to be able to test the search logic in the test environment, the source data related to the target application in the database of the test environment can be determined first surface. Specifically, the source data table related to the target application in the database of the test environment can be determined by the tester user entering the name of the source data table and the database where it is located in the aforementioned service system.
S203:将所述源数据表中的数据同步到线上的生产环境的数据库中,并处理为目标搜索引擎系统可用的目标数据表。S203: Synchronize the data in the source data table to the database of the online production environment, and process it into a target data table available to the target search engine system.
在确定出测试环境的数据库中与所述目标应用相关的源数据表后,可以将源数据表中的数据同步到线上的生产环境的数据库中,并处理为所述生产环境中的搜索引擎系统可用的目标数据表。After the source data table related to the target application in the database of the test environment is determined, the data in the source data table can be synchronized to the database of the online production environment, and processed as a search engine in the production environment The target data table available to the system.
具体的,可以通过全量+增量的方式实现数据同步过程。具体的,对于全量数据,也即,测试环境的数据库中的历史存量数据,对于这种数据,可以利用离线数据同步工具,将源数据表中的历史存量数据全量同步到生产环境中的开放数据处理服务系统。其中,这种开放数据处理服务系统的主要功能是,用于对生产环境中实时产生的数据进行存储及计算,以提供数据指标分析、信息推荐等相关服务。另外,这种存储的数据也可以作为搜索引擎系统的数据源,只是需要进行一些加工处理之后,才可以成为搜索引擎系统可用的状态。为此,现有技术中,通常还存在为搜索引擎系统配备的离线数据加工系统,以实现对数据的离线加工,并提供给搜索引擎系统使用,以此提升搜索引擎的效率。因此,在本申请实施例中,对于测试环境数据库中相关数据表中的历史存量数据,可以全量更新到这种开放数据处理服务系统中,然后可以通过离线数据加工系统对同步过来的数据进行加工处理,从而处理为搜索引擎系统可用的目标数据表。Specifically, the data synchronization process may be implemented in a full amount + incremental manner. Specifically, for full data, that is, historical inventory data in the database of the test environment, for this kind of data, offline data synchronization tools can be used to fully synchronize the historical inventory data in the source data table to the open data in the production environment. Process service system. Among them, the main function of this open data processing service system is to store and calculate the data generated in real time in the production environment, so as to provide related services such as data index analysis and information recommendation. In addition, the stored data can also be used as the data source of the search engine system, and only after some processing is required, it can become available to the search engine system. For this reason, in the prior art, there is usually an offline data processing system equipped for a search engine system to realize offline processing of data and provide it for use by the search engine system, thereby improving the efficiency of the search engine. Therefore, in the embodiment of the present application, the historical stock data in the relevant data table in the test environment database can be fully updated to this open data processing service system, and then the synchronized data can be processed through the offline data processing system Processing, thereby processing the target data table available to the search engine system.
需要说明的是,在具体实现时,还可以为搜索引擎系统对应的离线数据加工系统申请获得使用所述开放数据处理服务系统中的数据的权限,这样,使得离线数据加工系统可以对同步到开放数据处理服务系统中的数据进行加工处理,以生成搜索引擎系统可用的目标数据表。It should be noted that, in the specific implementation, the offline data processing system corresponding to the search engine system can also apply for the permission to use the data in the open data processing service system, so that the offline data processing system can be synchronized to the open data processing system. The data in the data processing service system is processed to generate a target data table usable by the search engine system.
对于测试环境数据库中与当前目标用户相关的数据表中的增量数据,则可以通过测试环境中的消息监测系统对所述源数据表中的数据变更消息进行监测。之后,可以将监测到的数据变更消息转换为所述生产环境中的消息中间件系统中定义的消息格式,并通过调用所述消息中间件系统的接口,将所述数据变更消息发送给所述生产环境中的消息中间件系统,以便将所述源数据表中的增量数据同步到所述生产环境的数据库中。For the incremental data in the data table related to the current target user in the test environment database, the data change message in the source data table can be monitored by the message monitoring system in the test environment. Afterwards, the monitored data change message can be converted into a message format defined in the message middleware system in the production environment, and the data change message is sent to the A message middleware system in the production environment, so as to synchronize the incremental data in the source data table to the database in the production environment.
具体实现时,为了达到上述目的,还可以通过在所述测试环境中的消息监测系统中创建自主消费模式的服务,并接入需要监测的所述源数据表,以便所述消息监测系统对所述源数据表中的数据变更事件进行监测。具体的,具体的消息中间件系统可以是预发环境的消息中间件系统,此时,还可以预先申请预发环境的账号,取得授权令牌(Token)和密钥。另外,可以下载上述消息监测系统的插件,自定义消费服务逻辑,然后,把数据变更的消息转换成消息中间件系统的消息格式,并把消息发送到消息中间件系统的预发环境。再者,还可以向消息中间件系统申请获得授权信息,并在所述消息中间件系统中申请消息主题(Topic),以用于接收来自测试环境中的消息监测系统发送的消息。During specific implementation, in order to achieve the above-mentioned purpose, a service in an autonomous consumption mode can also be created in the message monitoring system in the test environment, and the source data table to be monitored can be accessed, so that the message monitoring system can monitor all Data change events in the aforementioned source data tables are monitored. Specifically, the specific message middleware system may be the message middleware system of the pre-release environment. In this case, an account of the pre-release environment may also be pre-applied for to obtain an authorization token (Token) and a key. In addition, you can download the plug-in of the above message monitoring system, customize the consumption service logic, and then convert the message of data change into the message format of the message middleware system, and send the message to the pre-release environment of the message middleware system. Furthermore, it is also possible to apply to the message middleware system for obtaining authorization information, and apply for a message topic (Topic) in the message middleware system, so as to receive messages sent from the message monitoring system in the test environment.
在完成全量以及增量的数据同步后,可以通过所述搜索引擎系统对应的离线数据加工系统,将所述历史存量数据以及所述增量数据进行融合,并加工处理后生成符合所述搜索引擎系统格式要求的目标数据表。After the full and incremental data synchronization is completed, the historical inventory data and the incremental data can be fused through the offline data processing system corresponding to the search engine system, and processed to generate data that conforms to the search engine. The target data table required by the system format.
其中,离线数据加工系统是为搜索引擎系统提供离线的数据加工处理服务的系统,可以对接多种数据源,因此,在本申请实施例中,就可以通过该离线数据加工系统,对从测试环境数据库同步到开放数据处理服务系统以及消息中间件系统的数据进行融合,并处理为搜索引擎系统可用的目标数据表。例如,具体可以去除一些无用字段,将不同源数据表中的相关字段关联起来,生成一张目标数据表,等等。Among them, the offline data processing system is a system that provides offline data processing and processing services for the search engine system, and can be connected to a variety of data sources. Therefore, in the embodiment of the present application, the offline data processing system can be used to process data from the test environment. The database is synchronized to the open data processing service system and the data of the message middleware system for fusion, and processed into the target data table available to the search engine system. For example, some useless fields can be removed, related fields in different source data tables can be associated, a target data table can be generated, and so on.
具体实现时,由于上述离线数据加工系统也可以用于对生产环境中实际产生的数据进行处理,本申请实施例是使用的线上环境(生产/预发布)中的资源进行数据处理,因此,需要考虑数据隔离的问题。当然,由于离线数据加工系统对针对不同的加工处理任务分别进行数据的隔离存储,因此,天然可以具有数据隔离的效果。但是,为了避免由于误操作等原因导致的故障,还可以在所述搜索引擎系统对应的离线数据加工系统中申请创建独立的项目,以便为来自所述测试环境的数据处理分配独立的资源,从而进行与所述生产环境中实际产生的数据之间的隔离。在离线数据加工系统通过云服务形式存在的情况下,可以申请独立的云账号进行测试资源的申请、操作。具体的,可以申请独立的云账号、独立的搜索引擎资源和离线数据加工项目资源,等等。During specific implementation, since the above-mentioned offline data processing system can also be used to process data actually generated in the production environment, the embodiment of the present application uses the resources in the online environment (production/pre-release) to perform data processing. Therefore, The issue of data isolation needs to be considered. Of course, since the offline data processing system separates and stores data for different processing tasks, it can naturally have the effect of data isolation. However, in order to avoid failures due to misoperation and other reasons, it is also possible to apply for the creation of an independent project in the offline data processing system corresponding to the search engine system, so as to allocate independent resources for data processing from the test environment, thereby Isolation from data actually produced in the production environment. When the offline data processing system exists in the form of cloud services, you can apply for an independent cloud account to apply and operate test resources. Specifically, you can apply for an independent cloud account, independent search engine resources, offline data processing project resources, and so on.
S204:在所述测试环境中对所述目标应用的搜索功能进行测试时,通过在所述测试环境中对所述目标搜索引擎系统进行跨域访问的方式发送搜索请求,使得所述搜索引擎系统通过对所述目标数据表进行检索的方式返回搜索结果,以便基于所述搜索结果对所述目标应用中的搜索功能进行测试。S204: When testing the search function of the target application in the test environment, send a search request by performing cross-domain access to the target search engine system in the test environment, so that the search engine system The search results are returned by retrieving the target data table, so as to test the search function in the target application based on the search results.
在将测试环境数据库中与当前应用相关的数据表中的数据同步到生产环境中的数据库之后,可以在测试环境中,使用生产环境中的搜索引擎系统对应用中的搜索逻辑进行测试。其中,由于测试环境与生产环境属于不同的网络,因此,具体的应用可以通过从测试环境中对所述搜索引擎系统进行跨域访问的方式发送搜索请求,搜索引擎系统在接收到搜索请求后,发现是来自于测试环境中的某个应用,则可以从生产环境数据库中与该应用的测试相关的目标数据表中进行检索,并返回对应的搜索结果。测试环境中收到搜索结果之后,可以基于搜索结果对应用中的搜索逻辑进行测试,包括判断搜索结果是否符合预期,在搜索结果中是否可以继续触发后续的加购、下单等处理逻辑,等等。After synchronizing the data in the data table related to the current application in the test environment database to the database in the production environment, the search logic in the application can be tested in the test environment by using the search engine system in the production environment. Among them, since the test environment and the production environment belong to different networks, a specific application can send a search request by performing cross-domain access to the search engine system from the test environment, and after the search engine system receives the search request, If it is found that it comes from an application in the test environment, it can be retrieved from the target data table related to the test of the application in the production environment database, and the corresponding search results are returned. After receiving the search results in the test environment, you can test the search logic in the application based on the search results, including judging whether the search results meet expectations, whether the search results can continue to trigger subsequent processing logic such as add-on purchases and ordering, etc. Wait.
其中,如前文所述,在存在预发布环境的情况下,可以通过在所述测试环境中对所述预发布环境中部署的搜索引擎系统进行跨域访问的方式,发送搜索请求。这样,由于预发布环境通常部署在独立的服务器集群中,因此,可以通过这种独立的服务器集群来响应来自于测试环境的搜索请求,从而避免对生产环境中的搜索引擎系统造成干扰。Wherein, as mentioned above, when there is a pre-release environment, the search request may be sent by means of cross-domain access to the search engine system deployed in the pre-release environment in the test environment. In this way, since the pre-release environment is usually deployed in an independent server cluster, the search request from the test environment can be responded to through such an independent server cluster, thereby avoiding interference to the search engine system in the production environment.
综上,在本申请实施例中提供的上述方案中,可以在线下的测试环境中实现对具体应用的搜索逻辑的测试,这样,如图3所示,测试应用数据的数据产生仍然是在线下环境,搜索引擎系统则可以使用的是生产环境或者预发布环境中的搜索引擎系统,应用数据从线下测试环境的数据库中往生产环境或预发布环境中的搜索引擎进行同步,从而可以通过生产环境或预发布环境中的搜索引擎,满足在测试环境中对应用的搜索逻辑进行测试的需求。To sum up, in the above solutions provided in the embodiments of the present application, the test of the search logic of a specific application can be implemented in an offline test environment. In this way, as shown in FIG. 3 , the data generation of the test application data is still offline. environment, the search engine system can use the search engine system in the production environment or the pre-release environment, and the application data is synchronized from the database in the offline test environment to the search engine in the production environment or the pre-release environment, so that the application data can be synchronized through the production environment or the search engine in the pre-release environment. A search engine in the environment or pre-release environment, to meet the needs of testing the search logic of the application in the test environment.
需要说明的是,本申请实施例提供的方案对上层应用可以是无感知的,对测试人员等用户来说,应用的功能和操作上无改变。系统的接入过程可以在经过前述数据同步、安全隔离等处理后完成。在接入时还可以检查数据源配置,如果是某搜索引擎(实际的搜索引擎可以有多种)项目,把数据源变更为该搜索引擎所需格式的目标数据表即可。另外,如果使用预发布环境下的搜索引擎系统,则接入的应用中还可以更改搜索域名。这是因为预发布环境与生产环境的域名是不同的,而本申请实施例中,需要从预测环境调用预发环境的搜索引擎系统,因此,可以改为预发环境对应的域名,相应的,搜索的域名需要具备跨域的能力。关于跨域能力的实现,不属于本申请实施例的重点内容,这里不再详述。It should be noted that the solutions provided by the embodiments of the present application may be imperceptible to upper-layer applications, and for users such as testers, the functions and operations of the applications are unchanged. The access process of the system can be completed after the aforementioned data synchronization, security isolation and other processes. You can also check the data source configuration when accessing, if it is a certain search engine (actual search engines can have many kinds) projects, just change the data source to the target data table in the format required by the search engine. In addition, if the search engine system in the pre-release environment is used, the search domain name can also be changed in the connected application. This is because the domain names of the pre-release environment and the production environment are different, and in this embodiment of the present application, it is necessary to call the search engine system of the pre-release environment from the prediction environment. Therefore, the domain name corresponding to the pre-release environment can be changed. Correspondingly, The searched domain name needs to have cross-domain capability. The realization of the cross-domain capability does not belong to the key content of the embodiments of the present application, and will not be described in detail here.
总之,通过本申请实施例,对于需要在测试环境中测试的目标应用,如果需要对搜索逻辑进行测试,则可以将测试环境的数据库中与所述目标应用相关的源数据表中的数据同步到线上的生产环境的数据库中,并处理为所述生产环境中的搜索引擎系统可用的目标数据表,这样,在所述测试环境中对所述目标应用的搜索功能进行测试时,可以通过在所述测试环境中对所述搜索引擎系统进行跨域访问的方式发送搜索请求,使得所述搜索引擎系统通过对所述目标数据表进行检索的方式返回搜索结果,以便基于所述搜索结果对所述目标应用中的搜索功能进行测试。通过这种方式,不需要为测试环境单独部署搜索引擎系统,因此,可以以较低的成本实现在测试环境中对应用的搜索逻辑的测试;另外,由于是使用生产环境中的搜索引擎系统来完成测试过程,而这种搜索引擎具有比较完善的功能,因此,可以对应用中的搜索逻辑实现更完整更准确的测试。同时,由于具体的测试过程是在测试环境中进行,因此,如果在测试过程中发现缺陷,则仍然可以在测试环境中以较低的成本实现对应用相关代码的修改。In conclusion, through the embodiments of the present application, for a target application that needs to be tested in the test environment, if the search logic needs to be tested, the data in the source data table related to the target application in the database of the test environment can be synchronized to In the database of the online production environment, and process the target data table available to the search engine system in the production environment, so that when the search function of the target application is tested in the test environment, it can be In the test environment, a search request is sent by means of cross-domain access to the search engine system, so that the search engine system returns search results by retrieving the target data table, so that the search engine system can perform a search based on the search results. Test the search function in the target application described above. In this way, there is no need to deploy the search engine system separately for the test environment, therefore, the test of the search logic of the application in the test environment can be realized at a lower cost; in addition, since the search engine system in the production environment is used to The testing process is completed, and this kind of search engine has relatively complete functions. Therefore, a more complete and accurate test can be implemented for the search logic in the application. At the same time, since the specific testing process is carried out in the testing environment, if a defect is found during the testing process, the modification to the application-related code can still be implemented in the testing environment at a lower cost.
其中,为了将测试环境的数据库中与所述目标应用相关的源数据表中的数据同步到线上的生产环境的数据库中,可以通过全量+增量的方式来实现。对于测试环境数据库中源数据表中的历史存量数据,可以通过离线同步工具,同步到生产环境的开放数据处理服务系统中;对于增量数据,可以通过数据变更监测工具进行监测,并通过消息的方式发送到生产环境中的消息中间件系统。之后,可以由搜索引擎系统对应的离线数据加工系统对同步过来的全量数据以及增量数据进行融合,并处理为搜索引擎可用的目标数据表。Wherein, in order to synchronize the data in the source data table related to the target application in the database of the test environment to the database of the online production environment, it can be implemented in the manner of full amount + increment. For the historical inventory data in the source data table in the test environment database, it can be synchronized to the open data processing service system of the production environment through the offline synchronization tool; for incremental data, it can be monitored through the data change monitoring tool, and through the message way to send to the message middleware system in the production environment. After that, the synchronized full data and incremental data can be fused by the offline data processing system corresponding to the search engine system, and processed into a target data table available to the search engine.
为了避免对生产系统的搜索引擎系统造成干扰,可以通过预发布系统中的搜索引擎系统来实现,使得测试环境中的应用发起的搜索请求,可以由预发布环境对应的独立的服务器集群做出响应。In order to avoid interference with the search engine system of the production system, it can be implemented by the search engine system in the pre-release system, so that the search request initiated by the application in the test environment can be responded to by the independent server cluster corresponding to the pre-release environment .
需要说明的是,本申请实施例中可能会涉及到对用户数据的使用,在实际应用中,可以在符合所在国的适用法律法规要求的情况下(例如,用户明确同意,对用户切实通知,等),在适用法律法规允许的范围内在本文描述的方案中使用用户特定的个人数据。It should be noted that the embodiments of the present application may involve the use of user data. In practical applications, the user's data may be used in accordance with the applicable laws and regulations of the country where the user is located (for example, the user expressly agrees, and the user is effectively notified. etc.), use user-specific personal data in the scenarios described herein to the extent permitted by applicable laws and regulations.
与前述方法实施例相对应,本申请实施例还提供了一种对应用进行搜索功能测试的装置,参见图4,该方法可以包括:Corresponding to the foregoing method embodiments, an embodiment of the present application further provides an apparatus for testing an application for a search function. Referring to FIG. 4 , the method may include:
应用确定单元401,用于确定需要在测试环境中进行测试的目标应用;an
源数据表确定单元402,用于如果所述目标应用中包括搜索功能,则确定所述测试环境的数据库中与所述目标应用相关的源数据表;a source data
数据同步单元403,用于将所述源数据表中的数据同步到线上的生产环境的数据库中,并处理为目标搜索引擎系统可用的目标数据表;
跨域请求单元404,用于在所述测试环境中对所述目标应用的搜索功能进行测试时,通过在所述测试环境中对所述目标搜索引擎系统进行跨域访问的方式发送搜索请求,使得所述搜索引擎系统通过对所述目标数据表进行检索的方式返回搜索结果,以便基于所述搜索结果对所述目标应用中的搜索功能进行测试。A
其中,所述测试环境与所述生产环境之间还包括预发布环境;所述预发布环境可连接到所述生产环境中的数据库,并通过独立的服务器集群部署与所述生产环境中相同的搜索引擎系统;Wherein, a pre-release environment is further included between the test environment and the production environment; the pre-release environment can be connected to the database in the production environment, and the same as that in the production environment can be deployed through an independent server cluster search engine system;
所述跨域请求单元具体可以用于:The cross-domain request unit can be specifically used for:
通过在所述测试环境中对所述预发布环境中部署的搜索引擎系统进行跨域访问的方式,发送搜索请求。The search request is sent by performing cross-domain access to the search engine system deployed in the pre-release environment in the test environment.
具体的,所述数据同步单元具体可以包括:Specifically, the data synchronization unit may specifically include:
全量同步子单元,用于利用离线数据同步工具,将所述源数据表中的历史存量数据全量同步到所述生产环境中的开放数据处理服务系统,所述开放数据处理服务系统用于对生产环境中实时产生的数据进行存储及计算;The full synchronization subunit is used to use an offline data synchronization tool to fully synchronize the historical inventory data in the source data table to the open data processing service system in the production environment, and the open data processing service system is used for the production Real-time data generated in the environment is stored and calculated;
监测子单元,用于通过测试环境中的消息监测系统对所述源数据表中的数据变更消息进行监测;a monitoring subunit, used for monitoring the data change message in the source data table through the message monitoring system in the test environment;
增量同步子单元,用于将监测到的数据变更消息转换为所述生产环境中的消息中间件系统中定义的消息格式,并通过调用所述消息中间件系统的接口,将所述数据变更消息发送给所述生产环境中的消息中间件系统,以便将所述源数据表中的增量数据同步到所述生产环境的数据库中。Incremental synchronization subunit, used to convert the monitored data change message into a message format defined in the message middleware system in the production environment, and change the data by calling the interface of the message middleware system The message is sent to the message middleware system in the production environment in order to synchronize the incremental data in the source data table into the database of the production environment.
具体的,所述数据同步单元在对同步后的数据进行处理时,可以用于:Specifically, when the data synchronization unit processes the synchronized data, it can be used for:
通过所述目标搜索引擎系统对应的离线数据加工系统,将所述历史存量数据以及所述增量数据进行融合,并加工处理后生成符合所述目标搜索引擎系统格式要求的目标数据表。Through the offline data processing system corresponding to the target search engine system, the historical inventory data and the incremental data are fused, and processed to generate a target data table that meets the format requirements of the target search engine system.
另外,该装置还可以包括:In addition, the device may also include:
权限申请单元,用于为所述目标搜索引擎系统对应的离线数据加工系统申请获得使用所述开放数据处理服务系统中的数据的权限。A permission application unit, configured to apply for the permission to use the data in the open data processing service system for the offline data processing system corresponding to the target search engine system.
项目创建单元,用于在所述目标搜索引擎系统对应的离线数据加工系统中申请创建独立的项目,以便为来自所述测试环境的数据处理分配独立的资源,以进行与所述生产环境中的线上数据之间的隔离。The project creation unit is used to apply for creating an independent project in the offline data processing system corresponding to the target search engine system, so as to allocate independent resources for data processing from the test environment, so as to carry out processing with the production environment. Isolation between online data.
其中,所述监测子单元具体可以用于:Wherein, the monitoring subunit can be specifically used for:
通过在所述测试环境中的消息监测系统中创建自主消费模式的服务,并接入需要监测的所述源数据表,以便所述消息监测系统对所述源数据表中的数据变更事件进行监测。By creating a service in an autonomous consumption mode in the message monitoring system in the test environment, and accessing the source data table that needs to be monitored, the message monitoring system can monitor data change events in the source data table .
再者,该装置还可以包括:Furthermore, the device may also include:
授权单元,用于向所述生产环境的消息中间件系统申请获得授权信息,并在所述消息中间件系统中申请消息主题,以用于接收来自所述测试环境中的消息监测系统发送的消息。an authorization unit, configured to apply to the message middleware system of the production environment to obtain authorization information, and apply for a message subject in the message middleware system, so as to receive messages from the message monitoring system in the test environment .
另外,本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现前述方法实施例中任一项所述的方法的步骤。In addition, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the steps of the method described in any one of the foregoing method embodiments.
以及一种电子设备,包括:and an electronic device comprising:
一个或多个处理器;以及one or more processors; and
与所述一个或多个处理器关联的存储器,所述存储器用于存储程序指令,所述程序指令在被所述一个或多个处理器读取执行时,执行前述方法实施例中任一项所述的方法的步骤。a memory associated with the one or more processors, the memory is used to store program instructions that, when read and executed by the one or more processors, perform any one of the foregoing method embodiments the steps of the method.
其中,图5示例性的展示出了电子设备的架构,具体可以包括处理器510,视频显示适配器511,磁盘驱动器512,输入/输出接口513,网络接口514,以及存储器520。上述处理器510、视频显示适配器511、磁盘驱动器512、输入/输出接口513、网络接口514,与存储器520之间可以通过通信总线530进行通信连接。5 exemplarily shows the architecture of the electronic device, which may specifically include a processor 510 , a video display adapter 511 , a disk drive 512 , an input/output interface 513 , a network interface 514 , and a memory 520 . The processor 510 , the video display adapter 511 , the disk drive 512 , the input/output interface 513 , the network interface 514 , and the memory 520 can be communicatively connected through a
其中,处理器510可以采用通用的CPU(Central Processing Unit,处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本申请所提供的技术方案。The processor 510 may be implemented by a general-purpose CPU (Central Processing Unit, processor), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits for executing Relevant programs to realize the technical solutions provided in this application.
存储器520可以采用ROM(Read Only Memory,只读存储器)、RAM(Random AccessMemory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器520可以存储用于控制电子设备500运行的操作系统521,用于控制电子设备500的低级别操作的基本输入输出系统(BIOS)。另外,还可以存储网页浏览器523,数据存储管理系统524,以及搜索测试处理系统525等等。上述搜索测试处理系统525就可以是本申请实施例中具体实现前述各步骤操作的应用程序。总之,在通过软件或者固件来实现本申请所提供的技术方案时,相关的程序代码保存在存储器520中,并由处理器510来调用执行。The memory 520 may be implemented in the form of a ROM (Read Only Memory, read only memory), a RAM (Random Access Memory, random access memory), a static storage device, a dynamic storage device, and the like. The memory 520 may store an operating system 521 for controlling the operation of the electronic device 500 , and a basic input output system (BIOS) for controlling low-level operations of the electronic device 500 . In addition, a web browser 523, a data storage management system 524, a search test processing system 525, and the like may also be stored. The foregoing search and test processing system 525 may be an application program that specifically implements the operations of the foregoing steps in the embodiments of the present application. In a word, when the technical solutions provided in the present application are implemented by software or firmware, the relevant program codes are stored in the memory 520 and called and executed by the processor 510 .
输入/输出接口513用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。The input/output interface 513 is used for connecting input/output modules to realize information input and output. The input/output/module can be configured in the device as a component (not shown in the figure), or can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, and the like.
网络接口514用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。The network interface 514 is used to connect a communication module (not shown in the figure), so as to realize the communication interaction between the device and other devices. The communication module may implement communication through wired means (eg, USB, network cable, etc.), or may implement communication through wireless means (eg, mobile network, WIFI, Bluetooth, etc.).
总线530包括一通路,在设备的各个组件(例如处理器510、视频显示适配器511、磁盘驱动器512、输入/输出接口513、网络接口514,与存储器520)之间传输信息。
需要说明的是,尽管上述设备仅示出了处理器510、视频显示适配器511、磁盘驱动器512、输入/输出接口513、网络接口514,存储器520,总线530等,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本申请方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that although the above device only shows the processor 510, the video display adapter 511, the disk drive 512, the input/output interface 513, the network interface 514, the memory 520, the
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in storage media, such as ROM/RAM, magnetic disks , CD-ROM, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present application.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统或系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的系统及系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。The various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system or the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant part may refer to the partial description of the method embodiment. The systems and system embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, It can be located in one place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
以上对本申请所提供的对应用进行搜索功能测试的方法、装置及电子设备,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本申请的限制。The method, device and electronic device for testing the search function of an application provided by the present application have been described above in detail. In this article, specific examples are used to illustrate the principles and implementations of the present application. The description of the above embodiments is only for In order to help understand the method and the core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation and application scope. In conclusion, the content of this specification should not be construed as a limitation on the present application.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210618365.5A CN115017044B (en) | 2022-06-01 | 2022-06-01 | Method and device for testing search function of application and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210618365.5A CN115017044B (en) | 2022-06-01 | 2022-06-01 | Method and device for testing search function of application and electronic equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115017044A true CN115017044A (en) | 2022-09-06 |
| CN115017044B CN115017044B (en) | 2025-01-17 |
Family
ID=83072092
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210618365.5A Active CN115017044B (en) | 2022-06-01 | 2022-06-01 | Method and device for testing search function of application and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115017044B (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040193612A1 (en) * | 2003-03-31 | 2004-09-30 | Chang William I. | System and method for testing, monitoring, and tracking distributed transactions using a search engine |
| US20130339334A1 (en) * | 2012-06-15 | 2013-12-19 | Microsoft Corporation | Personalized search engine results |
| US8793225B1 (en) * | 2013-05-03 | 2014-07-29 | Splunk Inc. | Processing a system search request including external data sources and mixed modes |
| CN113934637A (en) * | 2021-10-27 | 2022-01-14 | 中国建设银行股份有限公司 | Test method, device, equipment and storage medium |
-
2022
- 2022-06-01 CN CN202210618365.5A patent/CN115017044B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040193612A1 (en) * | 2003-03-31 | 2004-09-30 | Chang William I. | System and method for testing, monitoring, and tracking distributed transactions using a search engine |
| US20130339334A1 (en) * | 2012-06-15 | 2013-12-19 | Microsoft Corporation | Personalized search engine results |
| US8793225B1 (en) * | 2013-05-03 | 2014-07-29 | Splunk Inc. | Processing a system search request including external data sources and mixed modes |
| CN113934637A (en) * | 2021-10-27 | 2022-01-14 | 中国建设银行股份有限公司 | Test method, device, equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115017044B (en) | 2025-01-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12079342B2 (en) | Data lineage management | |
| CN110399307A (en) | A test method, test platform and target server | |
| JP2017514218A (en) | Running third-party applications | |
| CN114064475B (en) | Cloud native application testing method, device, equipment and storage medium | |
| CN113656307B (en) | System capacity assessment method, device, equipment and medium | |
| CN111752843A (en) | Method, device, electronic equipment and readable storage medium for determining influence surface | |
| CN112596857A (en) | Method, device, equipment and medium for isolating SaaS multi-tenant data | |
| CN112650689A (en) | Test method, test device, electronic equipment and storage medium | |
| CN111078527B (en) | Auxiliary system and method for stress testing a server | |
| CN115576600A (en) | Code change-based difference processing method and device, terminal and storage medium | |
| CN113434384A (en) | Pressure testing method and device | |
| US12353494B2 (en) | Building and deploying a tag library for web site analytics and testing | |
| CN110058995A (en) | A kind of the data library test method and system of the interference of avoidable type of database | |
| CN114153732A (en) | Failure scenario test method, device, electronic device and storage medium | |
| CN114265737A (en) | System migration integrity detection method and device and electronic equipment | |
| CN115017044A (en) | Method and device for testing search function of application and electronic equipment | |
| WO2025082272A1 (en) | Method and apparatus for providing business function interface | |
| CN113031960B (en) | Code compiling method, device, server and storage medium | |
| CN113448822A (en) | Test method, test device, computer readable medium and electronic equipment | |
| CN112540772B (en) | Application publishing method and system, electronic device and storage medium | |
| KR102485154B1 (en) | Power Communication Service | |
| CN115237889A (en) | Database switching method and device, storage medium and computer equipment | |
| CN114968700A (en) | Service logic abnormity warning method based on system function log and related equipment | |
| CN112650679B (en) | Test verification method, device and computer system | |
| CN114942873B (en) | Capacity detection method and related equipment based on full-link online stress testing |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |