Interface mock-proxy data method for improving research and development efficiency

Through steps such as configuring information and requesting gateways, dynamic generation and processing of interface mock-proxy data is realized, which solves the problem that existing technology is difficult to build complex and variable data scenarios and real-time data requirements, and improves the authenticity and execution efficiency of the test environment.

CN119829460APending Publication Date: 2025-04-15BEIJING CHESHANGHUI SOFTWARE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510045645.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing data simulation methods have limitations in building complex and changeable data scenarios and real-time data requirements, which are difficult to meet the diverse needs of modern software testing, resulting in deviations from the test environment and the real environment.

Method used

Through the steps of configuration information, request gateway, judgment processing, data steering, dynamic data generation and data processing, dynamic generation and processing of interface mock-proxy data is realized, supporting real-time generation of dynamic data and adapting to complex and changeable test scenarios.

Benefits of technology

It improves the authenticity and pertinence of the test environment, enhances the comprehensiveness and accuracy of the test, reduces the maintenance cost of the test environment, and seamlessly integrates automated testing tools to improve the test execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829460A_ABST
    Figure CN119829460A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of Mock, and discloses an interface mock-proxy data method for improving research and development efficiency, which comprises the following steps of: A1, configuring information; a2, a gateway is requested; a3, judging and processing; a4, data steering; a5, generating dynamic data; and A6, data processing. According to the test solution, the user is endowed with high flexibility, the user is allowed to easily customize simulation interface behaviors according to specific test requirements, so that the authenticity and pertinence of a test environment are ensured, the system supports real-time generation of dynamic data and perfectly adapts to various complex and changeable test scenes, and the test efficiency is improved. According to the scheme, the test comprehensiveness and accuracy are greatly enhanced, the maintenance cost of the test environment is remarkably reduced by providing a visual visual interface and rich configuration options, in addition, the scheme seamlessly integrates automatic test tools, and the test execution efficiency is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of Mock technology, and in particular is a method for improving interface mock-proxy data for improving research and development efficiency. Background Art

[0002] The interface mock method is a key technology in the field of software development. It gives developers the ability to simulate interface behavior so as to test and develop between different components of an application. This technology is particularly suitable for highly customizable dynamic data interfaces, and it requires developers to have a wide range of technical background knowledge.

[0003] First, you need to have a deep understanding of the HTTP protocol and its working principles, which is the basis for implementing interface mocks. Secondly, RESTful API design principles are also indispensable. They guide how to build clear and consistent interfaces. In addition, database operations and data generation techniques are the key to simulating a real data environment.

[0004] At the same time, routing and request processing technology determines how the mock interface responds to various requests, while response control technology allows developers to customize the returned data and status code. Finally, integration and automation technology can ensure that the mock interface can be seamlessly integrated into the existing development and testing process, improving the overall development efficiency. It requires writing a lot of code, which is time-consuming and labor-intensive, has poor maintainability, is not easy to update and modify, is not suitable for non-developers, and testers need a technical background.

[0005] Existing data simulation methods have obvious limitations. Their simulation capabilities are limited, and it is difficult to build complex and changing data scenarios. At the same time, the lack of a dynamic data generation mechanism cannot effectively respond to real-time data needs, resulting in a deviation between the test environment and the real environment. In addition, these methods are not highly customizable and are difficult to meet specific testing requirements, limiting the accuracy and effectiveness of the test. Therefore, it is urgent to develop new data simulation technologies to enhance simulation capabilities and meet the diverse needs of modern software testing, so they need to be improved and optimized. Summary of the invention

[0006] The purpose of the present invention is to provide a method for interface mock-proxy data to improve research and development efficiency, so as to solve the problems raised in the above background technology.

[0007] In order to achieve the above object, the present invention provides the following technical solution: a method for improving the interface mock-proxy data of R&D efficiency, the steps of the method are:

[0008] A1, Configuration information: configure related projects and information in advance;

[0009] A2, request gateway: request the gateway of the mock service through one of the third-party server and front-end js;

[0010] A3, judgment and processing: The gateway of the mock service judges and processes the requests from the third-party server and the front-end JS according to the situation;

[0011] A4, Data steering: According to the specific custom configuration, the core module of the mock service directs the data flow to the data generation module;

[0012] A5, dynamic data generation: the data generation module generates dynamic data by specifying fixed data;

[0013] A6, Data processing: Dynamically process the response return through customized configuration.

[0014] Preferably, there are four situations judged in A3, namely: unconfigured, configured without mock, configured with a third-party mock service, and configured as self-mock.

[0015] Preferably, when it is determined that the interface is not configured or is not configured as mock, the real interface is directly requested to process the response.

[0016] Preferably, when it is determined that a third-party mock service is configured, the response is processed by forwarding the request to the third-party mock service.

[0017] Preferably, when it is determined that the configuration is a self-mock, the response will be processed by executing the mock service core module.

[0018] Preferably, the customized configurations in A4 are different, namely dynamic parameters and specified parameters.

[0019] Preferably, the mock service is a virtual service used to simulate API or service behavior.

[0020] Preferably, interface: a means for communication and data exchange between systems.

[0021] The beneficial effects of the present invention are as follows:

[0022] The present invention provides users with high flexibility by making the test solution easy to customize the simulated interface behavior according to specific test requirements, thereby ensuring the authenticity and pertinence of the test environment. The system supports real-time generation of dynamic data, perfectly adapting to various complex and changeable test scenarios, greatly enhancing the comprehensiveness and accuracy of the test. By providing an intuitive visual interface and rich configuration options, the maintenance cost of the test environment is significantly reduced. In addition, the solution seamlessly integrates automated testing tools, effectively improving the efficiency of test execution. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a schematic diagram of the mock process of the present invention;

