CN116643902B - Interface data simulation method, device, apparatus, storage medium, and program product - Google Patents

Interface data simulation method, device, apparatus, storage medium, and program product Download PDF

Info

Publication number
CN116643902B
CN116643902B CN202310927704.2A CN202310927704A CN116643902B CN 116643902 B CN116643902 B CN 116643902B CN 202310927704 A CN202310927704 A CN 202310927704A CN 116643902 B CN116643902 B CN 116643902B
Authority
CN
China
Prior art keywords
data
model
request information
simulation
data model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310927704.2A
Other languages
Chinese (zh)
Other versions
CN116643902A (en
Inventor
赵福生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taiping Finance Technology Services Shanghai Co ltd
Original Assignee
Taiping Finance Technology Services Shanghai Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taiping Finance Technology Services Shanghai Co ltd filed Critical Taiping Finance Technology Services Shanghai Co ltd
Priority to CN202310927704.2A priority Critical patent/CN116643902B/en
Publication of CN116643902A publication Critical patent/CN116643902A/en
Application granted granted Critical
Publication of CN116643902B publication Critical patent/CN116643902B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/543Local
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present application relates to an interface data simulation method, apparatus, device, storage medium and program product. The method comprises the following steps: acquiring data request information sent by a front end; determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model; the simulation data is returned to the front end through a pre-built virtual server. By adopting the method, various conditions of the front end in the interface data simulation process can be comprehensively simulated, and the accuracy of interface data simulation is improved.

Description

Interface data simulation method, device, apparatus, storage medium, and program product
Technical Field
The present application relates to the field of program development technologies, and in particular, to an interface data simulation method, apparatus, device, storage medium, and program product.
Background
In the process of program development, the front end and the back end are in separate and parallel development modes, and under the condition that the back end does not provide a data interface, the front end usually adopts a data simulation technology to simulate the data of the back end interface.
At present, when the front end performs interface data simulation, simulation data is often generated through a mock service, and interface data simulation is performed according to the generated simulation data.
However, the existing data simulation method has the problems of incomplete simulation and low simulation result accuracy.
Disclosure of Invention
Based on the above, the application provides an interface data simulation method, device, equipment, storage medium and program product, which can comprehensively simulate various conditions of a front end in the interface data simulation process and improve the accuracy of interface data simulation.
In a first aspect, the present application provides an interface data simulation method. The method comprises the following steps:
acquiring data request information sent by a front end;
determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model;
returning the simulation data to the front end through a pre-constructed virtual server;
generating simulation data according to the target data model, including: performing data content matching on the data request information and the target data model; and if the data request information is matched with the data content of the target data model, operating the target data model to obtain the simulation data.
In one embodiment, the return of the simulation data to the front end by the pre-built virtual server includes: and acquiring the simulation data stored locally through the virtual server, and returning the simulation data to the front end through a predefined port.
In one embodiment, determining a target data model from the data request information and a plurality of predefined data models includes: determining a first data model currently matched with the front end; performing data type matching on the data request information and the first data model to obtain a matching result; and if the matching result is the data type matching, determining the first data model as a target data model.
In one embodiment, the interface data simulation method further includes:
if the data types are not matched according to the matching result, traversing the data models except the first data model according to the data request information, determining a second data model matched with the data types of the data request information, and determining the second data model as a target data model.
In one embodiment, traversing a plurality of predefined data models from the data request information, determining a second data model matching the data type of the data request information includes: forwarding the data request information to a pre-built data development service through a proxy server; and respectively carrying out data type matching on the data models except the first data model through the data development service to obtain a second data model matched with the data request information.
In one embodiment, the interface data simulation method further includes: if the data request information is not matched with the data content of the target data model, updating the target data model according to the data content in the data request information to obtain an updated target data model; and operating the updated target data model to obtain the simulation data.
In a second aspect, the application further provides an interface data simulation device. The device comprises:
the information acquisition module is used for acquiring data request information sent by the front end;
the model determining module is used for determining a target data model according to the data request information and a plurality of predefined data models and generating simulation data according to the target data model;
the data return module is used for returning the simulation data to the front end through a pre-constructed virtual server;
the model determining module is also used for carrying out data content matching on the data request information and the target data model; and if the data request information is matched with the data content of the target data model, operating the target data model to obtain the simulation data.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the following steps when executing the computer program:
acquiring data request information sent by a front end;
determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model;
returning the simulation data to the front end through a pre-constructed virtual server;
wherein generating simulation data according to the target data model comprises: performing data content matching on the data request information and the target data model; and if the data request information is matched with the data content of the target data model, operating the target data model to obtain the simulation data.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring data request information sent by a front end;
determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model;
returning the simulation data to the front end through a pre-constructed virtual server;
wherein generating simulation data according to the target data model comprises: performing data content matching on the data request information and the target data model; and if the data request information is matched with the data content of the target data model, operating the target data model to obtain the simulation data.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprising a computer program which, when executed by a processor, performs the steps of:
acquiring data request information sent by a front end;
determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model;
returning the simulation data to the front end through a pre-constructed virtual server;
wherein generating simulation data according to the target data model comprises: performing data content matching on the data request information and the target data model; and if the data request information is matched with the data content of the target data model, operating the target data model to obtain the simulation data.
The embodiment of the application provides an interface data simulation method, device, equipment, storage medium and program product, which can construct a virtual server at the front end, determine a target data model from a plurality of predefined data models through a pre-constructed data development service when the front end sends data request information, and operate the target data model to obtain simulation data. And then, the simulation data is returned to the front end through a pre-defined virtual server, so that front-end and back-end interaction in the interface data simulation process is realized, the interface data simulation can simulate the problems possibly occurring in the front-end and back-end interaction process, the purpose of comprehensive simulation is achieved, and the accuracy of data simulation is improved.
Drawings
FIG. 1 is a diagram of an application environment for an interface data simulation method in one embodiment;
FIG. 2 is a flow chart of an interface data simulation method in one embodiment;
FIG. 3 is a flow chart of an interface data simulation method according to one embodiment;
FIG. 4 is a flow chart of an interface data simulation method according to one embodiment;
FIG. 5 is a flow chart of an interface data simulation method according to one embodiment;
FIG. 6 is a flow chart of an interface data simulation method according to one embodiment;
FIG. 7 is a block diagram of an interface data simulator in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The interface data simulation method provided by the embodiment of the application can be applied to the server shown in fig. 1. The server includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the server is configured to provide computing and control capabilities. The memory of the server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the server is used for storing some data related to the interface data simulation method according to the embodiment of the application. The input/output interface of the server is used for exchanging information between the processor and the external device. The communication interface of the server is used for communicating with an external terminal through network connection. The computer program is executed by a processor to implement an interface data simulation method. The server may be implemented as a stand-alone server or as a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, there is provided an interface data simulation method, which is illustrated by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:
step 101, acquiring data request information sent by a front end.
In order to realize the data simulation work after the front-end project development is completed, a data development service can be locally constructed through a weback automatic construction tool, and the local data development service can generate simulation data required by the front-end according to data request information.
The data request information may include information such as a data type, a data content, a request address, a request mode, and the like.
In the embodiment of the application, when the development of the front-end project is finished and the data simulation demand is generated, the data request information can be generated according to the data type and the data content to be simulated, and the data request information is sent to the data development service, so that the data development service obtains the data request information.
Step 102, determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model.
In the embodiment of the application, the front end locally stores a plurality of predefined interfaces, different interfaces correspond to different data models, and the different data models are used for generating different types of simulation data.
After the data development service receives the data request information sent by the front end, the data request information can be analyzed, the data type of the simulation data required by the front end is determined, further, a data model matched with the data type in a plurality of predefined data models is determined, the matched data model is determined to be a target data model, the target data model is operated, and the simulation data required by the front end is generated.
And step 103, returning the simulation data to the front end through a pre-constructed virtual server.
In practical application, when the front end and the back end of the project are developed, the back end receives the data request information sent by the front end, and sends the data corresponding to the data request information to the front end through the back end server, so that the front end and back end information interaction of the project is realized.
However, in the existing data simulation process, the front end directly acquires the required simulation data through the mock service and the like to perform interface data simulation, and the simulation data is not transmitted through the back end server. However, when data interaction is performed between the front end and the back end, various situations, such as network limitation, network segment limitation, firewall limitation, etc., often occur. The existing data simulation method cannot obtain the data simulation result when the front end and the rear end have the data interaction problem.
In the embodiment of the application, in order to realize comprehensive data simulation, the front end can locally construct a virtual server through a weback automatic construction tool, and the virtual server can realize various functions of the back end server. After the data development service generates the simulation data through the target data model, the simulation data can be sent to a virtual server which is built in advance, and the simulation data is returned to the front end through the virtual server for the front end to simulate the interface data.
When the virtual server and the front end perform data interaction, the virtual server may not be specially set, so that the data interaction process is in a natural interaction state. The parameters of the virtual server may also be set, for example, the working network segments of the virtual server are set, so that the virtual server and the front end are located in different network segments, and further the interface data simulation results of the front end and the virtual server in different network segments are obtained.
The interface data simulation method provided by the embodiment of the application can construct the virtual server at the front end, and when the front end sends the data request information, the target data model is determined from a plurality of predefined data models through the pre-constructed data development service, and the target data model is operated to obtain the simulation data. And then, the simulation data is returned to the front end through a pre-defined virtual server, so that front-end and back-end interaction in the interface data simulation process is realized, the interface data simulation can simulate the problems possibly occurring in the front-end and back-end interaction process, the purpose of comprehensive simulation is achieved, and the accuracy of data simulation is improved.
The foregoing embodiments describe the return of analog data to the front end via a predefined virtual server. In another embodiment of the present application, the virtual server may return the analog data to the front end through a pre-constructed port that interacts with the front end, comprising the steps of:
and acquiring the simulation data stored locally through the virtual server, and returning the simulation data to the front end through a predefined port.
In the embodiment of the application, after the front end is constructed by the virtual server, a communication port between the front end and the virtual server can be defined through an express.js service of nodejs, and the defined port is mounted to the virtual server.
The data development service may save the simulation data locally at the front end after determining and running the target data model to obtain the simulation data. Then, the virtual server can acquire the local simulation data, and send the simulation data to the front end through a predefined port for the front end to simulate the interface data.
In the method provided by the embodiment of the application, after the front end is constructed by the virtual server, the communication port between the front end and the virtual server can be defined, the virtual server can return the simulation data to the front end through the pre-defined port, so that the front end and back end interaction in the interface data simulation process is realized, the interface data simulation can simulate the problems possibly occurring in the front end and back end interaction process, the purpose of comprehensive simulation is achieved, and the accuracy of data simulation is improved.
The embodiments described above describe a scheme for determining a target data model from a plurality of predefined data models. In another embodiment of the present application, the target data model may be determined by a data type matching result of the data request information and the predefined data model. Comprising the steps as shown in fig. 3:
step 201, determining a first data model currently matched with the front end.
Among a plurality of predefined data models stored locally in the front end, there is one data model that has been matched with the front end, and a connection relationship is established. For example, the data model can be the last time the interface data is simulated, the data model is connected with the front end in a matching way. When the front end generates the data request information, it may be determined whether the first data model currently matched with the front end is a data model corresponding to the analog data required by the front end.
And 202, performing data type matching on the data request information and the first data model to obtain a matching result.
In the embodiment of the application, when the front end generates the data request information, the data type matching can be performed with the determined first data model according to the data type in the data request information, and whether the first data model can generate the data of the type required by the front end is determined. For example, the data type in the data request information and the interface name corresponding to the first data model may be matched, so as to obtain a matching result whether the data type and the interface name are the same or similar.
And 203, if the matching result is the data type matching, determining the first data model as the target data model.
In the embodiment of the application, the front end performs data type matching on the data request information and the first data model, and if the first data model is determined to be matched with the data request information, the first data model is determined to be a target data model. For example, if the data type in the data request information is the same as the interface name corresponding to the first data model, the data request information is determined to be matched with the first data model, and the first data model is determined to be the target data model.
And 204, if the matching result is not matched with the data types, traversing the data models except the first data model according to the data request information, determining a second data model matched with the data types of the data request information, and determining the second data model as a target data model.
In the embodiment of the application, after the front end generates the data request information, the data request information and the first data model are subjected to data type matching, if the first data model is not matched with the data request information, the data request information can be sent to the data development service, after the data development service receives the data request information, the data request information can be analyzed, and the data models except the first data model in a plurality of predefined data models are traversed in sequence according to the data types in the data request information. If the data request information is traversed to the second data model matched with the data request information, determining the matched second data model as a target data model. For a specific matching process, reference may be made to the matching process of the data request information and the first data model, which is not described in detail here.
The method provided by the embodiment of the application can carry out data type matching on the data request information and the first data model which is currently matched and connected with the front end after the front end sends the data request information, and can directly determine the first data model as the target data model if the data type between the data request information and the first data model is matched, so that traversing matching on all the predefined data models is avoided, the matching efficiency of the data request information is improved, and the generation efficiency of the simulation data is further improved. If the data types between the data request information and the first data model are not matched, a matched target data model needs to be searched, so that accurate simulation data are generated according to the target data model.
The foregoing embodiments describe a scheme for receiving data request information through a data development service, and then traversing a plurality of predefined data models to determine a target data model. In another embodiment of the present application, the forwarding of the data request information may be implemented by a proxy server, including the steps as shown in fig. 4:
step 301, forwarding the data request information to a pre-built data development service through a proxy server.
In the embodiment of the application, when the front end and the data development service are in different networks and the like, the forwarding of the data request information can be realized through the proxy server. The front end generates data request information, determines that the data request information is not matched with the first data model, and then sends the data request information to the proxy server, and the proxy server forwards the data request information to a pre-built data development service for the data development service to serve as a determination basis of a target data model, wherein the target data model matched with the data request information is determined in a plurality of pre-defined data models.
And 302, respectively carrying out data type matching on the data models except the first data model through the data development service to obtain a second data model matched with the data request information.
In the embodiment of the application, after the data development service receives the data request information, the data request information can be analyzed to determine the data type of the analog data required by the front end, and then the data type matching is carried out on the data request information and the data models except the first data model in a plurality of predefined data models. For example, among a plurality of predefined data models, an interface name corresponding to a data model other than the first data model may be traversed, and when the interface name identical to or similar to the data type is traversed, the data model corresponding to the interface is determined as the second data model.
In the method provided by the embodiment of the application, the front end can forward the data request information to the data development service through the proxy server, so that the data development service can be used as the determination basis of the target data model, the data model except the first data model is extracted from a plurality of predefined data models, and the target data model matched with the data request information is determined. The method provided by the embodiment of the application can be suitable for the situation that communication between the front end and the data development service is impossible (for example, the front end and the data development service are in different networks), and the reliability of the interface data simulation method is improved.
In the foregoing embodiments, a scheme of generating simulation data by running the target data model is described, and in another embodiment of the present application, before running the target data model, data content matching needs to be performed on the data request information and the target data model, so that the target data model generates accurate simulation data. Comprising the steps as shown in fig. 5:
step 401, performing data content matching on the data request information and the target data model.
In the embodiment of the application, after the data development service determines the target data model, whether the target data model can accurately generate the simulation data required by the front end is required to be determined according to the data content in the data request information.
In one embodiment, the data development service may directly compare the relevant parameters of the target data model with the data content in the data request information, and if the relevant parameters of the target data model match with the data content in the data request information, determine that the data request information matches with the data content of the target data model. Specifically, parameters such as data names, data quantity and the like in the target data model can be compared with data content in the data request information, and if the data names, the data quantity and the like are the same, the target data model is determined to accurately generate the simulation data required by the front end.
For example, if the target data model is used for generating commodity type data, wherein the data name is water cup, the data quantity is 10, and the data content in the data request information is 10 water cups, it is determined that the relevant parameters of the target data model are matched with the data content in the data request information, that is, the data request information is matched with the data content of the target data model.
In one embodiment, the data development service may also locally obtain the simulation data generated last time by the target data model from the front end, compare the data content of the simulation data with the data content in the data request information, and if the data content of the simulation data generated last time by the target data model is the same as the data content in the data request information, determine that the data request information matches the data content of the target data model.
And step 402, if the data request information is matched with the data content of the target data model, the target data model is operated to obtain the simulation data.
In the embodiment of the application, when the data request information is determined to be matched with the data content of the target data model, the data development service can directly run the target data model to generate the simulation data required by the front end.
In the method provided by the embodiment of the application, after the data development service determines the target data model, data content matching is needed to be carried out on the data request information and the target data model, whether the target data model can accurately generate the simulation data required by the front end is determined, and under the condition that the data request information and the target data model are subjected to data content matching, the target data model is operated to generate the simulation data required by the front end, so that the accuracy of the simulation data is improved, and the reliability of the interface data simulation method is further improved.
In one embodiment, when the data request information and the data content of the target data model are not matched, the target data model is further updated to generate accurate simulation data, which includes the steps as shown in fig. 6:
step 501, if the data request information and the data content of the target data model are not matched, updating the target data model according to the data content in the data request information, and obtaining an updated target data model.
And 502, operating the updated target data model to obtain simulation data.
In the embodiment of the application, when the data development service performs data content matching on the data request information and the target data model and the obtained matching result is not matched with the data content, the data development service can change the related parameters in the target data model according to the data content in the data request information, thereby realizing the updating of the target data model and obtaining the updated target data model. And further, the updated target data model is operated to obtain simulation data, and the simulation data is stored in the front end local for the virtual server to call.
The method provided by the embodiment of the application can update the target data model when the data request information is not matched with the data content of the target data model, and operate the updated target data model, thereby generating accurate simulation data and improving the reliability of the interface data simulation method.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides an interface data simulation device for realizing the interface data simulation method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the interface data simulation device or devices provided below may be referred to the limitation of the interface data simulation method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 7, there is provided an interface data simulation apparatus, including: an information acquisition module 601, a model determination module 602, and a data return module 603, wherein:
the information obtaining module 601 is configured to obtain data request information sent by the front end.
The model determining module 602 is configured to determine a target data model according to the data request information and a plurality of predefined data models, and generate simulation data according to the target data model.
The data return module 603 is configured to return the analog data to the front end through a virtual server that is built in advance.
The model determining module 602 is further configured to perform data content matching on the data request information and the target data model; and if the data request information is matched with the data content of the target data model, operating the target data model to obtain the simulation data.
In one embodiment, the data returning module 603 is specifically configured to obtain, through the virtual server, the analog data stored locally, and return the analog data to the front end through a predefined port.
In one embodiment, the model determining module 602 is specifically configured to determine a first data model that is currently matched with the front end; performing data type matching on the data request information and the first data model to obtain a matching result; and if the matching result is the data type matching, determining the first data model as a target data model.
In one embodiment, the model determining module 602 is further configured to traverse data models other than the first data model according to the data request information if the matching result is not a data type match, determine a second data model matching the data type of the data request information, and determine the second data model as the target data model.
In one embodiment, the model determining module 602 is further configured to forward the data request information to a pre-built data development service through a proxy server;
and respectively carrying out data type matching on the data models except the first data model through the data development service to obtain a second data model matched with the data request information.
In one embodiment, the model determining module 602 is further configured to update the target data model according to the data content in the data request information if the data request information and the data content of the target data model are not matched, so as to obtain an updated target data model; and operating the updated target data model to obtain the simulation data.
The modules in the interface data simulation device may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
acquiring data request information sent by a front end;
determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model;
returning the simulation data to the front end through a pre-constructed virtual server;
wherein generating simulation data according to the target data model comprises: performing data content matching on the data request information and the target data model; and if the data request information is matched with the data content of the target data model, operating the target data model to obtain the simulation data.
In one embodiment, the processor when executing the computer program further performs the steps of: and acquiring the simulation data stored locally through the virtual server, and returning the simulation data to the front end through a predefined port.
In one embodiment, the processor when executing the computer program further performs the steps of: determining a first data model currently matched with the front end; performing data type matching on the data request information and the first data model to obtain a matching result; and if the matching result is the data type matching, determining the first data model as a target data model.
In one embodiment, the processor when executing the computer program further performs the steps of: if the data types are not matched according to the matching result, traversing the data models except the first data model according to the data request information, determining a second data model matched with the data types of the data request information, and determining the second data model as a target data model.
In one embodiment, the processor when executing the computer program further performs the steps of: forwarding the data request information to a pre-built data development service through a proxy server; and respectively carrying out data type matching on the data models except the first data model through the data development service to obtain a second data model matched with the data request information.
In one embodiment, the processor when executing the computer program further performs the steps of: if the data request information is not matched with the data content of the target data model, updating the target data model according to the data content in the data request information to obtain an updated target data model; and operating the updated target data model to obtain the simulation data.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring data request information sent by a front end;
determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model;
returning the simulation data to the front end through a pre-constructed virtual server;
wherein generating simulation data according to the target data model comprises: performing data content matching on the data request information and the target data model; and if the data request information is matched with the data content of the target data model, operating the target data model to obtain the simulation data.
In one embodiment, the computer program when executed by the processor further performs the steps of: and acquiring the simulation data stored locally through the virtual server, and returning the simulation data to the front end through a predefined port.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a first data model currently matched with the front end; performing data type matching on the data request information and the first data model to obtain a matching result; and if the matching result is the data type matching, determining the first data model as a target data model.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the data types are not matched according to the matching result, traversing the data models except the first data model according to the data request information, determining a second data model matched with the data types of the data request information, and determining the second data model as a target data model.
In one embodiment, the computer program when executed by the processor further performs the steps of: forwarding the data request information to a pre-built data development service through a proxy server; and respectively carrying out data type matching on the data models except the first data model through the data development service to obtain a second data model matched with the data request information.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the data request information is not matched with the data content of the target data model, updating the target data model according to the data content in the data request information to obtain an updated target data model; and operating the updated target data model to obtain the simulation data.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
acquiring data request information sent by a front end;
determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model;
returning the simulation data to the front end through a pre-constructed virtual server;
wherein generating simulation data according to the target data model comprises: performing data content matching on the data request information and the target data model; and if the data request information is matched with the data content of the target data model, operating the target data model to obtain the simulation data.
In one embodiment, the computer program when executed by the processor further performs the steps of: and acquiring the simulation data stored locally through the virtual server, and returning the simulation data to the front end through a predefined port.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a first data model currently matched with the front end; performing data type matching on the data request information and the first data model to obtain a matching result; and if the matching result is the data type matching, determining the first data model as a target data model.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the data types are not matched according to the matching result, traversing the data models except the first data model according to the data request information, determining a second data model matched with the data types of the data request information, and determining the second data model as a target data model.
In one embodiment, the computer program when executed by the processor further performs the steps of: forwarding the data request information to a pre-built data development service through a proxy server; and respectively carrying out data type matching on the data models except the first data model through the data development service to obtain a second data model matched with the data request information.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the data request information is not matched with the data content of the target data model, updating the target data model according to the data content in the data request information to obtain an updated target data model; and operating the updated target data model to obtain the simulation data.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (8)

1. A method of interface data simulation, the method comprising:
acquiring data request information sent by a front end;
determining a target data model according to the data request information and a plurality of predefined data models, and generating simulation data according to the target data model; wherein the data type of the target data model is matched with the data type of the data request;
returning the simulation data to the front end through a pre-constructed virtual server;
wherein the generating simulation data according to the target data model includes: performing data content matching on the data request information and the target data model; if the data request information is matched with the data content of the target data model, the target data model is operated to obtain the simulation data;
if the data request information is not matched with the data content of the target data model, updating the target data model according to the data content in the data request information to obtain an updated target data model; and operating the updated target data model to obtain the simulation data.
2. The method of claim 1, wherein the returning the simulation data to the front end via a pre-built virtual server comprises:
and acquiring the simulation data stored locally through the virtual server, and returning the simulation data to the front end through a predefined port.
3. The method of claim 1, wherein said determining a target data model from said data request information and a plurality of predefined data models comprises:
determining a first data model currently matched with the front end;
performing data type matching on the data request information and the first data model to obtain a matching result;
and if the matching result is the data type matching, determining the first data model as the target data model.
4. A method according to claim 3, characterized in that the method further comprises:
if the data types are not matched according to the matching result, traversing the data models except the first data model according to the data request information, determining a second data model matched with the data types of the data request information, and determining the second data model as the target data model.
5. The method of claim 4, wherein traversing a plurality of the predefined data models from the data request message, determining a second data model that matches a data type of the data request message, comprises:
forwarding the data request information to a pre-built data development service through a proxy server;
and respectively carrying out data type matching on the data models except the first data model through the data development service to obtain a second data model matched with the data request information.
6. An interface data simulation apparatus, the apparatus comprising:
the information acquisition module is used for acquiring data request information sent by the front end;
the model determining module is used for determining a target data model according to the data request information and a plurality of predefined data models and generating simulation data according to the target data model; wherein the data type of the target data model is matched with the data type of the data request; the data return module is used for returning the simulation data to the front end through a pre-constructed virtual server;
the model determining module is further used for carrying out data content matching on the data request information and the target data model; if the data request information is matched with the data content of the target data model, the target data model is operated to obtain the simulation data;
the model determining module is further configured to update the target data model according to the data content in the data request information if the data request information and the data content of the target data model are not matched, so as to obtain an updated target data model; and operating the updated target data model to obtain the simulation data.
7. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
CN202310927704.2A 2023-07-27 2023-07-27 Interface data simulation method, device, apparatus, storage medium, and program product Active CN116643902B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310927704.2A CN116643902B (en) 2023-07-27 2023-07-27 Interface data simulation method, device, apparatus, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310927704.2A CN116643902B (en) 2023-07-27 2023-07-27 Interface data simulation method, device, apparatus, storage medium, and program product

Publications (2)

Publication Number Publication Date
CN116643902A CN116643902A (en) 2023-08-25
CN116643902B true CN116643902B (en) 2023-10-20

Family

ID=87643801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310927704.2A Active CN116643902B (en) 2023-07-27 2023-07-27 Interface data simulation method, device, apparatus, storage medium, and program product

Country Status (1)

Country Link
CN (1) CN116643902B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6199160B1 (en) * 1993-09-14 2001-03-06 International Business Machines Corporation Computer system and method for performing multiple tasks
CN106294179A (en) * 2016-08-22 2017-01-04 上海亿账通互联网科技有限公司 Analog detection method in process of application development and server
CN108701264A (en) * 2016-03-14 2018-10-23 欧姆龙株式会社 Ability assigns data generating device
CN109271310A (en) * 2017-07-18 2019-01-25 北京京东尚科信息技术有限公司 The exploitation test method and device of mobile applications network function
CN109491905A (en) * 2018-11-02 2019-03-19 北京金山云网络技术有限公司 Head end test method, apparatus and electronic equipment
CN110865943A (en) * 2019-11-26 2020-03-06 太平金融科技服务(上海)有限公司 Interface testing method and device, computer equipment and storage medium
CN112015573A (en) * 2020-08-25 2020-12-01 云账户技术(天津)有限公司 Interface data simulation method and device and electronic equipment
CN113360300A (en) * 2021-06-29 2021-09-07 平安普惠企业管理有限公司 Interface calling link generation method, device, equipment and readable storage medium
CN113467780A (en) * 2021-06-30 2021-10-01 北京达佳互联信息技术有限公司 Data acquisition method and device, electronic equipment and storage medium
CN115129946A (en) * 2022-06-30 2022-09-30 山东有人物联网股份有限公司 Data model generation optimization method and device, electronic equipment and readable storage medium
CN115576711A (en) * 2022-09-26 2023-01-06 北京车智赢科技有限公司 Method and system for simulating returned data and computing equipment
CN115659681A (en) * 2022-11-03 2023-01-31 中船重工(武汉)凌久高科有限公司 External interface implementation method for simulating simulation software service logic

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9298592B2 (en) * 2013-03-14 2016-03-29 International Business Machines Corporation Testing a software interface for a streaming hardware device
US10031939B2 (en) * 2014-09-30 2018-07-24 Microsoft Technology Licensing, Llc Automated supplementation of data model
US9910685B2 (en) * 2015-08-13 2018-03-06 Samsung Electronics Co., Ltd. System and method for identifying, indexing, and navigating to deep states of mobile applications
US10963370B2 (en) * 2019-01-18 2021-03-30 Salesforce.Com, Inc. Default mock implementations at a server
US11030085B2 (en) * 2019-01-18 2021-06-08 Salesforce.Com, Inc. User defined mocking service behavior
US11467948B2 (en) * 2020-09-10 2022-10-11 Doppelio Technologies Private Limited Device virtualization and simulation of a system of things
US11610028B2 (en) * 2021-03-04 2023-03-21 Beijing Voyager Technology Co., Ltd. System and method for designing MEMS mirror based on computed oscillation frequency
CN113220582A (en) * 2021-05-25 2021-08-06 蔚来汽车科技(安徽)有限公司 Micro-service test method and system, and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6199160B1 (en) * 1993-09-14 2001-03-06 International Business Machines Corporation Computer system and method for performing multiple tasks
CN108701264A (en) * 2016-03-14 2018-10-23 欧姆龙株式会社 Ability assigns data generating device
CN106294179A (en) * 2016-08-22 2017-01-04 上海亿账通互联网科技有限公司 Analog detection method in process of application development and server
CN109271310A (en) * 2017-07-18 2019-01-25 北京京东尚科信息技术有限公司 The exploitation test method and device of mobile applications network function
CN109491905A (en) * 2018-11-02 2019-03-19 北京金山云网络技术有限公司 Head end test method, apparatus and electronic equipment
CN110865943A (en) * 2019-11-26 2020-03-06 太平金融科技服务(上海)有限公司 Interface testing method and device, computer equipment and storage medium
CN112015573A (en) * 2020-08-25 2020-12-01 云账户技术(天津)有限公司 Interface data simulation method and device and electronic equipment
CN113360300A (en) * 2021-06-29 2021-09-07 平安普惠企业管理有限公司 Interface calling link generation method, device, equipment and readable storage medium
CN113467780A (en) * 2021-06-30 2021-10-01 北京达佳互联信息技术有限公司 Data acquisition method and device, electronic equipment and storage medium
CN115129946A (en) * 2022-06-30 2022-09-30 山东有人物联网股份有限公司 Data model generation optimization method and device, electronic equipment and readable storage medium
CN115576711A (en) * 2022-09-26 2023-01-06 北京车智赢科技有限公司 Method and system for simulating returned data and computing equipment
CN115659681A (en) * 2022-11-03 2023-01-31 中船重工(武汉)凌久高科有限公司 External interface implementation method for simulating simulation software service logic

Also Published As

Publication number Publication date
CN116643902A (en) 2023-08-25

Similar Documents

Publication Publication Date Title
CN108519967B (en) Chart visualization method and device, terminal and storage medium
CN106649828B (en) Data query method and system
TW201740294A (en) Model training method and device
CN112148350A (en) Remote version management method for works, electronic device and computer storage medium
CN114238085A (en) Interface testing method and device, computer equipment and storage medium
CN116644250B (en) Page detection method, page detection device, computer equipment and storage medium
CN116643902B (en) Interface data simulation method, device, apparatus, storage medium, and program product
CN116800671A (en) Data transmission method, apparatus, computer device, storage medium, and program product
CN109389271B (en) Application performance management method and system
CN116155597A (en) Access request processing method and device and computer equipment
CN112035366B (en) Test case generation method, device and equipment
CN113254399A (en) Log query method and device, electronic equipment and medium
CN117056028B (en) Robot simulation platform building method and device, computer equipment and storage medium
CN116089293A (en) Software testing method, device, equipment and storage medium
CN110958144B (en) Method and device for acquiring network
CN117251384B (en) Interface automation test case generation method and system
CN116795723B (en) Chain unit test processing method and device and computer equipment
CN117349131A (en) System error information display method and device and computer equipment
CN117278625A (en) Message conversion method, device, computer equipment and storage medium
CN116880927A (en) Rule management method, device, computer equipment and storage medium
CN114461647A (en) Index generation method and device, computer equipment and storage medium
CN117033172A (en) Test data processing method, apparatus, device, storage medium and program product
CN117914704A (en) Flow table checking method, apparatus, computer device, storage medium and program product
CN116846797A (en) Node limit throughput determination method, system, device, equipment and medium
CN117130606A (en) Front-end page configuration method, front-end page configuration device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant