Service testing method and device, electronic equipment and computer readable storage medium
By receiving service test requests, parsing the service type, and constructing test tasks, the problem of mixed batch testing of multiple service types that cannot be achieved in existing technologies is solved, thus improving testing efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WEBANK (CHINA)
- Filing Date
- 2021-01-26
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies cannot achieve mixed batch testing of multiple types of services, resulting in low testing efficiency.
By receiving service test requests, parsing the service type, constructing corresponding test tasks, and sending the tasks to the corresponding service platform for testing, batch testing of multiple services can be achieved.
It improves service testing efficiency, overcomes the shortcomings of low testing efficiency in existing technologies, and enables batch testing of multiple services with a single service test request.
Smart Images

Figure CN112860546B_ABST
Abstract
Description
Technical Field
[0001] This application relates to testing technology, and more particularly to a service testing method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] In a service system, there are often multiple types of services available for use. In order to ensure that the services can be put into use in sequence, it is generally necessary to test the services to eliminate vulnerabilities in the service interfaces and help determine whether the quality of the service interfaces is suitable for production deployment.
[0003] In related technologies, each service is usually tested separately, and it is not possible to perform mixed batch testing of multiple types of services. Multiple tests are required to cover all services, resulting in low testing efficiency. Summary of the Invention
[0004] This application provides a service testing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can batch test multiple services with high testing efficiency.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides a service testing method, including:
[0007] A service test request is received, the service test request being used to request testing of at least two services;
[0008] The service test request is parsed to obtain the test sample and the service type of each service.
[0009] Based on the test samples, construct test tasks corresponding to each of the services;
[0010] Determine the service platform corresponding to the service type of each of the aforementioned services;
[0011] The test tasks for each of the aforementioned services will be sent to the service platform corresponding to the respective service type.
[0012] The test task is used by the service platform to test the corresponding services.
[0013] An application embodiment provides a service testing apparatus, comprising:
[0014] A receiving module is configured to receive a service test request, wherein the service test request is used to request testing of at least two services;
[0015] The parsing module is used to parse the service test request to obtain the test sample and the service type of each service.
[0016] A construction module is used to construct test tasks corresponding to each of the services based on the test samples;
[0017] The determination module is used to determine the service platform corresponding to the service type of each of the services.
[0018] The sending module is used to send the test tasks corresponding to each of the services to the service platform corresponding to the service type.
[0019] The test task is used by the service platform to test the corresponding services.
[0020] In the above scheme, the service testing device further includes: a caching module for caching the test tasks to a task queue; correspondingly, the step of determining the service platform corresponding to the service type of each service includes: taking test tasks out of the task queue in sequence based on the caching order of each test task in the task queue; and determining the corresponding service platform based on the service type of the service corresponding to the taken-out test task.
[0021] In the above scheme, the construction module is further configured to create a first thread, and based on the test sample, construct test tasks corresponding to each of the services through the first thread; correspondingly, the sending module is further configured to create a second thread that runs parallel to the first thread, and send the test tasks corresponding to each of the services to the service platform corresponding to the corresponding service type through the second thread.
[0022] In the above scheme, the parsing module is further configured to parse the service test request to obtain the test sample carried by the service test request, or to parse the service test request to obtain the sample identifier of the test sample, and to obtain the test sample from the target storage system based on the sample identifier.
[0023] In the above scheme, the service testing device further includes: a statistics module, used to receive test results returned by each of the service platforms, the test results including test sub-results for at least two statistical indicators; to perform statistics on the corresponding test sub-results of each of the service platforms for each of the statistical indicators respectively, to obtain corresponding statistical results; and to generate corresponding statistical reports based on the statistical results.
[0024] In the above scheme, the service type includes a federated service type, and the service platform corresponding to the federated service type includes a first participating platform and a second participating platform; the sending module is further configured to perform the following processing for each of the test tasks: when the service type corresponding to the test task is a federated service type, the test task is sent to the first participating platform; wherein, the first participating platform is configured to work with the second participating platform to test the corresponding service based on the test task.
[0025] This application provides a service testing method, including:
[0026] A test interface is presented, and various services are displayed on the test interface.
[0027] In response to a selection operation for at least two of the multiple services, the selected at least two services are used as the services to be tested.
[0028] In response to the test instructions for the at least two services, a service test request is sent to the management server;
[0029] The service test request is used by the management server to construct test tasks corresponding to each of the services and send them to the service platform of each service for testing.
[0030] An application embodiment provides a service testing apparatus, comprising:
[0031] The presentation module is used to present the test interface and display various services on the test interface.
[0032] The selection module is configured to, in response to a selection operation for at least two of the multiple services, select the at least two services as the services to be tested.
[0033] The sending module is used to send a service test request to the management server in response to a test command for the at least two services;
[0034] The service test request is used by the management server to construct test tasks corresponding to each of the services and send them to the service platform of each service for testing.
[0035] In the above scheme, the service testing device further includes: a sample selection module, used to present a sample selection function item; in response to a trigger operation for the sample selection function item, present at least one candidate test sample for selection; in response to a sample selection operation triggered based on the candidate test sample, use the selected candidate test sample as a test sample for the at least two services; the test sample is used by the management server to construct test tasks corresponding to each of the services.
[0036] This application provides an electronic device, including:
[0037] Memory, used to store executable instructions;
[0038] The processor, when executing executable instructions stored in the memory, implements the service testing method provided in the embodiments of this application.
[0039] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute and implement the service testing method provided in this application.
[0040] This application provides a computer program product, including a computer program that, when executed by a processor, implements the service testing method provided in this application.
[0041] The embodiments of this application have the following beneficial effects:
[0042] Compared to the existing technology that tests each service individually, the embodiments of this application receive service test requests for at least two services, parse the service test requests, construct test tasks corresponding to each service based on the parsed test samples, and send them to the service platform of the corresponding service type for testing. This achieves batch testing of multiple services with a single service test request, thereby overcoming the shortcomings of low testing efficiency in related technologies and improving service testing efficiency. Attached Figure Description
[0043] Figure 1 This is an optional structural diagram of the service testing system provided in the embodiments of this application;
[0044] Figure 2 This is an optional structural schematic diagram of the electronic device provided in an embodiment of this application;
[0045] Figure 3 This is an optional flowchart illustrating the service testing method provided in the embodiments of this application;
[0046] Figure 4 This is an optional flowchart illustrating the service testing method provided in the embodiments of this application;
[0047] Figure 5 This is an optional flowchart illustrating the service testing method provided in the embodiments of this application;
[0048] Figure 6 This is an optional flowchart illustrating the service testing method provided in the embodiments of this application;
[0049] Figure 7This is an optional schematic diagram of the test interface provided in an embodiment of this application;
[0050] Figure 8 This is an optional flowchart illustrating the service testing method provided in the embodiments of this application;
[0051] Figure 9 This is an optional schematic diagram of the test interface provided in an embodiment of this application;
[0052] Figure 10 This is an optional schematic diagram of the test interface provided in an embodiment of this application;
[0053] Figure 11 This is an optional schematic diagram of the test interface provided in an embodiment of this application;
[0054] Figure 12 This is an optional flowchart illustrating the service testing method provided in the embodiments of this application;
[0055] Figure 13 This is an optional structural diagram of the service testing system provided in the embodiments of this application;
[0056] Figure 14 This is an optional structural schematic diagram of the service testing apparatus provided in the embodiments of this application;
[0057] Figure 15 This is an optional structural schematic diagram of the service testing device provided in the embodiments of this application. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0060] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0062] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0063] 1) Offline backtesting is a method used to test a service's profitability, risk profile, and other relevant metrics. It works by feeding a sample of data from a specific period into the service under test, allowing it to run automatically in a simulated backtesting environment, and finally evaluating the service based on the calculated results.
[0064] 2) Federated machine learning (also known as federated learning, joint learning, or consortium learning) is a machine learning framework that effectively helps multiple organizations use data and perform machine learning modeling while meeting user privacy, data security, and government regulations. As a distributed machine learning paradigm, federated learning effectively solves the data silo problem, allowing participants to jointly model data without sharing it, thus technically breaking down data silos and achieving collaborative intelligence.
[0065] Federated learning (aka Federated Machine Learning) can be divided into three categories: Horizontal Federated Learning, Vertical Federated Learning, and Federated Transfer Learning.
[0066] Horizontal federated learning, also known as feature-aligned federated learning, involves participants whose data features are aligned. It is suitable for situations where participants' data features overlap significantly, while their sample identifiers (IDs, identity documents) overlap less. Vertical federated learning, also known as sample-aligned federated learning, involves participants whose training samples are aligned. It is suitable for situations where participants' training sample IDs overlap significantly, while their data features overlap less.
[0067] Based on this, embodiments of this application provide a service testing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can batch test multiple services with high testing efficiency.
[0068] First, the service testing system provided in the embodiments of this application will be described, see [link to relevant documentation]. Figure 1 , Figure 1 This is an optional architecture diagram of the service testing system 100 provided in this application embodiment. The terminal 400, management server 200, and service platform 500 (500-1, 500-2, ..., 500-n) are all connected via network 300. Network 300 can be a wide area network (WAN), a local area network (LAN), or a combination of both, using a wireless link for data transmission. In some embodiments, the terminal 400 can be a laptop, tablet, desktop computer, smartphone, dedicated messaging device, portable gaming device, smart speaker, smartwatch, etc., but is not limited to these. The management server 200 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Network 300 can be a wide area network (WAN), a local area network (LAN), or a combination of both. The service platform 500 can be implemented as a terminal or as a server. Terminal 400, management server 200 and service platform 500 can be connected directly or indirectly through wired or wireless communication, and this application embodiment does not impose any restrictions.
[0069] Terminal 400 is used to present a test interface and display multiple services on the test interface. In response to a selection operation for at least two of the multiple services, the selected at least two services are used as the services to be tested. In response to a test instruction for the at least two services, a service test request is sent to management server 200.
[0070] Management server 200 is configured to receive service test requests, the service test requests being used to request testing of at least two services; parse the service test requests to obtain test samples and service types of each service; construct test tasks corresponding to each service based on the test samples; determine service platforms 500 corresponding to the service types of each service; and send the test tasks corresponding to each service to the service platforms 500 corresponding to the service types.
[0071] Service platform 500 is used to receive test tasks, call the corresponding service interface to execute the test tasks, test the corresponding services, and return the test results to management server 200.
[0072] The management server 200 is also used to receive test results from each service platform 500, generate statistical reports based on the test results, and send the statistical reports to the terminal 400.
[0073] Terminal 400 is also used to receive and output statistical reports.
[0074] See Figure 2 , Figure 2 This is an optional structural diagram of the electronic device 500 provided in this application embodiment. In practical applications, the electronic device 500 can be implemented as follows: Figure 1 Terminal 400 or management server 200, in which electronic devices are used. Figure 1 Taking the management server 200 shown as an example, the electronic device implementing the service testing method of the embodiments of this application will be described. Figure 2 The illustrated electronic device 500 includes at least one processor 510, a memory 550, at least one network interface 520, and a user interface 530. The various components in the electronic device 500 are coupled together via a bus system 540. It is understood that the bus system 540 is used to implement communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 540.
[0075] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0076] User interface 530 includes one or more output devices 531 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0077] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 550 may optionally include one or more storage devices physically located away from the processor 510.
[0078] The memory 550 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 550 described in this application embodiment is intended to include any suitable type of memory.
[0079] In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0080] Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0081] The network communication module 552 is used to reach other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0082] Presentation module 553 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 531 (e.g., a display screen, a speaker, etc.) associated with user interface 530;
[0083] The input processing module 554 is used to detect and translate one or more user inputs or interactions from one or more input devices 532.
[0084] In some embodiments, the service testing apparatus provided in this application can be implemented in software. Figure 2A service testing apparatus 555 stored in memory 550 is shown. This apparatus can be software in the form of programs and plug-ins, and includes the following software modules: a receiving module 5551, a parsing module 5552, a building module 5553, a determining module 5554, and a sending module 5555. These modules are logically connected and can therefore be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.
[0085] In other embodiments, the service testing apparatus provided in this application can be implemented in hardware. As an example, the service testing apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the service testing method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0086] The service testing method provided in this application will be described in conjunction with exemplary applications and implementations of the management server provided in the embodiments of this application. See also Figure 3 , Figure 3 This is an optional flowchart illustrating the service testing method provided in this application embodiment, which will be combined with... Figure 3 The steps shown are explained.
[0087] Step 101: The management server receives a service test request, which is used to request testing of at least two services.
[0088] Here, service test requests are sent from the terminal to the management server, and users can issue corresponding service test requests through the terminal's human-computer interaction interface. The service test request encapsulates service identifiers corresponding to at least two services. In this embodiment, the service types include federated services and non-federated services. Non-federated services are ordinary API services, providing service interfaces for use in a non-federated model. In some embodiments, the service test request carries service information for multiple services, the task type of the test task, and the selected test sample.
[0089] Step 102: Parse the service test request to obtain the test sample and the service type of each service.
[0090] In this embodiment, after parsing the service test request, the management server obtains service information and test samples for various services carried in the service test request. The service information includes the service identifier and service type. Here, the test samples can be uploaded when the service test request is sent, or the appropriate test samples can be selected when the service test request is sent, and the selected sample identifier can be encapsulated within the service test request.
[0091] In some embodiments, based on Figure 3 Step 102 can also be implemented in the following way: the management server parses the service test request to obtain the test sample carried by the service test request, or parses the service test request to obtain the sample identifier of the test sample, and obtains the test sample from the target storage system based on the sample identifier.
[0092] In practice, when a service test request carries a test sample, the management server directly parses the service test request to obtain the test sample. When the service test request carries a sample identifier for the test sample, the management server parses the server test request to obtain the sample identifier, queries the storage system based on the sample identifier, and retrieves the test sample corresponding to that sample identifier from the storage system.
[0093] Step 103: Based on the test samples, construct test tasks corresponding to each of the services.
[0094] In practice, the management server constructs corresponding test tasks for each service based on the test samples and generates corresponding task IDs. In some embodiments, the management server can also construct corresponding test tasks based on the sample identifier of the test samples.
[0095] In some embodiments, the management server constructs a corresponding test task for each service based on the service type, test sample, task type of the test task, and the selection result of whether to generate a statistical report. For example, for service 1, its service type is federated service, the test sample requested by the service test request is sample 1, the task type is online batch test, and the selection result of whether to generate a statistical report is "yes". Based on this information, the management server generates a test task for service 1 and generates a corresponding task ID, such as job1.
[0096] In some embodiments, see Figure 4 , Figure 4 This is an optional flowchart illustrating the service testing method provided in an embodiment of this application, based on... Figure 3 After step 103, the method further includes:
[0097] Step 201: The management server caches the test task in the task queue.
[0098] In practice, the management server caches the task IDs corresponding to the constructed test tasks in the task queue. The task queue can be set up within the management server or in an external storage system that communicates with the management server.
[0099] Correspondingly, step 104 can also be implemented in the following way:
[0100] Step 1041: The management server retrieves test tasks from the task queue in sequence based on the cache order of each test task in the task queue.
[0101] Step 1042: Determine the corresponding service platform based on the service type of the service corresponding to the extracted test task.
[0102] In practice, the server retrieves test tasks sequentially from the task queue according to the First-In-First-Out (FIFO) principle. For each retrieved test task, the server determines its corresponding service type and, based on that, identifies the appropriate access platform. It's important to note that the management server processes the construction and dispatch of test tasks in parallel, using the task queue as an intermediary to improve processing speed and prevent any test tasks from being missed.
[0103] In some embodiments, based on Figure 3 Step 103 can also be implemented as follows: the management server creates a first thread, and based on the test samples, constructs test tasks corresponding to each of the services through the first thread. Correspondingly, step 105 can also be implemented as follows: the management server creates a second thread that runs parallel to the first thread; and through the second thread, sends the test tasks corresponding to each of the services to the service platform corresponding to the corresponding service type.
[0104] In practice, the management server creates two parallel threads—the first thread and the second thread—for the test sample construction task and the test sample sending task, respectively. The first thread executes the test sample construction task, while the second thread executes the test sample sending task, thus efficiently and orderly constructing and sending test samples and improving processing speed.
[0105] Step 104: Determine the service platform corresponding to the service type of each service.
[0106] In actual implementation, the management server determines the access address of the service platform for the corresponding service type based on the service type of the test task. It should be noted that this embodiment only distributes test tasks according to service type; that is, once the service type is determined, the test task for that service type is sent to the corresponding service platform. In some embodiments, while differentiating test tasks by service type, differentiation is also performed on individual services. For example, by parsing a service test request, three services are obtained, including service 1, service 2, and service 3. Here, services 1 to 3 can all be located on the same service platform, or they can be located on different service platforms. When located on different service platforms, the management server also needs to determine the different service platforms for each service.
[0107] Step 105: Send the test tasks corresponding to each service to the service platform corresponding to the respective service type. The test tasks are used by the service platform to test the corresponding services.
[0108] In practice, the management server sends test tasks to the corresponding service platforms based on the service type of the test task. The service platforms then invoke the appropriate service interfaces to execute the test tasks and test the services. Here, the service test request may request multiple services, and the service platform executes the received test tasks for these multiple services in parallel.
[0109] This application embodiment receives service test requests for at least two services, parses the service test requests, constructs test tasks corresponding to each service based on the parsed test samples, and sends them to the service platform of the corresponding service type for testing. This achieves batch testing of multiple services with a single service test request, thereby overcoming the shortcomings of low testing efficiency in related technologies and improving service testing efficiency.
[0110] In some embodiments, the service type includes a federated service type, and the service platform corresponding to the federated service type includes: a first participating party platform and a second participating party platform. Based on Figure 3 Step 105 can also be implemented in the following way: the management server performs the following processing for each of the test tasks: when the service type corresponding to the test task is a federated service type, the test task is sent to the first participating party platform; wherein, the first participating party platform is used to work with the second participating party platform to test the corresponding service based on the test task.
[0111] In some embodiments, see Figure 5 , Figure 5 This is an optional flowchart illustrating the service testing method provided in an embodiment of this application, based on... Figure 3 It can also execute:
[0112] Step 301: The management server receives the test results returned by each of the service platforms, and the test results include test sub-results for at least two statistical indicators.
[0113] Step 302: For each of the statistical indicators, the corresponding test sub-results of each of the service platforms are statistically analyzed to obtain the corresponding statistical results.
[0114] Step 303: Based on the statistical results, generate a corresponding statistical report.
[0115] In practice, when a service test request includes a selection result for generating a statistical report, the management server, after receiving the test results returned by each service platform, also performs statistical analysis on the test results. In this application, the management server performs statistical analysis on the test results for multiple statistical indicators. For each statistical indicator, the test results of the corresponding service platform include test sub-results for that statistical indicator. Here, the statistical analysis of the test results for the statistical indicators can be performed by the management server, or the management server can send a statistical request to the statistical platform, which will then perform statistical analysis on the test results for each statistical indicator and return the statistical results to the management server.
[0116] In practice, the management server generates corresponding statistical reports based on the statistical results obtained. These reports can be in the form of tables or documents. The management server can store the generated statistical reports locally or send them to a storage system. After receiving the statistical reports, the management server generates a test completion message and sends it to the terminal, prompting the user to confirm the test is complete. Furthermore, the terminal can also offer a download function for the statistical reports, allowing users to download and view them. Alternatively, the terminal can directly display the statistical reports for users to browse.
[0117] The service testing method provided in the embodiments of this application will be described next. See [link to relevant documentation]. Figure 6 , Figure 6 This is an optional flowchart illustrating a service testing method provided in an embodiment of this application. The service testing method provided in this embodiment includes:
[0118] Step 401: The terminal displays a test interface and presents various services on the test interface.
[0119] See Figure 7 , Figure 7This is an optional schematic diagram of the test interface provided in this application embodiment. In response to the start command for the test client, the terminal presents the test interface of the test client, and displays various services within the test interface. Here, each service type corresponds to multiple services, and the terminal presents services corresponding to these multiple service types on the test interface for the user to select. Users can select services in batches, or select individually and submit in batches, etc.
[0120] Step 402: In response to the selection operation for at least two of the multiple services, the selected at least two services are selected as the services to be tested.
[0121] Step 403: In response to the test instructions for the at least two services, a service test request is sent to the management server. The service test request is used by the management server to construct test tasks corresponding to each of the services and send them to the service platforms of the corresponding services for testing.
[0122] In practice, the test interface also presents a confirmation function. The terminal, in response to a trigger operation for the confirmation function, generates test instructions for the at least two services. In some embodiments, the terminal can also, in response to a selection operation for at least two services, generate corresponding test instructions upon obtaining the selected services, and, in response to test execution, send a service test request to the management server. In some embodiments, the test instructions can also be issued to the terminal by other devices, or can be triggered based on certain conditions, such as when a test cycle arrives.
[0123] In some embodiments, see Figure 8 , Figure 8 This is an optional flowchart illustrating the service testing method provided in this application embodiment. Before step 403, the following can also be executed:
[0124] Step 501: The terminal displays the sample selection function.
[0125] Step 502: In response to the triggering operation for the sample selection function item, at least one candidate test sample is presented for selection.
[0126] Step 503: In response to the sample selection operation triggered based on the candidate test samples, the selected candidate test samples are used as test samples for the at least two services. The test samples are used by the management server to construct test tasks corresponding to each of the services.
[0127] For example, see Figure 9 , Figure 9This is an optional schematic diagram of the test interface provided in this application embodiment. In actual implementation, the terminal also presents a sample selection function item on the test interface. In response to a trigger operation for the sample selection function item, the terminal presents a selection list of test samples, with at least two sub-selection function items in the list, each corresponding to a candidate test sample. In response to a selection operation for a sub-selection function item, the terminal obtains the sample identifier of the selected candidate test sample, for example, sample 1. Then, in response to a trigger operation for the confirmation function item, the terminal generates a corresponding test instruction and, based on the selected at least two services and the sample identifier of the test sample, generates a corresponding service test request, which is then sent to the management server. It should be noted that the test samples are stored in the storage system. After receiving the service test request, the management server parses the service test request to obtain the sample identifier, accesses the corresponding storage system based on the sample identifier, and obtains the test sample corresponding to the sample identifier from the storage system.
[0128] In some embodiments, see Figure 10 , Figure 10 This is an optional schematic diagram of the test interface provided in this application embodiment. In actual implementation, the terminal responds to a trigger operation for selecting a sample function item, such as clicking on... Figure 10 The "Browse" button indicates that a sample selection interface has been created, displaying multiple test samples, such as... Figure 10 The "Sample 1" to "Sample 6" shown here are test samples stored locally on the terminal. In response to the selection operation for the test sample, the terminal uploads the selected test sample to the test client, so that the test client can generate corresponding service test requests based on the uploaded test sample and at least two selected services.
[0129] In some embodiments, see Figure 11 , Figure 11 This is an optional schematic diagram of the test interface provided in this application embodiment. The test interface also presents a task type selection function for the test task. The terminal responds to the task type selection function to obtain the selected task type, such as... Figure 11 The "Online Batch Test" interface is shown. The test interface also presents a selection option for whether to generate a statistical report. The terminal responds to the trigger operation of this selection option and obtains the result of whether to generate a statistical report, such as... Figure 11 The option displayed is "Yes". Next, in response to the trigger operation for the confirmation function item, the terminal generates a corresponding service test request based on the selected service, task type, test sample, and the selection result regarding whether to generate a statistical report.
[0130] In this embodiment, the terminal presents multiple services on the test interface. In response to the selection operation of at least two services among the multiple services, the selected at least two services are used as the services to be tested. In response to the test instructions for at least two services, the terminal sends a service test request to the management server, so that the management server constructs test tasks corresponding to each service and sends them to the service platform of each service for testing. This realizes batch testing of multiple services, allowing users to submit a test request only once to automatically perform batch testing of multiple services, saving manual workload and improving testing efficiency.
[0131] The service testing method provided in this application embodiment will be further described below. This service testing method is implemented collaboratively by the terminal, management server, and service platform. Figure 12 This is an optional flowchart illustrating the service testing method provided in this application embodiment. See also... Figure 12 The service testing method provided in this application includes:
[0132] Step 601: The terminal displays a test interface, which includes various services and sample selection options.
[0133] Step 602: In response to the selection operation for at least two of the multiple services, the terminal selects the at least two services as the services to be tested.
[0134] Step 603: In response to the trigger operation for the sample selection function item, the terminal presents at least one candidate test sample for selection.
[0135] Step 604: In response to the sample selection operation triggered based on the candidate test samples, the terminal selects the candidate test samples as test samples for the at least two services.
[0136] In some embodiments, see Figure 10 The terminal also presents a task type selection function and a statistical report generation function on the test interface. The terminal responds to the selection operation of the task type selection function to obtain the selected task type. The terminal responds to the selection operation of the statistical report generation function to obtain the selection result of whether to generate a statistical report. Here, the selection result includes two results: "yes" and "no".
[0137] It should be noted that the order in which users trigger the selection operations for services, test samples, task types, and whether to generate statistical reports can be arbitrary.
[0138] Step 605: In response to the test instructions for the at least two services, the terminal sends a service test request to the management server.
[0139] In practice, the terminal also displays a confirmation function on the test interface. The terminal responds to the confirmation operation for this function and receives the corresponding test instruction. In some embodiments, the test instruction may be sent to the terminal by another device, or it may be generated by the terminal based on certain triggering conditions, such as the test cycle reaching its end. Responding to the test instruction, the terminal generates a corresponding service test request based on the selected service, test sample, task type, and whether to generate a statistical report, and sends the service test request to the management server.
[0140] Step 606: The management server parses the service test request to obtain the test sample and the service type of each service.
[0141] It should be noted that the service types include federated service types and ordinary API service types, that is, federated service types and non-federated service types.
[0142] Step 607: The management server constructs test tasks corresponding to each of the services based on the test samples.
[0143] Here, the management server constructs a corresponding test task for each service. In some embodiments, if the test sample contains multiple backtracking times, the management server also constructs a test task for each backtracking time for each service. That is, if the test sample contains 'a' backtracking times, then 'a' test tasks are constructed for any service, where 'a' is a positive integer greater than or equal to 1.
[0144] Step 608: The management server determines the service platform corresponding to the service type of each service.
[0145] Step 609: The management server sends the test tasks corresponding to each of the services to the service platform corresponding to the service type.
[0146] Step 610: The service platform calls the service interface to execute the test task and obtain the test results.
[0147] Step 611: The service platform sends the test results to the management server.
[0148] Step 612: The management server generates a statistics request based on the test results.
[0149] Step 613: The management server performs statistical analysis on the test results based on the statistical indicators to obtain the corresponding statistical results.
[0150] In practice, the management server can generate a statistical request and send it to the statistics platform. The statistics platform will then respond to the request, analyze the test results for at least two statistical indicators, obtain the corresponding statistical results, and return them to the management server. It should be noted that the management server will only analyze the test results if the option to generate a statistical report in the service test request is "yes"; otherwise, the management server will not analyze the test results.
[0151] Step 614: The management server sends the statistical results to the terminal.
[0152] Step 615: The terminal outputs the statistical results.
[0153] In practice, the management server can directly send the statistical results to the terminal, which then displays the results directly in the test interface for user viewing. In some embodiments, the management server can also send a message indicating that the statistical results have been generated to the terminal. Upon receiving this message, the terminal displays a download function for the statistical report. The user can then trigger a download operation for the statistical report using this function, and the terminal will display the corresponding statistical report in response to the download operation.
[0154] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0155] See Figure 13 , Figure 13 This is an optional structural diagram of the service testing system provided in this application embodiment. The terminal displays a test interface, which presents services of various service types. Here, service types include federated service types and non-federated service types, with multiple services corresponding to each service type. Non-federated services are ordinary API services, providing ordinary service interfaces that can be directly called. Federated services are federated model services in federated learning scenarios. The service platform corresponding to the federated service type includes multiple participating party platforms. In this application embodiment, it specifically includes a first participating party platform and a second participating party platform, wherein the first participating party is the application party, and the second participating party is the provider, that is, the second participating party provides data for the first participating party to use.
[0156] In practice, users can select the service to be tested from the various service types presented in the test interface. Specifically, the terminal responds to the selection operation of at least two services from the multiple services, and uses the selected at least two services as the services to be tested.
[0157] It should be noted that the test interface also presents a task type selection function, which allows users to choose between at least two test task types. These test task types include online single-item testing, online batch testing, and offline backtracking batch testing. Furthermore, the test interface also presents a sample selection function, which allows users to select test samples. Specifically, in response to the triggering of the sample selection function, the terminal presents multiple candidate test samples for selection. In response to a sample selection operation triggered based on these candidate test samples, the terminal obtains the sample identifier of the selected candidate test sample. Based on the sample identifier, the terminal retrieves the corresponding candidate test sample from the storage system and uses the selected candidate test sample as the test sample for the selected at least two services. In some embodiments, users can also upload test samples by triggering the sample selection function. Specifically, in response to the triggering of the sample selection function, the terminal presents a sample upload interface with multiple candidate test samples for selection. In response to a sample selection operation triggered based on these candidate test samples, the terminal uploads the selected candidate test sample. After successful upload, the selected candidate test sample is obtained.
[0158] In practice, after the terminal obtains at least two selected services, task types, and test samples, it packages the at least two services, task types, and test samples in response to test instructions for the at least two services, generates a corresponding service test request, and sends it to the management server. In some embodiments, the terminal also presents a selection option for whether to generate a statistical report. In response to a trigger operation on this selection option, the terminal obtains a selection result for whether to generate a statistical report and packages this selection result into the service test request, sending it to the management server.
[0159] Upon receiving a service test request, the management server parses it to obtain the service identifiers of multiple services, the task types of the test tasks, the selected test samples, and the selection result for whether to generate a statistical report. Then, for each service, the management server assembles test subtasks. Specifically, for a single service, the management server generates corresponding test subtasks based on the service type, the task type of the test task, the sample identifier of the selected test sample, and the selection result for whether to generate a statistical report.
[0160] In practice, the management server adds a task ID to each test subtask and adds these IDs to the task queue according to the order in which the test subtasks are assembled. The management server then retrieves the task IDs from the task queue based on the FIFO principle and sends the corresponding test subtasks to the appropriate service platforms. Here, the management server can perform the assembly and distribution of test subtasks in parallel. It should be noted that if the task type is an online single test, the management server directly sends the service test request to the corresponding service platform. If the task type is an online batch test or an offline backtracking batch test, the management server needs to parse the service test request and assemble the corresponding test subtasks.
[0161] In practice, the management server retrieves the task ID from the task queue and sends the corresponding test subtask to the service platform for the appropriate service type. Upon receiving the test subtask, the service platform calls the corresponding service interface to execute it, thus testing the service. It should be noted that when the service platform receives multiple test subtasks, it executes them in parallel batches. Specifically, the service platform calls the corresponding service interface to execute the respective test subtasks, thus testing multiple services in batches.
[0162] It should be noted that for a federated service platform, the service platform includes a first participating platform and a second participating platform. The first participating platform receives a test task of the corresponding service type from the management server, calls the corresponding federated service interface, executes the test task, obtains a one-sided computation result, and forwards the computation request to the second participating platform. The second participating platform then performs the computation, obtains a one-sided computation result, and sends it back to the first participating platform. The first participating platform then obtains the corresponding test result based on its local one-sided computation result and the one-sided computation result sent by the second participating platform. It should be understood that the first and second participating platforms are federated learning-based service platforms, and their interaction is encrypted. In some embodiments, if the test task requested by the service test request is an online batch test or an offline backtracking batch test, the first and second participating platforms each perform batch one-sided computations. The first participating platform then summarizes the batch one-sided computation results to obtain the final test result.
[0163] In practice, each service platform returns its test results to the management server, which then sends the results to the statistics platform. The statistics platform then analyzes the test results based on multiple statistical indicators, obtaining the statistical results for each indicator. These indicators include the detection rate, zero-value rate, information value (IV), Kolmogorov-Smirnov test, and the ratio of good to bad samples. After obtaining the statistical results for each indicator, the statistics platform returns them to the management server. The management server generates a corresponding statistical report based on the test and statistical results, stores the report in the storage system, and sends a test completion message to the terminal. The terminal then outputs this message to notify the user that the service test is complete. Furthermore, the terminal can also provide a download function for the test results or statistical reports, allowing users to download and view them. This download function also includes a batch download feature for users to download in batches.
[0164] The following description continues to illustrate the exemplary structure of the service testing apparatus 555 provided in the embodiments of this application as a software module. In some embodiments, see [link to relevant documentation]. Figure 14 , Figure 14 This is an optional structural diagram of the service testing apparatus provided in this application embodiment. The software modules stored in the service testing apparatus 555 in the memory 550 may include:
[0165] Receiving module 5551 is used to receive a service test request, wherein the service test request is used to request testing of at least two services;
[0166] The parsing module 5552 is used to parse the service test request to obtain test samples and the service types of each service.
[0167] The construction module 5553 is used to construct test tasks corresponding to each of the services based on the test samples;
[0168] The determination module 5554 is used to determine the service platform corresponding to the service type of each of the services.
[0169] The sending module 5555 is used to send the test tasks corresponding to each of the services to the service platform corresponding to the service type.
[0170] The test task is used by the service platform to test the corresponding services.
[0171] In some embodiments, the service testing apparatus further includes: a caching module for caching the test tasks to a task queue; correspondingly, determining the service platform corresponding to the service type of each service includes: retrieving test tasks sequentially from the task queue based on the caching order of each test task in the task queue; and determining the corresponding service platform based on the service type of the service corresponding to the retrieved test task.
[0172] In some embodiments, the construction module 5553 is further configured to create a first thread, and based on the test sample, construct test tasks corresponding to each of the services through the first thread; correspondingly, the sending module 5555 is further configured to create a second thread that runs parallel to the first thread, and send the test tasks corresponding to each of the services to the service platform corresponding to the corresponding service type through the second thread.
[0173] In some embodiments, the parsing module 5552 is further configured to parse the service test request to obtain the test sample carried by the service test request, or to parse the service test request to obtain the sample identifier of the test sample, and to obtain the test sample from the target storage system based on the sample identifier.
[0174] In some embodiments, the service testing apparatus further includes: a statistics module, configured to receive test results returned by each of the service platforms, the test results including test sub-results for at least two statistical indicators; to perform statistics on the corresponding test sub-results of each of the service platforms for each of the statistical indicators to obtain corresponding statistical results; and to generate corresponding statistical reports based on the statistical results.
[0175] In some embodiments, the service type includes a federated service type, and the service platform corresponding to the federated service type includes a first participating platform and a second participating platform; the sending module 5555 is further configured to perform the following processing for each of the test tasks: when the service type corresponding to the test task is a federated service type, the test task is sent to the first participating platform; wherein, the first participating platform is configured to work with the second participating platform to test the corresponding service based on the test task.
[0176] The following continues to describe an exemplary structure of the service testing device provided in this application embodiment as a software module, see [link to relevant documentation]. Figure 15 , Figure 15 This is an optional structural diagram of the service testing apparatus provided in this application embodiment. The service testing apparatus 15 provided in this application embodiment includes:
[0177] The presentation module 151 is used to present a test interface and to present various services on the test interface.
[0178] Selection module 152 is configured to, in response to a selection operation for at least two of the multiple services, select the at least two services as the services to be tested;
[0179] Sending module 153 is used to send a service test request to the management server in response to a test command for the at least two services;
[0180] The service test request is used by the management server to construct test tasks corresponding to each of the services and send them to the service platform of each service for testing.
[0181] In some embodiments, the service testing apparatus further includes: a sample selection module, configured to present a sample selection function item; in response to a trigger operation for the sample selection function item, present at least one candidate test sample for selection; in response to a sample selection operation triggered based on the candidate test sample, use the selected candidate test sample as a test sample for the at least two services; the test sample is used by the management server to construct test tasks corresponding to each of the services.
[0182] It should be noted that the description of the apparatus in this application embodiment is similar to the description of the method embodiment above, and has similar beneficial effects as the method embodiment, so it will not be repeated.
[0183] This application provides a computer program product, including a computer program, characterized in that the computer program, when executed by a processor, implements the service testing method provided in this application.
[0184] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to perform the method provided in this application, for example... Figure 3 The service testing method is shown.
[0185] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0186] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0187] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0188] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0189] In summary, the embodiments of this application enable batch testing of multiple services with high testing efficiency.
[0190] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A service testing method, characterized in that, include: A service test request is received, the service test request being used to request testing of at least two services; The service test request is parsed to obtain the test sample and the service type of each service. Based on the test samples, construct test tasks corresponding to each of the services; Determine the service platform corresponding to the service type of each of the aforementioned services; The test tasks for each of the aforementioned services will be sent to the service platform corresponding to the respective service type. The test task is used by the service platform to test the corresponding service; Receive test results returned by each of the service platforms, the test results including test sub-results for at least two statistical indicators; For each of the aforementioned statistical indicators, the corresponding test sub-results of each of the aforementioned service platforms are statistically analyzed to obtain the corresponding statistical results; Based on the statistical results, a corresponding statistical report is generated; The step of constructing test tasks corresponding to each of the services based on the test samples includes: Create the first thread; Based on the test samples, test tasks corresponding to each of the services are constructed through the first thread; Accordingly, sending the test tasks corresponding to each of the services to the service platform corresponding to the respective service type includes: Create a second thread that runs parallel to the first thread; The second thread sends the test tasks for each service to the service platform corresponding to the service type.
2. The method according to claim 1, characterized in that, After constructing the test tasks corresponding to each of the services, the method further includes: The test task is cached in the task queue; Accordingly, the step of determining the service platform corresponding to the service type of each of the services includes: Based on the caching order of each test task in the task queue, test tasks are retrieved from the task queue sequentially; Based on the service type corresponding to the extracted test task, determine the appropriate service platform.
3. The method according to claim 1, characterized in that, The process of parsing the service test request to obtain test samples includes: The service test request is parsed to obtain the test sample carried by the service test request, or the service test request is parsed to obtain the sample identifier of the test sample, and the test sample is obtained from the target storage system based on the sample identifier.
4. The method according to claim 1, characterized in that, The service type includes a federated service type, and the service platform corresponding to the federated service type includes: a first participating party platform and a second participating party platform; The step of sending the test tasks corresponding to each of the services to the service platform corresponding to the respective service type includes: Perform the following processing for each of the aforementioned test tasks: When the service type corresponding to the test task is a federated service type, the test task is sent to the first participating party platform; The first participating platform is used in conjunction with the second participating platform to test the corresponding services based on the test task.
5. A service testing method, characterized in that, include: A test interface is presented, and various services are displayed on the test interface. In response to a selection operation for at least two of the multiple services, the selected at least two services are used as the services to be tested. In response to the test instructions for the at least two services, a service test request is sent to the management server; The service test request is used by the management server to construct test tasks for each service through a first thread, and send them to the service platform of each service through a second thread that runs in parallel with the first thread, in order to perform the test. The management server receives test results returned by each of the service platforms. The test results include test sub-results for at least two statistical indicators. For each of the statistical indicators, the corresponding test sub-results of each service platform are statistically analyzed to obtain corresponding statistical results. Based on the statistical results, a corresponding statistical report is generated.
6. The method according to claim 5, characterized in that, Before sending the service test request to the management server, the method further includes: Presents the sample selection function; In response to a trigger operation for the sample selection function item, at least one candidate test sample is presented for selection; In response to a sample selection operation triggered based on the candidate test samples, the selected candidate test samples are used as test samples for the at least two services. The test samples are used by the management server to build test tasks corresponding to each of the services.
7. A service testing apparatus, characterized in that, include: A receiving module is configured to receive a service test request, wherein the service test request is used to request testing of at least two services; The parsing module is used to parse the service test request to obtain the test sample and the service type of each service. A construction module is used to construct test tasks corresponding to each of the services based on the test samples; The determination module is used to determine the service platform corresponding to the service type of each of the services. The sending module is used to send the test tasks corresponding to each of the services to the service platform corresponding to the service type. The test task is used by the service platform to test the corresponding service; The statistics module is used to receive test results returned by each of the service platforms, the test results including test sub-results for at least two statistical indicators; to perform statistics on the corresponding test sub-results of each service platform for each of the statistical indicators to obtain corresponding statistical results; and to generate corresponding statistical reports based on the statistical results. The construction module is also used to create a first thread; based on the test sample, the first thread is used to construct test tasks corresponding to each of the services. Correspondingly, the sending module is also used to create a second thread that runs parallel to the first thread; through the second thread, the test tasks corresponding to each of the services are sent to the service platform corresponding to the corresponding service type.
8. A service testing apparatus, characterized in that, include: The presentation module is used to present the test interface and display various services on the test interface. The selection module is configured to, in response to a selection operation for at least two of the multiple services, select the at least two services as the services to be tested. The sending module is used to send a service test request to the management server in response to a test command for the at least two services; The service test request is used by the management server to construct test tasks for each service through a first thread, and send them to the service platform of each service through a second thread that runs in parallel with the first thread, in order to perform the test. The management server receives test results returned by each of the service platforms. The test results include test sub-results for at least two statistical indicators. For each of the statistical indicators, the corresponding test sub-results of each service platform are statistically analyzed to obtain corresponding statistical results. Based on the statistical results, a corresponding statistical report is generated.
9. An electronic device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the service testing method according to any one of claims 1 to 6.