[0024] Figure 2 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] like Figure 1 to Figure 2 As shown, an embodiment of the present invention provides a method for improving the interface mock-proxy data of R&D efficiency, and the steps of the method are:

[0027] A1, Configuration information: configure related projects and information in advance;

[0028] A2, request gateway: request the gateway of the mock service through one of the third-party server and front-end js;

[0029] A3, judgment and processing: The gateway of the mock service judges and processes the requests from the third-party server and the front-end JS according to the situation;

[0030] A4, Data steering: According to the specific custom configuration, the core module of the mock service directs the data flow to the data generation module;

[0031] A5, dynamic data generation: the data generation module generates dynamic data by specifying fixed data;

[0032] A6, Data processing: Dynamically process the response return through customized configuration.

[0033] This test solution gives users a high degree of flexibility, allowing users to easily customize the behavior of simulated interfaces according to specific test requirements, thereby ensuring the authenticity and pertinence of the test environment. The system supports real-time generation of dynamic data, perfectly adapting to various complex and changing test scenarios, greatly enhancing the comprehensiveness and accuracy of the test. By providing an intuitive visual interface and rich configuration options, the maintenance cost of the test environment is significantly reduced. In addition, the solution seamlessly integrates automated testing tools, effectively improving the efficiency of test execution.

[0034] There are four situations judged in A3, namely: not configured, configured without mock, configured with a third-party mock service, and configured as self-mock.

[0035] When not configured, there is a lack of preset behavior. If no mock is configured, the real interface is called directly. If a third-party mock service is configured, the external mock service is called. If it is configured as its own mock, the built-in mock function is used. These judgments ensure the flexibility and controllability of the test environment, improve the adaptability and accuracy of the test, and reduce the dependence on the real service, thereby improving the test efficiency and quality.

[0036] Among them, when it is determined that it is not configured or configured without mock, the real interface is directly requested to process the response.

[0037] If it is determined that there is no configuration or the configuration is not mocked, the system will directly request the real interface and process the returned response. This approach ensures that in the absence of mock configuration, the test can directly verify the behavior and response of the real interface, ensuring the comprehensiveness and authenticity of the test. At the same time, this also provides developers with a way to quickly verify the interface function, which helps to improve development and testing efficiency.

[0038] If it is determined that a third-party mock service is configured, the response is processed by forwarding the request to the third-party mock service.

[0039] If a third-party mock service is configured, the system will forward the request to the specified third-party mock service, and the service will process the response. This approach allows the test to be performed independently of the real interface, improving the flexibility and controllability of the test. At the same time, the third-party mock service can be used to simulate complex interface behaviors and responses, enhancing the comprehensiveness and accuracy of the test.

[0040] Among them, when it is determined that the configuration is its own mock, the response will be processed by executing the mock service core module.

[0041] When it is determined that the configuration is self-mock, the system will call the built-in mock service core module to process the request and generate a response. This method does not rely on external services, which improves the independence and stability of the test. Through the built-in mock service, various interface behaviors and responses can be flexibly simulated to meet diverse testing needs, while reducing the complexity and maintenance cost of the test environment.

[0042] Among them, the customized configurations in A4 are different, namely dynamic parameters and specified parameters.

[0043] Customized configurations are divided into dynamic parameters and specified parameters. Dynamic parameters enhance the flexibility of testing and adapt to changing test scenarios; specified parameters ensure the accuracy of testing and meet specific needs. The combination of the two improves the comprehensiveness and efficiency of testing.

[0044] Among them, mock service: a virtual service used to simulate API or service behavior.

[0045] It can perform tests without relying on real services, improve the independence and controllability of tests, ensure the stability and accuracy of test results, and reduce the dependence of tests on the external environment.

[0046] Among them, interface: the way for communication and data exchange between systems.

[0047] The interface is a bridge for communication and data exchange between systems. It defines the rules and methods for interaction between different systems. The interface enables systems to connect and transfer information, thereby achieving functional integration and data sharing, and improving the system's collaborative working ability and overall efficiency.

[0048] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0049] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for improving R&D efficiency by mock-proxying interface data, characterized in that: The steps of this method are: A1, Configuration information: configure related projects and information in advance; A2, request gateway: request the gateway of the mock service through one of the third-party server and front-end js; A3, judgment and processing: The gateway of the mock service judges and processes the requests from the third-party server and the front-end JS according to the situation; A4, Data steering: According to the specific custom configuration, the core module of the mock service directs the data flow to the data generation module; A5, dynamic data generation: the data generation module generates dynamic data by specifying fixed data; A6, Data processing: Dynamically process the response return through customized configuration.

2. According to claim 1, a method for improving R&D efficiency through interface mock-proxy data, characterized in that: There are four situations judged in A3, namely: not configured, configured without mock, configured with a third-party mock service, and configured as self-mock.

3. The method for improving R&D efficiency through interface mock-proxy data according to claim 2, characterized in that: If it is determined that the interface is not configured or not mocked, the real interface is directly requested to process the response.

4. The method for improving R&D efficiency through interface mock-proxy data according to claim 2, characterized in that: If it is determined that a third-party mock service is configured, the response is processed by forwarding the request to the third-party mock service.

5. The method for interface mock-proxy data for improving R&D efficiency according to claim 2, characterized in that: If it is determined that the configuration is its own mock, the response will be processed by executing the mock service core module.

6. The method for interface mock-proxy data for improving R&D efficiency according to claim 1, characterized in that: The customized configurations in A4 are different, namely dynamic parameters and specified parameters.

7. The method for interface mock-proxy data for improving R&D efficiency according to claim 1, characterized in that: The mock service is a virtual service used to simulate the behavior of an API or service.