Service data interface method based on AIGC Mock
By receiving Vue static pages and Excel business data files input from the front end, and using AIGC technology to generate Mock business data and interfaces, the problem of data docking delay in software development is solved, and the effect of rapid development of business interfaces and improving testing reliability is achieved.
Patent Information
- Application Number
- CN202411544017.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-28
AI Technical Summary
During the software development process, data docking at the front and back ends is often subject to inadequate provision of business data or unclear requirements, resulting in closed loops in testing logic and hindering development progress.
By receiving Vue static pages and Excel business data files input from the front end, AIGC technology is used to generate Mock business data, Mock business interfaces and table data, and based on these data, JSON data interface is generated and returned to the front end.
It significantly reduces the time for manual entry and configuration, ensures that the generated data is true and accurate, improves the reliability of testing, reduces data inconsistency problems caused by manual operations, and thus accelerates the overall progress of the project.
Smart Images

Figure CN119718303A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method based on AIGC Mock business data interface. Background Art
[0002] With the continuous development of science and technology, there are more and more ways to process data. In the process of software development, the data connection between the front-end and the back-end is often subject to the untimely provision of business data or unclear requirements, which leads to the closure of the test logic loop and the obstruction of development progress. Existing solutions rely on manual entry of business test data, the use of third-party tools to simulate data, or relying on unified defined development documents for interface development, but these methods have problems such as inauthentic data, frequent interface changes, and asynchronous development speed. In the process of interface development, data connection is usually based on the interface. The interface document can be agreed in advance, and the front-end and back-end jointly develop and connect the interface according to the interface document. However, due to the unclear requirements in the development process, the interface often changes frequently, and the frequent changes of the interface will slow down the entire interface development process.
[0003] Therefore, how to quickly develop a business interface has become a technical problem that technical personnel in this field need to solve urgently. Summary of the invention
[0004] Based on the above problems, the present application provides a method based on AIGC Mock business data interface to quickly develop business interfaces.
[0005] The present application provides a method based on the AIGC Mock service data interface, the method comprising:
[0006] Receive a Vue static page and an Excel business data file input by a front end, wherein the Vue static page includes business indicators and field definitions corresponding to the business indicators, and the Excel data file includes business indicators and specific business values corresponding to the business indicators;
[0007] Generate Mock business data, Mock business interface and table data corresponding to the Mock business interface based on the Vue static page and the Excel business data file using AIGC;
[0008] Generate a JSON data interface based on the Mock business data, the table data corresponding to the Mock business interface, and the Mock business interface;
[0009] Return the JSON data interface to the front end.
[0010] In a possible implementation, the generating of Mock business data, Mock business interface and table data corresponding to the Mock business interface based on the Vue static page and the Excel business data file by using AIGC includes:
[0011] Generate contextual business data based on the business indicators and field definitions in the Vue static page using AIGC, and generate first Mock business data based on the contextual business data;
[0012] Generate numerical result data based on the business indicators and specific business values in the Excel business data file using AIGC, and generate second Mock business data based on the numerical result data;
[0013] A Mock business interface is generated based on the business data, the field definition of the business data and the specific business value.
[0014] Generate mock service data based on the first mock service data and the second mock service data;
[0015] Table data is generated based on the numerical result data.
[0016] In a possible implementation, the method further includes:
[0017] Receive the test result data returned by the front end, wherein the test result data is the data obtained by the front end through interface testing based on the JSON data interface;
[0018] The JSON data interface is adjusted according to the indication of the test result data.
[0019] The present application also provides a device based on the AIGC Mock service data interface, the device comprising:
[0020] A receiving module, used to receive a Vue static page and an Excel business data file input by a front end, wherein the Vue static page includes business indicators and field definitions corresponding to the business indicators, and the Excel data file includes business indicators and specific business values corresponding to the business indicators;
[0021] The first generation module is used to generate Mock business data, Mock business interface and table data corresponding to the Mock business interface based on the Vue static page and the Excel business data file by using AIGC;
[0022] A second generating module is used to generate a JSON data interface based on the Mock business data, the table data corresponding to the Mock business interface, and the Mock business interface;
[0023] The sending module is used to return the JSON data interface to the front end.
[0024] In a possible implementation manner, the first generating module is specifically configured to:
[0025] Generate contextual business data based on the business indicators and field definitions in the Vue static page using AIGC, and generate first Mock business data based on the contextual business data;
[0026] Generate numerical result data based on the business indicators and specific business values in the Excel business data file using AIGC, and generate second Mock business data based on the numerical result data;
[0027] A Mock business interface is generated based on the business data, the field definition of the business data and the specific business value.
[0028] Generate mock service data based on the first mock service data and the second mock service data;
[0029] Table data is generated based on the numerical result data.
[0030] In a possible implementation, the device further includes a testing module, and the testing module is specifically configured to:
[0031] Receive the test result data returned by the front end, wherein the test result data is the data obtained by the front end through interface testing based on the JSON data interface;
[0032] The JSON data interface is adjusted according to the indication of the test result data.
[0033] The present application also provides an electronic device, the electronic device comprising a processor and a memory:
[0034] The memory is used to store a computer program and transmit the computer program to the processor;
[0035] The processor is used to execute the steps of the above-mentioned method based on the AIGC Mock service data interface according to the instructions in the computer program.
[0036] The present application also provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by an electronic device, the steps of the above-mentioned method based on the AIGC Mock business data interface are implemented.
[0037] Compared with the prior art, this application has the following beneficial effects:
[0038] The method provided in this application receives the Vue static page and Excel business data file input by the front end, and uses AIGC technology to automatically generate Mock data and interfaces, which significantly reduces the time for manual entry and configuration. This process enables developers to quickly obtain the required data and interfaces, avoiding delays in development progress due to waiting for data to be provided, thereby speeding up the overall advancement of the project. In the prior art, manual entry of business test data is prone to errors, and the authenticity and consistency of the data are difficult to guarantee. However, this application automatically generates Mock data to ensure that the generated data is true and accurate, reducing the problem of data inconsistency caused by manual operation. This mechanism improves the reliability of the test and makes subsequent test results more valuable for reference. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 A method flow chart based on the AIGC Mock business data interface provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of the structure of a device based on the AIGC Mock service data interface provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] As described above, in the process of interface development, data docking usually relies on interfaces. A unified interface document can be agreed upon in advance, and the front-end and back-end jointly develop and dock interfaces according to the interface document. However, due to unclear requirements during the development process, frequent changes in interfaces often occur, which slows down the entire interface development process.
[0043] Therefore, how to quickly develop a business interface has become a technical problem that technical personnel in this field need to solve urgently.
[0044] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] It is understandable that the method provided in the present application can be applied to a processing device, which is a processing device that can receive Vue static pages and Excel business data files input by the front end, for example, a terminal device or server that can return a JSON data interface to the front end. The method provided in the present application can be executed independently by a terminal device or a server, or it can be applied to a network scenario in which a terminal device and a server communicate, and is executed in cooperation with a terminal device and a server. Among them, the terminal device can be a computer, a mobile phone or other device. The server can be understood as an application server or a web server. In actual deployment, the server can be a stand-alone server or a cluster server.
[0046] Figure 1 A method flow chart based on the AIGC Mock business data interface provided in this application, the method comprising the following steps:
[0047] S101: Receive Vue static pages and Excel business data files input by the front end.
[0048] The processing device can receive Vue static pages and Excel business data files input by the front end. The Vue static page can include business indicators and field definitions corresponding to the business indicators, and the Excel data file can include business indicators and specific business values corresponding to the business indicators.
[0049] In the software development process, the effective connection between the front-end page and the back-end data is crucial. The first step of this application is to receive the Vue static page and Excel business data file input by the front-end. The Vue static page usually contains the framework of business logic, user interface components and dynamic data display. By parsing this Vue page, the system can extract the business indicators and field definitions, such as specific user information, sales data or other key business indicators. At the same time, the Excel business data file contains specific business values corresponding to these business indicators, such as sales, visits, number of user registrations, etc. This process ensures the consistency of business logic between the front-end and the back-end.
[0050] When receiving these files, the system needs to have a good data verification mechanism to ensure that the input file format is correct and the content is complete. For example, if the necessary business values are missing or the field definitions do not match in the Excel file, the system should be able to promptly feedback the error information to the front-end developer to avoid confusion in the subsequent data processing. In addition, in order to ensure the security and integrity of the data, the system also needs to implement a security check for file uploads when receiving files to prevent the injection of malicious files. This link lays a solid foundation for subsequent data processing, making the entire data flow process more efficient and secure.
[0051] S102: Generate Mock business data, Mock business interface, and table data corresponding to the Mock business interface using AIGC based on the Vue static page and the Excel business data file.
[0052] The processing device can use AIGC to generate Mock business data, Mock business interface and table data corresponding to the Mock business interface based on the Vue static page and the Excel business data file.
[0053] In a possible implementation, the processing device may generate contextual business data based on the business indicators and field definitions in the Vue static page using AIGC, and generate first Mock business data based on the contextual business data. Generate numerical result data based on the business indicators and specific business values in the Excel business data file using AIGC, and generate second Mock business data based on the numerical result data. Generate a Mock business interface based on the business data, the field definition of the business data, and the specific business value. Generate Mock business data based on the first Mock business data and the second Mock business data. Generate table data based on the numerical result data.
[0054] After receiving the Vue static page and Excel business data file input by the front end, the second step of this application is to automatically generate Mock business data and Mock business interface using AIGC (artificial intelligence generated content) technology. By analyzing the input Vue page and Excel file, AIGC technology can intelligently identify the business indicators, fields, and data types defined therein. On this basis, the system can generate representative Mock data according to actual business needs. These data can not only simulate real business scenarios, but also cover a variety of possible situations, thereby providing sufficient samples for subsequent development and testing.
[0055] The generated Mock business interface automatically builds an API interface that matches the front-end Vue page through predefined interface specifications and structures. These interfaces can be used to simulate actual back-end services, ensuring that front-end developers can call data in real time during the development process, perform UI display and functional testing. This automated interface generation method not only improves development efficiency, but also reduces errors and inconsistencies caused by manually writing interfaces.
[0056] In addition, the Mock data and interfaces generated by AIGC technology are highly scalable. When business needs change, the system can quickly adjust the generation rules and flexibly respond to new business scenarios. This process greatly improves the response speed of the development team and makes product iteration faster.
[0057] S103: Generate a JSON data interface based on the Mock business data, the table data corresponding to the Mock business interface, and the Mock business interface.
[0058] The processing device may generate a JSON data interface based on the Mock business data, the table data corresponding to the Mock business interface, and the Mock business interface.
[0059] After generating the mock business data and mock business interface, the next step is to integrate these data and generate a data interface in JSON format. JSON (JavaScript Object Notation) is a lightweight data exchange format that is widely used in Web development. Its simplicity and readability make JSON the preferred format for front-end and back-end data interaction.
[0060] In this application, the system will automatically build the corresponding JSON data interface according to the structure of the Mock business data and the Mock business interface. This process includes converting the Mock data into JSON format and generating the corresponding API response format according to the interface specification. The system will ensure that the generated JSON data interface complies with the design principles of RESTful API, so that front-end developers can easily call and process data.
[0061] In addition, the generated JSON data interface will include detailed documentation to help front-end developers quickly understand the purpose, request parameters, and response format of each interface. This step not only improves the usability of the interface, but also enhances the communication efficiency between the front-end and back-end teams. By providing structured and standardized interface documents, front-end and back-end developers can collaborate more smoothly and reduce development delays caused by unclear interfaces.
[0062] During the entire generation process, the system should also have a version control mechanism to ensure that each generated JSON data interface can be effectively managed and traced. This flexible management method enables the project to maintain an efficient development rhythm in the face of ever-changing requirements.
[0063] S104: Return the JSON data interface to the front end.
[0064] The processing device can return the JSON data interface to the front end.
[0065] After successfully generating the JSON data interface, the last step is to return it to the front end. This process is the key to ensure smooth data connection between the front and back ends. The system will send the generated JSON data interface to the front-end application via the HTTP protocol for the front-end developer to call.
[0066] Before the data is returned, the system needs to perform a strict security check to ensure that the returned JSON data interface does not contain any sensitive information or potential security vulnerabilities. At the same time, the system should have a good error handling mechanism, such as being able to return detailed error information when the interface call fails, to help front-end developers quickly locate the problem.
[0067] In order to improve the user experience, the system can also implement a data caching mechanism to reduce frequent interface requests and improve response speed. By caching frequently requested data in memory, the system can quickly return results when the user requests again, improving overall performance.
[0068] In addition, after receiving the JSON data interface, the front-end can make asynchronous data requests through Ajax or Fetch API to dynamically update the page. This process enables the front-end application to display the latest business data in real time and improve the user's interactive experience.
[0069] By returning the JSON data interface to the front end, this application achieves efficient docking between the front and back ends, ensuring that the development team can test and develop in a real and reliable environment. This link provides a guarantee for the stability and reliability of the entire system and lays the foundation for the successful implementation of the project.
[0070] In a possible implementation, after the interface is sent to the front end, the front end can perform an interface test, and the processing device receives the test result data returned by the front end, the test result data is the data obtained by the front end performing the interface test based on the JSON data interface, and adjusts the JSON data interface according to the indication of the test result data.
[0071] The method provided in this application receives the Vue static page and Excel business data file input by the front end, and uses AIGC technology to automatically generate Mock data and interfaces, which significantly reduces the time for manual entry and configuration. This process enables developers to quickly obtain the required data and interfaces, avoiding delays in development progress due to waiting for data to be provided, thereby speeding up the overall advancement of the project. In the prior art, manual entry of business test data is prone to errors, and the authenticity and consistency of the data are difficult to guarantee. However, this application automatically generates Mock data to ensure that the generated data is true and accurate, reducing the problem of data inconsistency caused by manual operation. This mechanism improves the reliability of the test and makes subsequent test results more valuable for reference.
[0072] The present application also provides a Figure 2 The structure diagram of a device based on the AIGC Mock service data interface is shown, and the device 200 based on the AIGC Mock service data interface includes the following modules:
[0073] The receiving module 201 is used to receive a Vue static page and an Excel business data file input by a front end, wherein the Vue static page includes business indicators and field definitions corresponding to the business indicators, and the Excel data file includes business indicators and specific business values corresponding to the business indicators;
[0074] The first generating module 202 is used to generate Mock business data, Mock business interface and table data corresponding to the Mock business interface based on the Vue static page and the Excel business data file by using AIGC;
[0075] The second generating module 203 is used to generate a JSON data interface based on the Mock business data, the table data corresponding to the Mock business interface and the Mock business interface;
[0076] The sending module 204 is used to return the JSON data interface to the front end.
[0077] In a possible implementation manner, the first generating module is specifically configured to:
[0078] Generate contextual business data based on the business indicators and field definitions in the Vue static page using AIGC, and generate first Mock business data based on the contextual business data;
[0079] Generate numerical result data based on the business indicators and specific business values in the Excel business data file using AIGC, and generate second Mock business data based on the numerical result data;
[0080] A Mock business interface is generated based on the business data, the field definition of the business data and the specific business value.
[0081] Generate mock service data based on the first mock service data and the second mock service data;
[0082] Table data is generated based on the numerical result data.
[0083] In a possible implementation, the device further includes a testing module, and the testing module is specifically configured to:
[0084] Receive the test result data returned by the front end, wherein the test result data is the data obtained by the front end through interface testing based on the JSON data interface;
[0085] The JSON data interface is adjusted according to the indication of the test result data.
[0086] The device provided in this application receives the Vue static page and Excel business data file input by the front end, and uses AIGC technology to automatically generate Mock data and interfaces, which significantly reduces the time for manual entry and configuration. This process enables developers to quickly obtain the required data and interfaces, avoiding delays in development progress due to waiting for data to be provided, thereby speeding up the overall advancement of the project. In the prior art, manual entry of business test data is prone to errors, and the authenticity and consistency of the data are difficult to guarantee. However, this application automatically generates Mock data to ensure that the generated data is true and accurate, reducing the problem of data inconsistency caused by manual operation. This mechanism improves the reliability of the test and makes subsequent test results more valuable for reference.
[0087] An embodiment of the present application also provides a device based on the AIGC Mock business data interface, wherein the device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device performs the steps of the method based on the AIGC Mock business data interface described in any embodiment of the present application.
[0088] In practical applications, the computer-readable storage medium may be any combination of one or more computer-readable media, which may be a computer-readable signal medium or a computer-readable storage medium.
[0089] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0090] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0091] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0092] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0093] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0094] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method based on AIGC Mock business data interface, characterized in that: include: Receive a Vue static page and an Excel business data file input by a front end, wherein the Vue static page includes business indicators and field definitions corresponding to the business indicators, and the Excel data file includes business indicators and specific business values corresponding to the business indicators; Generate Mock business data, Mock business interface and table data corresponding to the Mock business interface based on the Vue static page and the Excel business data file using AIGC; Generate a JSON data interface based on the Mock business data, the table data corresponding to the Mock business interface, and the Mock business interface; Return the JSON data interface to the front end.
2. The method according to claim 1, characterized in that The generating of Mock business data, Mock business interface and table data corresponding to the Mock business interface by using AIGC based on the Vue static page and the Excel business data file includes: Generate contextual business data based on the business indicators and field definitions in the Vue static page using AIGC, and generate first Mock business data based on the contextual business data; Generate numerical result data based on the business indicators and specific business values in the Excel business data file using AIGC, and generate second Mock business data based on the numerical result data; Generate a Mock business interface based on the business data, the field definition of the business data and the specific business value; Generate mock business data based on the first mock business data and the second mock business data; Table data is generated based on the numerical result data.
3. The method according to claim 1, characterized in that The method further comprises: Receive test result data returned by the front end, wherein the test result data is data obtained by the front end through interface testing based on the JSON data interface; The JSON data interface is adjusted according to the indication of the test result data.
4. A device based on AIGC Mock service data interface, characterized in that: include: A receiving module, used to receive a Vue static page and an Excel business data file input by a front end, wherein the Vue static page includes business indicators and field definitions corresponding to the business indicators, and the Excel data file includes business indicators and specific business values corresponding to the business indicators; The first generation module is used to generate Mock business data, Mock business interface and table data corresponding to the Mock business interface based on the Vue static page and the Excel business data file using AIGC; A second generating module is used to generate a JSON data interface based on the Mock business data, the table data corresponding to the Mock business interface, and the Mock business interface; The sending module is used to return the JSON data interface to the front end.
5. The device according to claim 4, characterized in that The first generating module is specifically used for: Generate contextual business data based on the business indicators and field definitions in the Vue static page using AIGC, and generate first Mock business data based on the contextual business data; Generate numerical result data based on the business indicators and specific business values in the Excel business data file using AIGC, and generate second Mock business data based on the numerical result data; Generate a Mock business interface based on the business data, the field definition of the business data and the specific business value; Generate mock business data based on the first mock business data and the second mock business data; Table data is generated based on the numerical result data.
6. The device according to claim 4, characterized in that The device further comprises a testing module, which is specifically used for: Receive test result data returned by the front end, wherein the test result data is data obtained by the front end through interface testing based on the JSON data interface; The JSON data interface is adjusted according to the indication of the test result data.
7. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used to execute the computer program to implement the method based on the AIGC Mock service data interface according to any one of claims 1 to 3.
8. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the method based on the AIGC Mock business data interface according to any one of claims 1 to 3 is implemented.