Automated test data observation method, system, and computer-readable storage medium
By adding metadata tags to business services and utilizing the dynamic calling mechanism of the capability registry, the problems of low efficiency and difficulty in balancing security and convenience in automated test data acquisition are solved, achieving efficient, secure and scalable data observation, suitable for complex enterprise-level application scenarios.
Patent Information
- Application Number
- CN202611392048.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-09
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies are inefficient in automating test data acquisition, struggle to balance security and convenience, have high development and maintenance costs, lack unified standards, and have poor scalability.
By adding predefined metadata tags to the target methods of business services, the capability discovery module automatically scans and generates capability location identifiers, and combines the capability registry center for dynamic invocation and security policy filtering, thus achieving automated, standardized, and secure data observation.
It achieves dual optimization of development costs and testing efficiency, builds a dual security system, breaks down barriers between different businesses and data sources, balances high performance and high scalability, and adapts to complex enterprise-level application scenarios.
Smart Images

Figure CN123178272A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer software testing technology, and specifically to an automated test data observation method, system, and computer-readable storage medium. Background Technology
[0002] With the widespread adoption of microservice architectures and distributed systems, the complexity of software systems has increased significantly. Verifying the correctness and consistency of data from various data sources (such as databases, caches, and message queues) during automated testing is a crucial step in ensuring software quality.
[0003] Currently, test data acquisition mainly relies on several traditional methods. The first method involves testers directly accessing the production or pre-production environment database and querying it by writing SQL statements. This method has rudimentary access control, making it difficult to achieve field-level access control, posing serious security risks such as data leakage and SQL injection, and failing to effectively observe data after complex business logic calculations.
[0004] The second approach involves developers writing dedicated data query interfaces, typically HTTP interfaces, for testing purposes. While this method is more secure than direct database access, it significantly increases development and maintenance costs. Whenever business requirements change or new test scenarios are added, the interface needs to be developed or modified, resulting in tight coupling between test logic and business logic, slow response times, and difficulty in establishing a unified interface standard.
[0005] The third approach is to indirectly obtain data by using API testing tools to call the system's exposed business interfaces. However, this approach is limited in that it can only cover the system's publicly available business functions and cannot delve into the system's internal workings to directly observe the underlying data status or middleware data. It falls short for scenarios requiring fine-grained data verification.
[0006] In summary, existing technologies for automated test data acquisition generally suffer from technical problems such as low efficiency, difficulty in balancing security and convenience, high development and maintenance costs, lack of unified standards, and poor scalability. Summary of the Invention
[0007] To address the technical problems of low efficiency, high cost, significant security risks, and inconsistent standards in existing automated test data acquisition technologies, this invention provides an automated test data observation method, system, and computer-readable storage medium.
[0008] This invention provides a computer-based automated test data observation method applied to a system including business services and a capability registry. The method includes: marking target methods in the business service with predefined metadata tags, the metadata tags containing security policies to limit the range of returned data fields; automatically scanning code resources within a preset range at a preset triggering time using a capability discovery module to discover target methods marked with the predefined metadata tags and extracting their metadata information; generating a capability location identifier for each discovered target method based on information uniquely identifying the target method; registering the extracted metadata and corresponding capability location identifiers to the capability registry for centralized management; receiving a call request containing the capability location identifier by a capability execution module deployed in the business service, and locating and executing the target method according to the capability location identifier through a dynamic invocation mechanism; and filtering the execution result before returning the execution result of the target method according to the security policy defined in the metadata tag corresponding to the target method. This method seamlessly integrates capability declaration, discovery, invocation, and security policies, achieving automated, standardized, and secure data observation.
[0009] Furthermore, the predefined metadata is marked as a custom annotation, and the security policy is the whitelist attribute of the returned field defined in the custom annotation; and the target method is a method of the data access layer. This design pushes the definition of the security policy down to the code closest to the data source, making the security rules naturally bound to the data acquisition logic, thus enhancing security and maintainability.
[0010] Optionally, the information uniquely identifying the target method includes the fully qualified class name, method name, and parameter type list of the target method; the capability locator is generated based on this information; and the dynamic invocation mechanism is a reflection mechanism. This approach can accurately locate the target method, naturally supports method overloading, and achieves flexible invocation through a specific dynamic invocation mechanism.
[0011] In one implementation, the method further includes: before forwarding the call request to the business service, the capability registration center performs at least one security verification on the call request, including: inter-service token verification, user information verification, rate limiting verification, and signature verification. This establishes a security barrier at the platform layer, pre-controlling the legitimacy and security of the call source, forming a defense-in-depth system with subsequent data filtering.
[0012] Furthermore, the capability discovery module and capability execution module are integrated into a software development kit deployed within the business service. This approach encapsulates the core functionality, greatly simplifying the access cost of the business service and promoting the dissemination and reuse of the solution across different services.
[0013] Optionally, the preset triggering time is when the business service starts. This fully automates the capability discovery and registration process, ensuring that the information in the capability registry center is always synchronized with the actual capabilities of the business service, without the need for manual intervention.
[0014] In one embodiment, the method further includes: caching all method objects corresponding to the discovered target methods at the preset triggering time; wherein the step of locating and executing the target method through a dynamic invocation mechanism includes: retrieving the method object from the cache according to the capability location identifier, and executing the method object. By caching the method object, time-consuming lookups are avoided on each invocation, significantly improving the system's execution performance.
[0015] Furthermore, the method also includes executing at least one interceptor associated with the target method before or after the target method is executed via a dynamic invocation mechanism to implement custom logic. This design provides powerful extensibility, allowing customized functions such as logging, performance monitoring, and parameter enhancement to be implemented without modifying the core code.
[0016] This invention also provides an automated test data observation system, comprising: at least one business service, a capability registration center, and a test platform; wherein, the business service includes, according to the annotation, and configured to: automatically scan code resources within a preset range at a preset triggering time to discover target methods annotated by the predefined metadata tags and extract their metadata information; generate a capability location identifier for each discovered target method based on information that can uniquely identify the target method; register the extracted metadata and the corresponding capability location identifier to the capability registration center; receive a call request containing the capability location identifier, and locate and execute the target method through a dynamic call mechanism according to the capability location identifier; and before returning the execution result of the target method, perform data filtering on the execution result according to the security policy defined in the metadata tag corresponding to the target method; The capability registration center is configured to receive and store capability metadata and capability location identifiers registered by the business service; The testing platform is configured to query the capability registry center for capabilities and generate a call request containing the capability location identifier.
[0017] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the aforementioned methods.
[0018] Compared with the prior art, the present invention has the following beneficial effects: First, it achieves a dual optimization of development cost and testing efficiency. Developers only need to add a metadata tag to publish any data method as an observable capability without writing additional interface code; testers can quickly find and call the required data through a unified platform, significantly improving the efficiency of test case writing and execution.
[0019] Secondly, a dual security system was constructed, ensuring both "controllable invocation" and "controllable data." Pre-emptive security verification at the capability registry center addresses the question of "who can invoke it"; data filtering based on security policies before returning results solves the question of "what can be returned." These two security mechanisms complement each other, ensuring convenient data access while effectively preventing the leakage of sensitive information.
[0020] Furthermore, this invention establishes a unified and reusable data observation standard through an automated capability discovery and registration mechanism and a standardized dynamic invocation method, breaking down barriers between different businesses and data sources. Simultaneously, based on designs such as caching and interceptors, it balances high performance and high scalability, enabling it to adapt to complex enterprise-level application scenarios. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating an automated test data observation method provided in an embodiment of the present invention.
[0022] Figure 2 This is a schematic diagram of the architecture of an automated test data observation system provided in an embodiment of the present invention.
[0023] In the diagram: 10 - Testing platform, 20 - Capability registration center, 30 - Business services, 31 - Software development kit. Detailed Implementation
[0024] This invention provides an automated, secure, and standardized data observation solution. The core idea is to construct an integrated "declaration-discovery-invocation" data observation chain by declaratively defining observable data capabilities and their security policies in business code, combined with a centralized capability management and dynamic invocation mechanism. This solution introduces several core concepts, such as: "predefined metadata tags," a mechanism for annotating methods in source code to declare that a method can be used as an observation capability and attach relevant configuration information; "capability location identifiers," a string that uniquely identifies a target method for precise location in subsequent invocation requests; and a "capability registry center," a centralized service or component for receiving, storing, and managing observation capability metadata reported from various business services. By tightly coupling capability declaration, discovery, registration, invocation, and security filtering, and establishing a dual security guarantee of "platform layer + service layer," this invention obtains various service data required for testing in a low-development-cost, high-efficiency, and standardized manner while ensuring data security.
[0025] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings. Figure 1 As shown, in one aspect of the present invention, an automated test data observation method is provided, which is applied to a system including a business service and a capability registry center. The method includes the following steps: S101. First, a target method in the business service is annotated with a predefined metadata tag, which embeds a security policy for limiting the range of returned data fields. S102. At a preset triggering time, the capability discovery module automatically scans code resources within a preset range to discover the annotated target method and extract its metadata information. S103. For each discovered target method, a capability location identifier is generated based on information that uniquely identifies the method. S104. The extracted metadata and the corresponding capability location identifier are registered with the capability registry center for centralized management. S105. A capability execution module deployed in the business service receives a call request containing the capability location identifier. S106. The target method is located and executed through a dynamic call mechanism. S107. Before returning the execution result, the execution result is filtered according to the security policy defined in the metadata tag corresponding to the target method. S108. The filtered result is returned. This process binds security policies to capability definitions, enabling control over the scope of data exposure from the source. Through automated discovery and registration mechanisms, it significantly reduces the cost of capability access, forming a secure and efficient technical closed loop.
[0026] Furthermore, as a preferred implementation, the predefined metadata tag can specifically be a custom annotation, such as the "@ObserveAbility" annotation defined in the Java language environment. The security policy is specifically a whitelist attribute of the returned field defined in this custom annotation. By annotating this annotation on methods in the data access layer, such as methods in the Data Access Object (DAO) layer or Mapper layer, the underlying data query capabilities can be directly exposed as observable capabilities. This design combines the declaration location of the data security policy with the definition location of the data source, requiring developers to clearly define the scope of data fields that can be exposed when defining a data query capability, thereby fundamentally avoiding the risk of sensitive data leakage due to capability exposure.
[0027] As a specific implementation, the information uniquely identifying the target method can include the fully qualified class name, method name, and parameter type list of the target method. Based on this information, a formatted string can be generated as a capability locator, for example, using the format "fully qualified class name#method name(parameter type list)". This format can accurately distinguish overloaded methods with the same name but different parameters, ensuring the uniqueness and accuracy of the call. Accordingly, the dynamic invocation mechanism can employ reflection. Upon receiving a call request, the system can parse the class, method, and parameter information based on the capability locator, and then dynamically invoke the target method through this dynamic invocation mechanism. This reflection-based dynamic invocation mechanism eliminates the need for hard-coding of call relationships during the coding phase, enabling flexible invocation of any registered capability and greatly enhancing the system's scalability.
[0028] To enhance the security of the entire data observation system, the method of this invention may also include a pre-emptive security verification step. Specifically, before forwarding the call request from the capability registry to the business service, the capability registry performs at least one security verification on the call request. These verifications can constitute a multi-layered defense system, including, for example: inter-service token verification, used to verify the legitimacy of the request source and prevent unauthorized services from initiating calls; user information verification, used to ensure that each call has a clear attribution, facilitating auditing and traceability; rate limiting verification, used to prevent malicious high-frequency calls from impacting business services; and signature verification, used to verify that the request parameters have not been tampered with during transmission. By setting these verification checkpoints at the platform layer, strict control over "who can call" is achieved, forming the first line of defense in the dual security guarantee of this invention.
[0029] In one implementation, to facilitate the integration and deployment of the invention's functionality across various business services, the capability discovery module and capability execution module can be integrated into a software development kit (SDK) deployed within the business service. This SSD is provided as a dependency package (such as a JAR file), and the business service only needs to include this dependency in its project and perform simple configuration to enable it. This design decouples core scanning, registration, invocation, and filtering logic from business code, reducing the invasiveness of business services. It also facilitates unified upgrades and maintenance of the core data observation functions, improving the maintainability and usability of the solution.
[0030] Specifically, the preset triggering time can be set to when the business service starts. When the business service starts, the software development kit integrated within it automatically executes the scanning and registration process. This design ensures that as soon as the service starts, all its data observation capabilities are immediately available and perceived by the capability registry center. This avoids the tediousness and delays of manual registration, achieves "plug and play" capabilities, and improves the collaborative efficiency of development and testing.
[0031] Considering the potential performance overhead of dynamic invocation mechanisms, especially reflection-based implementations, the method of this invention can further include a performance optimization step to improve response efficiency in high-frequency invocation scenarios. Specifically, at a preset triggering time (such as during service startup scanning), all method objects corresponding to discovered target methods can be pre-cached, for example, storing Java's Method objects in a hash table with capability locator identifiers as keys. Subsequently, when executing the target method via the dynamic invocation mechanism, the method object can be quickly retrieved from the cache based on the capability locator identifier and executed, thus avoiding the overhead of performing a reflection lookup for each invocation. This design significantly reduces the latency of a single invocation by trading space for time, ensuring the availability of data observation capabilities in performance-sensitive scenarios.
[0032] To further enhance the flexibility and scalability of the solution, the method of this invention can also introduce an interceptor mechanism. Specifically, before or after the target method is executed via a dynamic invocation mechanism, at least one interceptor associated with the target method can be executed to implement custom logic. For example, a logging interceptor can be defined to record request parameters before the call and return results and execution time after the call, thereby achieving complete link tracing of the capability call. Monitoring interceptors, parameter enhancement interceptors, etc., can also be defined. This design follows the open / closed principle, allowing the behavior of capability calls to be extended by inserting custom interceptors without modifying the core call logic, meeting diverse business needs such as logging, monitoring, and secondary verification.
[0033] Accordingly, the present invention also provides an automated test data observation system. For example... Figure 2 As shown, the system includes at least one business service 30, a capability registry 20, and a testing platform 10. The business service 30 deploys a software development kit 31 for implementing the method of this invention and includes annotations based on the aforementioned method, responsible for performing capability discovery, registration, execution, and filtering steps. The capability registry 20, as a central node, is configured to receive and store capability metadata and capability location identifiers registered by each business service 30, and to perform security verification and forwarding of call requests. The testing platform 10, as the front end for user interaction, is configured to query available observation capabilities from the capability registry 20 and generate call requests containing capability location identifiers to initiate tests. These three components work together to form a complete data observation ecosystem.
[0034] In addition, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement any of the aforementioned automated test data observation methods.
[0035] To more clearly illustrate the technical solution of this invention, in one embodiment, a data query method within a business service is marked with a predefined metadata tag. This tag explicitly defines a security policy to restrict the fields returned in the result. When the business service starts, an internal capability discovery module is triggered. It scans and identifies the marked method and extracts its metadata. Subsequently, the module generates a unique capability locator identifier based on the method's unique information (such as its class and method signature). Then, the extracted metadata and the generated capability locator identifier are sent and registered to a centralized capability registry for unified management. In subsequent testing, an external call request carrying this capability locator identifier is sent to the business service. Upon receiving the request, the service's internal capability execution module parses the capability locator identifier and locates and executes the corresponding target method through a dynamic invocation mechanism. After the method execution is complete, before returning the result to the caller, the capability execution module reads the predefined security policy in the metadata tag on the method and filters the returned data according to the policy, removing all fields not declared in the policy. Finally, the security-filtered data is returned to the caller. This embodiment fully demonstrates the core process of "annotation-discovery-registration-invocation-filtering", enabling the secure exposure of internal methods as observable capabilities without writing additional interface code.
[0036] In a more specific embodiment, the above basic scheme is refined. The predefined metadata marker is a custom annotation in Java, "@ObserveAbility," which is annotated on the method "queryUserOrders" in a data access layer (such as MyBatis' Mapper interface). This annotation contains a "whitelist" attribute, the value of which is a string array: {"id","userId","status","amount"}, which is a specific implementation of the security policy. The preset triggering time is when the business service starts. At this time, the integrated software development kit scans the annotation and generates an ability locator identifier based on the method's fully qualified class name "com.example.dao.OrderDao", method name "queryUserOrders", and parameter type "java.lang.Long", with the string form "com.example.dao.OrderDao#queryUserOrders(java.lang.Long)". The dynamic invocation mechanism is Java's reflection mechanism. When a request containing this identifier is received, the software development kit (SDK) uses this dynamic invocation mechanism to locate and invoke the "queryUserOrders" method of the "OrderDao" instance. This specific implementation leverages mature annotation and reflection technologies in the Java ecosystem, making the solution easy to understand and implement, and naturally supports method overloading by locating identifiers with precision down to the parameter level.
[0037] To effectively control invocation behavior, based on the above embodiments, the capability registry center does not immediately forward invocation requests received from the testing platform. Instead, it first performs a series of strict security checks. First, it performs inter-service token verification by parsing the authentication token in the request header to verify its signature and validity period, ensuring the request originates from a registered and legitimate testing platform, thus blocking all requests from illegal sources. Next, it performs user information verification, verifying the user identity information carried in the request to ensure each call can be traced back to the specific operator, meeting auditing requirements. Then, it performs rate limiting verification, checking whether the call frequency exceeds a preset threshold (e.g., no more than 100 times per minute) based on the capability location identifier and the call source IP. If it does, the request is directly rejected to prevent malicious high-frequency calls from crippling business services. Finally, it performs signature verification, sorting, concatenating, and calculating a hash signature for all request parameters according to agreed rules, comparing it with the signature carried in the request to prevent malicious tampering of parameters during network transmission. Only after all verifications pass will the request be forwarded to the target business service. This series of checks constitutes the core of "controllable calls," ensuring that only legitimate users can reach the business system through legitimate channels and at a reasonable frequency.
[0038] To facilitate integration and deployment, in one implementation, the capability discovery module and capability execution module, along with related metadata extraction, registration, and filtering logic, are all encapsulated in a unified software development kit (SDK) 31. This SSD, as a standard Java library (JAR file), can be easily included as a project dependency by any business service 30 using build tools such as Maven or Gradle. Developers only need to add the SSD's dependency coordinates to the project's configuration file and specify the package paths to be scanned to complete the integration. This approach significantly reduces integration costs; developers do not need to worry about the complexity of the underlying implementation and can focus solely on adding annotations to business methods. Simultaneously, the unified encapsulation of the SSD ensures that data observation behavior and standards are consistent across all business services, facilitating unified governance and upgrades.
[0039] Considering the potential performance overhead of dynamic invocation mechanisms in searching for method metadata at runtime, this solution incorporates targeted optimizations. When the business service starts, the capability discovery module scans and identifies all target methods annotated with "@ObserveAbility". In addition to extracting metadata, it also retrieves the "java.lang.reflect.Method" object corresponding to each target method via reflection. These Method objects are then cached in an in-memory ConcurrentHashMap structure, where the key is the capability locator identifier corresponding to the method, and the value is the Method object itself. When the capability execution module receives a call request, it no longer needs to perform real-time reflection lookup using the class name and method name. Instead, it directly uses the capability locator identifier in the request as the key to retrieve the pre-cached Method object from the ConcurrentHashMap in O(1) time complexity. This caching mechanism significantly reduces the performance overhead of reflection lookup, maintaining low call latency even in high-concurrency scenarios.
[0040] To further enhance the flexibility and scalability of the solution, the software development kit (SDK) also provides a pluggable interceptor mechanism. Developers can implement an "AbilityInterceptor" interface, which defines lifecycle methods such as "beforeInvoke," "afterInvoke," and "onError." Then, one or more interceptor implementation classes can be registered with the SSD. When the capability execution module processes a call request, before actually executing the target method via the dynamic invocation mechanism, the `beforeInvoke` methods of all registered interceptors are called sequentially; after successful method execution, the `afterInvoke` methods are called sequentially. For example, a logging interceptor can be implemented to record detailed request parameters in `beforeInvoke` and return results and method execution time in `afterInvoke`, thus easily achieving chain tracing and performance monitoring of all capability calls without writing repetitive logging code in each business method. This design allows non-core cross-cutting concerns (such as logging, monitoring, and secondary permission verification) to be completely separated from core business logic, improving code maintainability and scalability.
[0041] The following will be combined with the appendix Figure 1 and attached Figure 2 A preferred complete embodiment of the present invention will be described below, which incorporates all the foregoing technical features. For example... Figure 2As shown, the entire system consists of a testing platform 10, a capability registration center 20, and multiple business services 30, each of which integrates a software development kit 31. The entire workflow is as follows: Figure 1 As shown, and further specified as follows: First, during the development phase, a developer added the "@ObserveAbility" annotation to a DAO layer method used to query user orders in an order business service 30, and set the "whitelist" attribute to only allow the return of non-sensitive fields such as order ID, user ID, status, and amount.
[0042] When the order service 30 starts, its internal software development kit 31 is activated. The capability discovery module of the software development kit automatically scans the preset package paths (step S102) and discovers the annotated method. It then extracts the metadata of the method and generates a unique capability locator, such as "com.example.dao.OrderDao#queryUserOrders(java.lang.Long)". At the same time, the software development kit caches the `Method` object corresponding to the method in a "ConcurrentHashMap" in memory for efficient subsequent calls. Finally, the software development kit reports the information containing the capability locator and metadata (including whitelist policy) to the capability registration center 20 for registration (steps S103, S104).
[0043] During the testing phase, a tester browsed and selected the "Query User Orders" capability on test platform 10 and entered the user ID to be tested. Test platform 10 then generated a call request and sent it to capability registry center 20 (step S105). Upon receiving the request, capability registry center 20 immediately initiated its multi-layered security verification mechanism, sequentially checking the request's source token, user information, call frequency, and parameter signature. Only after all verifications passed would capability registry center 20 forward the request to the internal interface exposed by the software development kit of order business service 30.
[0044] After receiving the request, the software development kit (SDK) of the order business service 30 initiates processing through its capability execution module. First, it triggers the "beforeInvoke" method in the registered interceptor chain; for example, a log interceptor will record the request parameters at this point. Next, it parses the capability location identifier from the request and uses this identifier to directly retrieve the corresponding Method object from the memory cache. Then, it uses Java reflection to call the Method object with the parameters provided in the request, thereby performing the actual database query operation (step S106). After the method completes execution and returns a list of Order objects containing complete order information, the SSD triggers the afterInvoke method of the interceptor chain again, recording the execution time. Before serializing the result into JSON and returning it, the most crucial step occurs: the SSD, based on the metadata stored during registration, finds the security policy associated with the capability and filters the returned Order object list (step S107), removing all fields not in the whitelist (such as sensitive information like shipping address and contact number). Finally, the security-filtered data is returned to the capability registry 20 and ultimately presented to the testers on the test platform 10 (step S108). This complete embodiment demonstrates how all the technical features work together to achieve an end-to-end closed loop from capability declaration, automatic discovery, secure invocation to data filtering, efficiently and securely solving the data observation challenge in automated testing.
[0045] Although the present invention has been described in detail through the preferred embodiments described above, those skilled in the art should understand that various modifications and variations can be made to the above embodiments without departing from the spirit and scope of the present invention. For example, predefined metadata tags are not limited to Java annotations, but can also be Python decorators or C# features; dynamic invocation mechanisms are not limited to Java reflection, but can also employ bytecode generation technology or method handles; security policies can employ blacklists or more complex role-based access control policies in addition to whitelists.
Claims
1. An automated test data observation method, characterized in that, It is applied to systems including business services and capability registration centers, and the method includes: The target method of the business service is marked with predefined metadata tags, which contain security policies for limiting the range of returned data fields. At a preset triggering time, the capability discovery module automatically scans code resources within a preset range to discover target methods marked by the metadata tags and extract their metadata information; For each discovered target method, a capability location identifier is generated based on information that can uniquely identify the target method; The extracted metadata information and corresponding capability location identifiers are registered with the capability registration center for centralized management. The capability execution module deployed in the business service receives a call request containing a capability location identifier, and locates and executes the target method through a dynamic call mechanism based on the capability location identifier. Before returning the execution result of the target method, the execution result is filtered according to the security policy defined in the metadata tag corresponding to the target method.
2. The method according to claim 1, characterized in that, The predefined metadata marker is a custom annotation, the security policy is the whitelist attribute of the return field defined in the custom annotation, and the target method is a method of the data access layer.
3. The method according to claim 1, characterized in that, The information that uniquely identifies the target method includes the fully qualified class name, method name, and parameter type list of the target method; the capability location identifier is a capability location key generated based on the information; and the dynamic invocation mechanism is a reflection mechanism.
4. The method according to claim 1, characterized in that, The method further includes: Before forwarding the call request to the business service, the capability registration center performs at least one security check on the call request, including: inter-service token verification, user information verification, rate limiting verification, and signature verification.
5. The method according to claim 1, characterized in that, The capability discovery module and the capability execution module are integrated into a software development kit deployed in the business service.
6. The method according to claim 1, characterized in that, The preset triggering time is when the service starts.
7. The method according to claim 1, characterized in that, The method further includes: At the preset triggering time, cache the method objects corresponding to all discovered target methods; The step of locating and executing the target method through a dynamic invocation mechanism includes: retrieving the method object from the cache based on the capability location identifier, and executing the method object.
8. The method according to claim 1, characterized in that, The method further includes: Before or after the target method is executed via a dynamic invocation mechanism, at least one interceptor associated with the target method is executed to implement custom logic.
9. An automated test data observation system, characterized in that, include: It includes at least one business service, one capability registry center, and one testing platform; among which, The service is configured to: automatically scan code resources within a preset range at a preset triggering time to discover target methods marked with predefined metadata tags and extract their metadata information; generate a capability location identifier for each discovered target method based on information that can uniquely identify the target method; register the extracted metadata and the corresponding capability location identifier to the capability registration center; receive a call request containing the capability location identifier, and locate and execute the target method through a dynamic call mechanism based on the capability location identifier; and filter the execution result before returning the execution result of the target method according to the security policy defined in the metadata tag corresponding to the target method. The capability registration center is configured to receive and store capability metadata and capability location identifiers registered by the business service; The testing platform is configured to query the capability registry center for capabilities and generate a call request containing the capability location identifier.
10. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-8.
