An artificial intelligence service online testing method and device
By receiving interface definitions and expected verification data through an online visual configuration interface, generating test request data, and making online calls, the problem of poor testing flexibility in existing technologies is solved. This achieves a closed loop of instant verification and release of artificial intelligence services, improving the immediacy and environmental adaptability of test verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE JIUTIAN ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
- Filing Date
- 2026-02-03
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, online testing of artificial intelligence services relies on offline static API description files, resulting in poor testing flexibility, inability to adapt to environmental differences, and difficulty in meeting the needs of rapid iteration and instant verification.
The system receives interface definition information and expected verification data through an online visual configuration interface, generates test request data, and makes online calls after the AI service is deployed to obtain actual response data in real time. After matching the actual response data with the expected verification data, the service status is updated, thus realizing a closed-loop process of testing and release.
It achieves synchronization between test data and the operating environment, adapts to differences in online environments, supports real-time parameter adjustment and verification, and builds an integrated closed-loop process for testing and release, improving the timeliness of test verification and the realism of the environment.
Smart Images

Figure CN122152689A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to an online testing method and apparatus for artificial intelligence services. Background Technology
[0002] With the rapid development of artificial intelligence technology, large AI models and various AI capabilities (such as image recognition and complex strategy computation) must undergo rigorous testing and verification processes before being officially offered to the public. Typically, the release process for AI capabilities includes two phases: offline development and testing, and online deployment and release. Only after the model deployed in the online environment has been verified to meet stability and functional requirements can it be made available to third-party users through a gateway to ensure service reliability.
[0003] In existing technologies, testing solutions based on API management platforms are commonly used to test application programming interfaces (APIs) deployed online. This approach requires setting up a dedicated API management platform. Testers first use third-party tools (such as Postman or Swagger) to generate API interface description files offline, and then upload these static description files to the management platform for parsing and mapping. The platform then initiates API calls based on the parsed fields, thereby completing the testing of the web service.
[0004] However, the aforementioned existing technologies suffer from drawbacks: reliance on offline static files leads to poor testing flexibility and an inability to adapt to varying environments. Specifically, because API description files are generated offline, the data lacks real-time availability and fails to reflect actual configuration differences in the online environment. If parameters require fine-tuning or interface definitions change during online testing, testers cannot directly modify them within the testing process; they must regenerate and upload the description files. This not only increases operational complexity but also disconnects the testing process from the immediate deployment of AI capabilities, making it difficult to meet the demands of rapid AI model iteration and real-time verification in field operations. Summary of the Invention
[0005] This invention provides an online testing method and apparatus for artificial intelligence services, which addresses the shortcomings of existing technologies that rely on offline static API description files, resulting in poor testing flexibility and insufficient environmental adaptability.
[0006] This invention provides an online testing method for artificial intelligence services, the method comprising: Receive interface definition information and expected verification data for the artificial intelligence service to be published, wherein the artificial intelligence service is deployed in the runtime environment; Based on the interface definition information and the obtained test input data, test request data is generated and sent to the artificial intelligence service; Receive the actual response data from the artificial intelligence service in response to the test request data; When it is determined that the actual response data matches the expected verification data, the status of the artificial intelligence service is updated to the published status to grant external access to the artificial intelligence service.
[0007] According to the method provided by the present invention, receiving interface definition information and expected verification data for the artificial intelligence service to be published includes: The system receives interface definition information set by the user for the artificial intelligence service through an online visual configuration interface. The interface definition information includes at least one of the following: application interface type, request header, request body, and parameter field constraints. Receive the expected output value input by the user in the online visual configuration interface for the interface definition information, as the expected verification data; The interface definition information is associated and mapped with the expected verification data to generate a corresponding test case template.
[0008] According to the method provided by the present invention, before generating test request data based on the interface definition information and the acquired test input data, the method further includes: The test case template is invoked, and the parameter field constraints are parsed to obtain the parsing result; Based on the analysis results, a parameter input control matching the test case template is generated in the online visual configuration interface; The parameter input control receives the parameter values entered by the user, which are then used as the test input data.
[0009] According to the method provided by the present invention, before sending the test request data to the artificial intelligence service, the method further includes: The test input data is validated according to preset rules, which include data type validation and required field integrity validation. The total number of current test cases for the AI service is counted, and it is determined whether the total number of current test cases has reached a preset minimum test quantity threshold. When the preset rule verification passes and the total number of current test cases reaches the minimum test quantity threshold, the step of sending the test request data to the artificial intelligence service is triggered.
[0010] According to the method provided by the present invention, generating test request data based on the interface definition information and the acquired test input data includes: Obtain the service routing address of the artificial intelligence service in the operating environment; According to the protocol specifications in the interface definition information, the test input data is encapsulated into test request data containing a request header and a request body, and the service routing address is used as the target address of the test request data.
[0011] According to the method provided by the present invention, determining that the actual response data matches the expected verification data includes: The test input data and the actual response data are displayed through an online visual configuration interface. Determine whether the content of the actual response data contains the expected verification data, or whether the structure of the actual response data conforms to the output specification defined by the expected verification data; If the judgment result is consistent, it is confirmed that the actual response data matches the expected verification data.
[0012] According to the method provided by the present invention, updating the status of the artificial intelligence service to the published status includes: confirming that all application interfaces described based on the interface definition information have executed the steps of sending the test request data and receiving the actual response data; The number of test cases that match the AI service is counted, and the number of test cases is confirmed to have reached the preset release standard threshold. A test verification report is then generated. Upon receiving the release confirmation instruction, the system modifies the status identifier of the AI service in the system configuration, updates the status of the AI service to the released status, and registers the AI service with the gateway system.
[0013] The present invention also provides an online testing device for artificial intelligence services, the device comprising: The data receiving module is used to receive interface definition information and expected verification data for the artificial intelligence service to be released, wherein the artificial intelligence service has been deployed in the runtime environment; The request sending module is used to generate test request data based on the interface definition information and the obtained test input data, and send the test request data to the artificial intelligence service; The response receiving module is used to receive the actual response data fed back by the artificial intelligence service to the test request data; The status update module is used to update the status of the artificial intelligence service to the published status when it is determined that the actual response data matches the expected verification data, so as to open the external calling permission of the artificial intelligence service.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the online testing method for artificial intelligence services as described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the online testing method for artificial intelligence services as described above.
[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the online testing method for artificial intelligence services as described above.
[0017] The online testing method and apparatus for artificial intelligence services provided by this invention receive interface definition information and expected verification data for the online operating environment before the deployment and release of the artificial intelligence service, and generate test request data accordingly to initiate online calls. This achieves synchronization between test data and the operating environment, eliminating the dependence on offline static description files. By acquiring actual response data and matching it with expected verification data, the testing process can flexibly adapt to differences in the online environment and support real-time adjustment and verification of parameters. Finally, the matching results are used to drive the artificial intelligence service status to be updated to the release status, constructing an integrated closed-loop process of testing and release. This effectively solves the technical defects of existing technologies, such as poor testing flexibility and inability to cover environmental differences due to reliance on offline files, and achieves seamless integration of testing activities and release processes, significantly improving the immediacy and environmental realism of test verification. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the online testing method for artificial intelligence services provided by the present invention.
[0020] Figure 2 This is an interactive schematic diagram of the online testing method for artificial intelligence services provided by the present invention.
[0021] Figure 3 This is a schematic diagram of the structure of the online testing device for artificial intelligence services provided by the present invention.
[0022] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0024] With the widespread application of artificial intelligence (AI) technology, the lifecycle management of AI services, especially the migration process from R&D environments to production environments, has become a critical aspect of ensuring business continuity. In current industrial practice, after the initial deployment of AI services in the online environment, they are typically in a pre-release intermediate state. At this point, although the service is logically running on the production environment servers, it has not yet been connected to a gateway or exposed to the outside world. Its purpose is to provide a real environment variable and data foundation for developers or testers to perform final online verification.
[0025] However, in the existing technological system, this online verification process is often fragmented and inefficient. On the one hand, existing interface verification methods heavily rely on external tools or offline scripts, requiring testers to repeatedly switch between the management platform and third-party testing software, manually synchronizing interface addresses, authentication information, and request parameters. This testing method, detached from the release process, not only leads to cumbersome operations but also prevents test results from being automatically and closedly fed back into the release decision. On the other hand, because artificial intelligence services typically involve complex tensor data inputs or specific business contexts, offline-generated test cases often fail to cover the actual dynamic range of the online environment, resulting in frequent situations where tests pass before release, only to be met with errors upon deployment.
[0026] Furthermore, existing AI platforms often lack a mandatory verification constraint mechanism when handling service release logic. Changes in service status (such as from pending testing to released) largely rely on manual intervention, lacking automated judgment logic based on actual call results. Under this management model, the quality and integrity of test data are difficult to trace, and it is impossible to perform real-time parameter tuning and error correction for subtle differences in the online environment (such as network policies, dependency library versions, etc.).
[0027] To address the problems of fragmented testing and release processes, poor environmental adaptability, and lack of automated verification constraints in the existing technologies, this invention provides an online testing method for artificial intelligence services. By integrating an online visual verification step into the release process, it deeply couples interface definition, test case construction, online invocation, and state flow control based on verification results. This ensures that every publicly released artificial intelligence service has undergone real and accurate technical verification in an online environment without relying on third-party tools. Only after meeting preset matching conditions is the service status updated and external access granted.
[0028] Before describing the specific solutions of the embodiments of the present invention, the terms and concepts involved in the embodiments of the present invention will be explained illustratively.
[0029] Interface definition information: This refers to the technical specifications of the application programming interface (API) provided by the AI service to be published. It includes at least the request type (e.g., GET, POST), the format requirements of the request headers, the structure definition of the request body, and the types and constraints of each parameter field, providing a format basis for generating valid test requests.
[0030] Expected validation data: This refers to the pre-set, assumed correct interface response result for a specific test scenario before test execution. It can be a specific numerical value, a piece of text, a structured data (such as a JSON object), or an output data format specification, used to compare with the actual response to determine whether the test passes.
[0031] Test input data: This refers to the actual values that the user fills in for each field according to the parameter field constraints in the interface definition information during the actual test execution. This data constitutes the payload of the test request message and is used to simulate real call scenarios.
[0032] Test request message: refers to a complete network request data packet that is encapsulated according to the protocol specifications (such as HTTP) in the interface definition information, including test input data, service routing address and other necessary control information, and can be directly sent to the target artificial intelligence service.
[0033] Actual response data: This refers to the result data returned by the AI service under test to the caller after receiving and processing the test request message. This data typically includes business processing results (such as model inference results, feature vectors), protocol status codes, and possible runtime logs or error messages.
[0034] Test case template: A structured data object that associates and stores interface definition information for a specific interface with corresponding expected verification data, forming a reusable test blueprint. This template defines how to invoke the test and what is expected, but does not include the specific values of the test input data that may change with each execution.
[0035] Parameter input controls: These are graphical interactive elements (such as text boxes, drop-down lists, check boxes, etc.) that are dynamically generated in the online visual configuration interface based on the parameter field constraints parsed from the test case template. Users can input or select specific test input data by manipulating these controls.
[0036] Service routing address: refers to the network address identifier of the AI service instance that is deployed and accessed in the online running environment (such as server, container), such as a URL or a combination of IP address and port number, which is the target address for sending test request messages.
[0037] Test Verification Report: This is a summary document automatically generated by the system after a series of test cases have been executed. Its content typically includes the scope of the tested interfaces, the number of test cases executed, details of pass / fail results, and comparisons between actual and expected data. It serves as a key basis for evaluating whether the AI capabilities meet the release requirements.
[0038] Gateway system: refers to a unified access and management system located before a service provides external endpoints. Verified and officially released AI services need to register in this system. The gateway system is responsible for subsequent request routing, load balancing, access control, traffic monitoring, etc., thereby providing a unified and secure service access point for external callers.
[0039] The execution entity of the online testing method for artificial intelligence services provided in this embodiment of the invention is an artificial intelligence service management platform (hereinafter referred to as the management platform) or an artificial intelligence service publishing system.
[0040] In actual hardware implementations, this execution entity is typically a server, a cluster of computing devices, or a cloud control node. For ease of description, the embodiments of this invention will subsequently be described in detail using a management platform as the execution entity.
[0041] This management platform typically includes the following functional modules to collaboratively complete the testing and release process: Interactive Presentation Layer: This layer interacts with users (such as algorithm developers or testers) through an online visual interface, and is responsible for receiving interface configurations and test inputs, and displaying test results.
[0042] Business logic layer: responsible for generating and parsing test case templates, encapsulating and assembling test request messages, and handling the consistency comparison logic of response data.
[0043] Service Management Layer: Responsible for maintaining the lifecycle status of AI services, including recording the service's running address, modifying service status identifiers, and completing the registration and publication of services in the gateway system in an instructional manner.
[0044] Figure 1 This is a flowchart illustrating the online testing method for artificial intelligence services provided by the present invention. The method includes: Step 101: Receive the interface definition information and expected verification data for the AI service to be published, wherein the AI service is deployed in the runtime environment.
[0045] After detecting that the AI service has completed its online deployment, the management platform initiates the configuration receiving process. At this point, although the AI service has been allocated corresponding computing resources and is active in the runtime environment, its external access path has not yet been opened. The management platform obtains the service's interface definition information through the management interface. This information serves as the technical blueprint for subsequent interactions with the service, clarifying the protocol specifications and data organization structure required to access the service.
[0046] The interface definition information encompasses various structured descriptive elements required to initiate a request. Once the management platform obtains these elements, it can determine the request method to be used when interacting with the AI service, as well as the various attribute identifiers that must be carried during data communication. This information details the components of the request data, including control information in the header and parameter names in the body, thus providing data support for the management platform to generate and send valid communication messages in this operating environment.
[0047] While receiving the interface definition information, the management platform also acquires the expected verification data for the AI service. This data serves as a logical reference for evaluating whether the service functionality meets the standards, pre-defining the correct response characteristics that the service should produce after receiving a request. The expected verification data includes business requirements or format requirements for the returned results, enabling the management platform to automatically determine whether the AI service in the online environment can output processing results that meet business expectations based on these preset standards in subsequent stages. This provides a data foundation for establishing an automated release and access mechanism.
[0048] Step 102: Generate test request data based on the interface definition information and the obtained test input data, and send the test request data to the artificial intelligence service.
[0049] Based on the previously acquired interface definition information, the management platform initiates the collection and processing of test input data. During this process, the management platform acquires specific parameter values related to the AI service business logic. These parameter values serve as the input payload for this online test, simulating data interaction in real-world business scenarios. The management platform matches the acquired test input data with the corresponding parameter items according to the field attributes determined in the interface definition information, ensuring that the input content meets the processing requirements of the AI service at the business logic level.
[0050] After acquiring the test input data, the management platform enters the test request data generation phase. Acting as a communication client, the management platform encapsulates the test input data into standardized communication messages according to the protocol specifications defined in the interface definition information. During message assembly, the management platform constructs a request header containing necessary control information and builds a request body containing the test input data according to a preset organizational structure, thus forming a complete AI service invocation instruction. This message generation mechanism ensures that the sent data packets can be correctly parsed by the AI service in the online environment in terms of both protocol format and data content.
[0051] After generating the test request data, the management platform executes the sending action. By identifying the access point of the AI service in the online runtime environment, the management platform uses network transmission protocols to distribute the assembled test request data to the specific address of the service. This step realizes the data delivery from the test management system to the actually deployed AI service instance, driving the service in the online environment to begin processing and calculating the test input data. Through this sending process, the management platform initiates a real-world environment call for the AI service to be released, providing the necessary operational path for obtaining performance data of the service in its actual running state.
[0052] Step 103: Receive the actual response data from the artificial intelligence service in response to the test request data.
[0053] After sending test request data to the AI service, the management platform enters the stage of listening for and receiving feedback data. The AI service deployed in the online operating environment, upon receiving the request message and completing its internal algorithmic logic, encapsulates the processing result according to the communication protocol specifications and generates a corresponding response message. The management platform, through the established network communication link, captures and receives the data packets fed back by the AI service in real time, ensuring complete access to the service's execution feedback in the real operating environment.
[0054] During the receiving process, the management platform identifies the message structure of the AI service feedback and extracts the actual response data reflecting the business processing results. This actual response data directly demonstrates the AI service's computing power under real hardware and software resource support for specific test inputs. The extracted information covers the service's business logic output and control information indicating the processing status, thus providing a raw basis for a comprehensive and objective evaluation of the AI service's functional performance.
[0055] The management platform records the actual response data it receives for further processing in subsequent logic. This actual response data serves as a real sample of the output from the online environment, recording the actual behavior of the AI service in its unreleased state. By receiving the actual response data, the management platform achieves a closed-loop communication process from issuing the call command to obtaining the execution result, providing the necessary comparison objects for ultimately verifying whether the AI service meets the technical standards for external release.
[0056] Step 104: When it is determined that the actual response data matches the expected verification data, update the status of the artificial intelligence service to the published status to open the external calling permission of the artificial intelligence service.
[0057] After acquiring the actual response data, the management platform initiates a compliance assessment of that data. The platform extracts core business metrics or outcome characteristics from the actual response data and logically verifies them against the expected verification data acquired during the configuration phase. This assessment process aims to confirm whether the AI service deployed in the online operating environment, under the current hardware and software configuration, can produce the expected correct output for the preset input. Through this data-level comparison, the management platform can quantitatively evaluate the service's functional completeness and operational stability.
[0058] When the management platform confirms that the actual response data matches the expected verification data according to preset matching rules, it determines that the AI service has passed the online environment authenticity verification. The management platform then executes a status change command for the service in the service management database, updating its lifecycle status from pending verification or pending release to released status. This status modification records that the service is now qualified to provide production services, completing the logical transition from the internal testing phase to the formal production phase.
[0059] After the status update is complete, the management platform adjusts the configuration to open external call permissions for the AI service. The management platform triggers an update to the access control policy of the underlying communication link via a command, removing access restrictions on the service in the online operating environment. This allows the previously closed service interface to receive access requests from the gateway system or other external callers. Through this automated release mechanism based on verification results, the management platform ensures that only service instances that have been verified in the production environment can enter the call chain, effectively guaranteeing the operational quality of the entire AI business system.
[0060] The online testing method for artificial intelligence services provided in this invention receives interface definition information and expected verification data for the online operating environment before the AI service is deployed and released, and generates test request data accordingly to initiate online calls. This achieves synchronization between test data and the operating environment, eliminating the dependence on offline static description files. By acquiring actual response data and matching it with expected verification data, the testing process can flexibly adapt to differences in the online environment and support real-time adjustment and verification of parameters. Finally, the matching results are used to drive the AI service status to be updated to the released state, constructing an integrated closed-loop process for testing and release. This effectively solves the technical defects of existing technologies, such as poor testing flexibility, inability to cover environmental differences, and fragmented testing and release processes due to reliance on offline files.
[0061] Furthermore, the management platform provides an online visual configuration interface as the user's entry point for interacting with the AI service management system. Through this interface, users configure the test tasks to be published, selecting the application programming interface (API) type corresponding to the AI service and determining whether the interface belongs to a resource request, data submission, or other specific communication mode. Subsequently, users sequentially set the content of the request header and body, defining the various fields required at the communication protocol and business payload levels. For each field, users can also set specific parameter field constraints, specifying the value type and required attributes, thereby transforming complex interface specifications into structured interface definition information recognizable by the management platform.
[0062] Within the same online visual configuration interface, the management platform guides users to input the corresponding expected output values for the predefined interface structure. These expected output values represent the business side's expectation of the AI service's results under ideal operating conditions, serving as expected verification data to measure the correctness of the service functionality. Users can specify the specific numerical values, string characteristics, or data organization formats that the service should return based on actual business logic within the interface. Through this direct interactive approach, the management platform obtains standard references corresponding to the interface definitions, providing the necessary data source for subsequent execution of automated comparison logic.
[0063] After obtaining the above information, the management platform performs an association mapping operation between the interface definition information and the expected verification data. The management platform logically binds specific request structures to specific verification standards, ensuring that each set of input definitions corresponds to a unique expected output benchmark. After completing the association, the management platform encapsulates and stores this combination as a test case template. This test case template, as a persistent configuration unit, records all the rules for online testing of the AI service, enabling the management platform to quickly reproduce the test environment and generate verification instructions based on the template in subsequent stages.
[0064] In addition, before initiating a test request, the management platform first retrieves pre-stored test case templates from the database. The platform performs in-depth analysis of the constraints of each parameter field recorded in the template, identifying the value type, length limit, and logical paradigm for each business field. Through this analysis, the management platform clarifies the specific information categories that users need to provide in the current testing phase and the format specifications they must follow, providing logical guidance for subsequent display on the front-end interface.
[0065] After obtaining the parsing results, the management platform dynamically renders the online visual configuration interface. Based on the constraint attributes of each parameter field, the management platform automatically generates matching parameter input controls on the interface, transforming abstract data definitions into concrete interactive elements. For numeric fields, the management platform generates input boxes with numeric validation functions, while for enumeration fields, it generates selection lists containing preset options. This interface generation method ensures that users can operate in an interactive environment highly aligned with business logic, reducing the possibility of inputting invalid data.
[0066] Users fill in specific numerical values or text content for this test using these generated parameter input controls. The management platform monitors and receives various information submitted by users through the parameter input controls in real time, and confirms these entered parameter values as the test input data for this online test. The management platform then temporarily stores this data in memory, preparing it for subsequent message assembly logic. Through this template-driven interaction method, the management platform achieves standardization and visualization of the test data acquisition process, ensuring that the acquired test input data fully complies with the technical requirements of the artificial intelligence service interface.
[0067] Furthermore, during the test instruction generation phase, the management platform first identifies the network location of the AI service in the online operating environment. By querying service deployment records or resource management system status information, the management platform obtains the service routing address of the AI service instance. This address represents the physical access point of the service in the production network or internal private network, ensuring that communication data sent by the management platform can accurately locate the service entity to be verified across the network layer. The obtained service routing address serves as a key parameter for subsequently establishing communication connections, providing a physical pointer for achieving end-to-end online testing.
[0068] The management platform initiates the data packet encapsulation operation based on the protocol specifications defined in the interface definition information. According to the protocol requirements, the management platform fills the test input data into a predetermined logical structure, constructing complete test request data including a request header and a request body. The request header is configured to carry metadata information of the control class, such as the request method type and expected content format, while the request body carries the test input payload, which is the core of the business logic. Through this protocol-compliant encapsulation method, the management platform ensures that the generated test request data has the versatility for cross-network transmission and parsing by artificial intelligence services.
[0069] After constructing the message structure, the management platform configures the acquired service routing address as the target address for the test request data. The management platform binds the logical business payload to the physical network path, ensuring that each generated test request data points to a specific service routing address, thus making the sending action clearly targeted. In this way, the management platform achieves a complete mapping from data preparation to network addressing, providing standardized data packet support for initiating real online calls to artificial intelligence services.
[0070] Before distributing test messages to the AI service, the management platform first initiates pre-defined rule verification logic to ensure that the data packets sent to the online environment are technically compliant. The management platform performs multi-dimensional legality checks on the acquired test input data, focusing on data type verification, i.e., verifying whether the input information content conforms to the type standards specified in the interface definition, such as numerical, character, or Boolean values. Simultaneously, the management platform reviews the structural integrity of the request content, performing necessary field integrity checks to confirm that all parameters marked as mandatory have been effectively filled. Through this pre-filtering mechanism, the management platform can preemptively exclude illegal requests caused by input specification issues, thereby avoiding invalid communication interactions that could lead to resource consumption or abnormal interference in the online operating environment.
[0071] After ensuring data compliance, the management platform further evaluates the completeness of the testing tasks. Through internal statistical logic, the platform obtains the total number of current test cases built for the current AI service in real time. To ensure the test conclusions are sufficiently representative and cover necessary business scenarios, the platform compares the total number of current test cases with the system's preset minimum test quantity threshold. This process aims to verify whether the scale of the initiated tests meets the minimum quality assessment standards required for external release, ensuring that the AI service undergoes sufficient sample validation before official release.
[0072] The management platform controls the flow of subsequent testing processes based on the feedback results of the aforementioned verification actions. Only when the preset rules pass verification and the total number of test cases reaches the minimum test quantity threshold will the management platform release the logical lock and trigger the subsequent step of sending test request data to the AI service. If any verification condition is not met, the management platform will suspend the current sending action, thus achieving mandatory access control over the online testing process. Through this logical constraint, the management platform ensures that only when the data is legal and the sample size is sufficient will a real call be initiated to the AI service in the online environment.
[0073] Furthermore, after acquiring the actual response data, the management platform displays the test input data and the received actual response data in parallel through an online visual configuration interface. This presentation method allows testers to intuitively observe the output of a specific input in a real-world AI service environment, providing transparent data support for result confirmation. The management platform parses backend messages into interface information, enabling centralized management of request payloads and service feedback within the same interactive dimension.
[0074] The management platform then performs automated logical comparisons to verify the content characteristics or organizational format of the actual response data. Based on the type of expected verification data, the platform determines whether the actual response data contains the predetermined business result information, or verifies whether the field organization of the actual response data conforms to the output specifications defined by the expected verification data. This dual-dimensional verification mechanism ensures that the AI service not only produces correct results in terms of business logic but also meets the parsing requirements of external systems at the data structure level.
[0075] When the management platform determines that the data matches the expected verification data, the system confirms that the actual response data matches the expected verification data. This matching conclusion is recorded in the current test log, signifying that the specific test case has successfully passed functional verification in the online operating environment. Based on this matching conclusion, the management platform locks in the current test feedback and uses it as valid data support for evaluating whether the entire artificial intelligence service is ready for release, thus completing the technical closed loop from data comparison to conclusion confirmation.
[0076] Before executing the release, the management platform first conducts a completeness review of the testing coverage of the AI service. By verifying the application interfaces described in the interface definition information, the platform confirms that each interface has completed the process of sending test request data and receiving the corresponding actual response data. This review logic ensures that every external functionality of the AI service has been verified through actual calls, preventing any interfaces from being missed in testing.
[0077] The management platform further summarizes and statistically analyzes the executed test cases, calculating the total number of matched test cases. The platform then quantitatively compares this statistical value with a preset release standard threshold to verify whether the overall performance of the AI service meets quality access requirements. After confirming that the number of matches meets the standard, the management platform automatically summarizes the data from the testing process and generates a test verification report containing test details and verification conclusions. This report serves as proof that the AI service is capable of being released, providing detailed audit data for subsequent final decisions.
[0078] Upon receiving the release confirmation instruction for the test verification report, the management platform initiates the status synchronization logic. The management platform performs an update operation in the system configuration, modifying the status identifier of the AI service and officially switching it from a pending verification state to a released state. Subsequently, the management platform triggers communication with the gateway system, registering the access path and status information of the AI service into the gateway system's routing table. Through this process, the management platform not only completes the logical change of the service status but also physically enables the routing of external access traffic, giving the AI service the fundamental conditions to officially provide business capabilities.
[0079] To further understand the solutions of the embodiments of the present invention, Figure 2 An interactive diagram illustrating an online testing method for artificial intelligence services is shown.
[0080] Throughout the entire lifecycle management of AI services, the management platform executes the operation process from offline testing to online deployment according to the following workflow: Step S1: After the management platform detects the business needs to be processed, it initiates a business request call to the artificial intelligence service in the offline environment.
[0081] Step S2: The artificial intelligence service receives the business request and executes the corresponding algorithm logic processing.
[0082] Step S3: The AI service feeds back the processing results to the offline environment and returns a completed response.
[0083] Step S4: The received response is analyzed and verified in the offline environment. If the analysis result is unsuccessful, the process is returned to perform optimization and adjustment. If the analysis result is successful, the AI service is confirmed to be ready for launch.
[0084] Step S5: The management platform receives the go-live instruction and deploys the verified artificial intelligence service to the online artificial intelligence system in the online operating environment.
[0085] Step S6: Online deployment and testing entry point trigger.
[0086] Once an AI capability has been validated and meets the deployment standards in the offline testing environment, it is deployed to the online operating environment. Users can access the capability testing and verification interface by logging into the AI system's application operation portal. This interface lists all deployed but not yet released AI capabilities (i.e., those awaiting testing), and users can select the target capability to initiate the online testing process.
[0087] Step S7: Select the interface to be tested.
[0088] After the user selects the AI capability to be tested, the system displays a list of all application programming interfaces (APIs) provided by that capability. The user then selects the specific API from the list to proceed to the next stage, the detailed configuration page.
[0089] Step S71: Define the interface template and parameters online.
[0090] The system provides an integrated web-based visual configuration interface with Postman-like functionality. Users can define call templates for selected API interfaces within this interface, including: selecting the request method (e.g., GET, POST), defining the structure of input parameters (e.g., Headers, Body, Params fields and constraints), and specifying the expected output parameter type (e.g., JSON, Text) and the expected output result (i.e., expected validation data).
[0091] Step S72: Save the test template.
[0092] After the user completes the interface template and parameter definition, a save operation is triggered. The web frontend sends a storage request to the system backend, persistently storing the API interface template information and related parameter field constraints as a reusable "test case template" in the system's metric template library.
[0093] Step S73: Dynamically generate the test call interface.
[0094] The user enters the API interface test call page. The system retrieves and extracts the test case template saved in step S71 from the template library, performs reverse parsing, and dynamically renders a matching web form interface based on the parsing results. This interface contains input controls corresponding to various parameter fields defined in the template, providing the user with an entry point to fill in specific test data.
[0095] Step S74: Input test data (Case definition).
[0096] In the test call interface generated in step S73, the user fills in the specific parameter values according to the prompts and constraints of each parameter field. The user needs to prepare multiple sets of test data to cover different test scenarios and boundary conditions, and each set of data constitutes an independent test case.
[0097] Step S75: Test case pre-verification.
[0098] Before officially initiating a test call, the system performs pre-validation on all test cases entered by the user. Validation rules include, but are not limited to: checking whether the parameter data types conform to the definition, whether required fields are filled in, whether there is duplication between test cases, and whether the total number of test cases defined for this interface has reached the preset minimum threshold. Only when all validations pass is the system allowed to proceed to the next step.
[0099] Step S76: Assemble and send the test request.
[0100] For each test case that passes the verification, the system dynamically assembles a complete test request message (including request header and request body) that conforms to HTTP and other protocol specifications based on the service routing address, request method and specific parameter values filled in by the user in the interface definition, and sends the request to the corresponding AI capability API endpoint in the online environment.
[0101] Steps S77 and S78: Receive the response and perform comparison and analysis.
[0102] The AI capability server processes the received test requests and returns the processing results (actual response data). After receiving the response, the system frontend displays both the input test data (Input) and the returned actual result (Output) on the interface. The system automatically compares the actual response data with the expected verification data defined in step S71 to determine whether the test case passes.
[0103] Step S79: Problem handling and iteration.
[0104] If the test case fails (the actual response does not meet expectations), the user needs to analyze the returned logs or results. If it is due to a defect in the AI capability itself, the user needs to take the system offline for modification and redeploy the development and deployment (i.e., return to the starting point of the process). If it is only due to an inaccurate test template definition or incorrect test data, the user can return to step S71 to modify the interface template, or return to step S74 to adjust the test input data, and then re-execute the subsequent test steps.
[0105] Step S8: Generate report and confirm.
[0106] When all test cases for the target API interface have been executed and the number of passing test cases meets the preset success threshold, the system determines that the interface has passed the test. For AI capabilities to be released, once all required API interfaces have passed the test, the system generates a complete test verification report for users to download and confirm. After confirming that the report is correct, the user uploads the report on the interface and triggers a release request.
[0107] Step S9: Complete the release.
[0108] Upon receiving the release confirmation command, the system automatically executes the release operation: officially updating the AI capability's status to "released" and registering it with the gateway system. Afterward, the AI capability is made available to external users or systems through the gateway for normal access.
[0109] Through the above steps S1 to S9, this embodiment constructs an online testing closed loop that is deeply coupled with the AI capability release process, realizing integrated management of the entire process from deployment, online test definition, flexible execution to final release.
[0110] The online testing method and apparatus for artificial intelligence services provided in this invention achieve the following technical effects by deeply embedding the testing process into the release process: First, it improves the consistency between the testing environment and the production environment, effectively reducing the risk of model deployment.
[0111] By initiating online calls after deploying the AI service to the online runtime environment, this ensures that the interface definition information and test input data directly affect real production resources. Compared to traditional solutions that rely on offline static description files, this solution can accurately cover the differences in hardware configuration, dependency library versions, and network policies of the online environment, avoiding deployment failures caused by environment incompatibility.
[0112] Second, it enhances the flexibility and immediacy of the testing process and shortens the model iteration cycle.
[0113] By directly receiving interface definitions and parameter adjustments through an online visual configuration interface, test cases can be constructed instantly and feedback can be provided within seconds. Users no longer need to repeatedly generate and upload description files using third-party tools; they can perform on-site parameter tuning and error correction based on the actual response data from online feedback, greatly improving the troubleshooting efficiency of artificial intelligence capabilities in the pre-release phase.
[0114] Third, an automated and standardized release access mechanism has been established to ensure the reliability of business quality.
[0115] By matching actual response data with expected verification data, the system automatically drives the service status from "under test" to "released." This closed-loop process establishes admission control logic based on real call results. Through mandatory use case number thresholds and interface coverage verification, it ensures that only AI services that have undergone rigorous verification in a production environment can be registered to the gateway system, thus laying a solid foundation for the stable operation of AI business systems.
[0116] Fourth, it reduces system maintenance costs and operational complexity.
[0117] This solution provides an integrated online verification system without intruding on business logic or requiring the deployment of additional third-party components. Through the reuse mechanism of the indicator template library and the dynamic rendering of the front-end interface, it significantly simplifies the collaboration process between the testing and operations teams, enabling efficient collaboration between algorithm development, model testing, and service release.
[0118] The following describes the online testing device for artificial intelligence services provided in the embodiments of the present invention. The online testing device for artificial intelligence services described below can be referred to in correspondence with the online testing method for artificial intelligence services described above.
[0119] This invention provides an online testing device for artificial intelligence services. See [link to relevant documentation]. Figure 3 ,include: The data receiving module 310 is used to receive interface definition information and expected verification data for the artificial intelligence service to be published, wherein the artificial intelligence service has been deployed in the operating environment; The request sending module 320 is used to generate test request data based on the interface definition information and the obtained test input data, and send the test request data to the artificial intelligence service; The response receiving module 330 is used to receive the actual response data fed back by the artificial intelligence service to the test request data; The status update module 340 is used to update the status of the artificial intelligence service to the published status when it is determined that the actual response data matches the expected verification data, so as to open the external calling permission of the artificial intelligence service.
[0120] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can invoke logical instructions in the memory 830 to execute an online testing method for an artificial intelligence service. This method includes: receiving interface definition information and expected verification data for an artificial intelligence service to be released, wherein the artificial intelligence service is deployed in a runtime environment; generating test request data based on the interface definition information and acquired test input data, and sending the test request data to the artificial intelligence service; receiving actual response data from the artificial intelligence service in response to the test request data; and updating the status of the artificial intelligence service to a released status when it is determined that the actual response data matches the expected verification data, thereby granting the artificial intelligence service external access permissions.
[0121] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0122] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the online testing method for artificial intelligence services provided by the above methods. The method includes: receiving interface definition information and expected verification data for an artificial intelligence service to be released, wherein the artificial intelligence service is deployed in a runtime environment; generating test request data based on the interface definition information and the acquired test input data, and sending the test request data to the artificial intelligence service; receiving actual response data from the artificial intelligence service in response to the test request data; and updating the status of the artificial intelligence service to a released status when it is determined that the actual response data matches the expected verification data, thereby opening the external calling permissions of the artificial intelligence service.
[0123] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements an online testing method for artificial intelligence services provided by the methods described above. This method includes: receiving interface definition information and expected verification data for an artificial intelligence service to be published, wherein the artificial intelligence service is deployed in a runtime environment; generating test request data based on the interface definition information and acquired test input data, and sending the test request data to the artificial intelligence service; receiving actual response data from the artificial intelligence service in response to the test request data; and, upon determining that the actual response data matches the expected verification data, updating the status of the artificial intelligence service to a published status to grant external access permissions to the artificial intelligence service.
[0124] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for online testing of artificial intelligence services, characterized in that, The method includes: Receive interface definition information and expected verification data for the artificial intelligence service to be published, wherein the artificial intelligence service is deployed in the runtime environment; Based on the interface definition information and the obtained test input data, test request data is generated and sent to the artificial intelligence service; Receive the actual response data from the artificial intelligence service in response to the test request data; When it is determined that the actual response data matches the expected verification data, the status of the artificial intelligence service is updated to the published status to grant external access to the artificial intelligence service.
2. The method according to claim 1, characterized in that, The process of receiving interface definition information and expected verification data for the AI service to be published includes: The system receives interface definition information set by the user for the artificial intelligence service through an online visual configuration interface. The interface definition information includes at least one of the following: application interface type, request header, request body, and parameter field constraints. Receive the expected output value input by the user in the online visual configuration interface for the interface definition information, as the expected verification data; The interface definition information is associated and mapped with the expected verification data to generate a corresponding test case template.
3. The method according to claim 2, characterized in that, Before generating test request data based on the interface definition information and the obtained test input data, the process also includes: The test case template is invoked, and the parameter field constraints are parsed to obtain the parsing result; Based on the analysis results, a parameter input control matching the test case template is generated in the online visual configuration interface; The parameter input control receives the parameter values entered by the user, which are then used as the test input data.
4. The method according to claim 1, characterized in that, Before sending the test request data to the artificial intelligence service, the method further includes: The test input data is validated according to preset rules, which include data type validation and required field integrity validation. The total number of current test cases for the AI service is counted, and it is determined whether the total number of current test cases has reached a preset minimum test quantity threshold. When the preset rule verification passes and the total number of current test cases reaches the minimum test quantity threshold, the step of sending the test request data to the artificial intelligence service is triggered.
5. The method according to claim 1 or 3, characterized in that, The process of generating test request data based on the interface definition information and the acquired test input data includes: Obtain the service routing address of the artificial intelligence service in the operating environment; According to the protocol specifications in the interface definition information, the test input data is encapsulated into test request data containing a request header and a request body, and the service routing address is used as the target address of the test request data.
6. The method according to claim 1, characterized in that, The step of determining that the actual response data matches the expected verification data includes: The test input data and the actual response data are displayed through an online visual configuration interface. Determine whether the content of the actual response data contains the expected verification data, or whether the structure of the actual response data conforms to the output specification defined by the expected verification data; If the judgment result is consistent, it is confirmed that the actual response data matches the expected verification data.
7. The method according to claim 1, characterized in that, The step of updating the status of the artificial intelligence service to a published status includes: Confirm that all application interfaces described based on the interface definition information have executed the steps of sending the test request data and receiving the actual response data; The number of test cases that match the AI service is counted, and the number of test cases is confirmed to have reached the preset release standard threshold. A test verification report is then generated. Upon receiving the release confirmation instruction, the system modifies the status identifier of the AI service in the system configuration, updates the status of the AI service to the released status, and registers the AI service with the gateway system.
8. An online testing device for artificial intelligence services, characterized in that, The device includes: The data receiving module is used to receive interface definition information and expected verification data for the artificial intelligence service to be released, wherein the artificial intelligence service has been deployed in the runtime environment; The request sending module is used to generate test request data based on the interface definition information and the obtained test input data, and send the test request data to the artificial intelligence service; The response receiving module is used to receive the actual response data fed back by the artificial intelligence service to the test request data; The status update module is used to update the status of the artificial intelligence service to the published status when it is determined that the actual response data matches the expected verification data, so as to open the external calling permission of the artificial intelligence service.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the online testing method for artificial intelligence services as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the online testing method for artificial intelligence services as described in any one of claims 1 to 7.