System simulation method and device based on log information, equipment and storage medium

A third-party simulation system that builds an MLP regression model by analyzing application system logs solves the problem of poor simulation of real systems in existing technologies and achieves an efficient development and testing process.

CN116011201BActive Publication Date: 2026-07-24AISINO CREDIT INFORMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AISINO CREDIT INFORMATION CO LTD
Filing Date
2022-12-24
Publication Date
2026-07-24

Smart Images

  • Figure CN116011201B_ABST
    Figure CN116011201B_ABST
Patent Text Reader

Abstract

The application provides a log information-based system simulation method and device, equipment and a storage medium, wherein the method comprises the following steps: printing the request interface and parameters of an application system and a response result into the system log of the application system with matched labels; acquiring the interface list and state requirements of the application system and acquiring the system log of the application system; extracting data from the system log, extracting request data and response data, and forming a data pair; constructing a third-party simulation system based on an MLP regression model, and training the MLP regression model by using the data pair as the input parameter of the MLP regression model. The log information-based system simulation method provided by the application can generate a reliable simulation system by analyzing the application system log without detailed interface documents and instruction manuals, which is beneficial to reducing communication problems and cooperation costs and improving the development and test work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of application development, and in particular relates to a system simulation method, apparatus, device and storage medium based on log information. Background Technology

[0002] In daily development and testing, we often encounter unstable or non-functional third-party system environments. Collaboration with multiple parties also presents communication and coordination challenges, significantly hindering the smooth progress of module development, system integration, system testing, and automated testing. Specific problems include: third-party systems failing to return results for extended periods; third-party systems crashing and becoming unavailable; third-party systems having issues and failing to respond correctly; and third-party system interface documentation not being updated promptly after code changes. Therefore, to avoid impacting third-party systems, reduce communication problems and collaboration costs, and improve development and testing efficiency, simulated third-party systems can be used for daily development and testing. However, existing system simulation methods are not effective at simulating real systems, affecting the reliability of the simulated systems. Summary of the Invention

[0003] In view of this, the present invention aims to propose a system simulation method, apparatus, device and storage medium based on log information to solve the problem that existing third-party simulation systems do not perform well in simulating real systems.

[0004] To achieve the above objectives, the technical solution of the present invention is implemented as follows:

[0005] In a first aspect, the present invention provides a system simulation method based on log information, comprising:

[0006] Print the application system's request interfaces and parameters, as well as the response results, to the application system's system log with matching tags;

[0007] Obtain the application system's interface list and status requirements, and retrieve the application system's system logs;

[0008] Data is extracted from the system logs, including request data and response data, and the extracted data is paired; the request data includes interface requests and status values.

[0009] A third-party simulation system based on the MLP regression model is constructed, and the MLP regression model is trained using the data as input parameters to obtain the trained MLP regression model.

[0010] The trained MLP regression model is used to generate a response set for a third-party system. Based on the response set, the application system is run using a third-party simulation system to develop and test the application system.

[0011] Furthermore, the step of extracting data from the system logs, extracting request data and response data, and forming data pairs includes:

[0012] Read system log file data from the application system;

[0013] Using regular expression matching, request and response data are extracted and paired.

[0014] Furthermore, the construction of a third-party simulation system based on the MLP regression model, and the use of the data as input parameters to train the MLP regression model to obtain the trained MLP regression model, includes:

[0015] Construct an MLP regression model;

[0016] The data pairs are vectorized using feature values ​​to obtain the training sample dataset and the test sample dataset.

[0017] The MLP regression model was trained using a training sample dataset based on stochastic gradient optimization.

[0018] The trained MLP regression model was validated using test sample data, and the trained MLP regression model was obtained by adjusting the learning rate parameter.

[0019] Furthermore, the step of generating a response set for a third-party system using the trained MLP regression model, and then running the application system using a third-party simulation system based on the response set to develop and test the application system includes:

[0020] Using the trained MLP regression model, a response set from a third-party system is generated based on the interface list and status requirements of the application system; wherein, the response set includes multiple sets of request data and their corresponding response data;

[0021] The application system is run using a third-party simulation system, and the application system is developed and tested based on the response set.

[0022] Furthermore, the step of using a third-party simulation system to run the application system and developing and testing the application system based on the response set includes:

[0023] Utilize a third-party simulation system to receive interface requests and status values ​​from the application system;

[0024] Extract the request data corresponding to the interface request and status value, and match the request data with the response data in the response set to obtain the return value.

[0025] Secondly, the present invention also provides a system simulation device based on log information, comprising:

[0026] The printing module is used to print the application system's request interfaces and parameters, as well as the response results, to the application system's system log with matching labels;

[0027] The acquisition module is used to acquire the application system's interface list and status requirements, as well as the application system's system logs;

[0028] The extraction module is used to extract data from the system logs, extract request data and response data, and form data pairs; wherein, the request data includes interface requests and status values;

[0029] The module is used to build a third-party simulation system based on the MLP regression model, and to train the MLP regression model using the data as input parameters to obtain the trained MLP regression model.

[0030] The processing module is used to generate a response set of the third-party system using the trained MLP regression model, and to run the application system using the third-party simulation system based on the response set, so as to develop and test the application system.

[0031] Thirdly, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the system simulation method based on log information as described above.

[0032] Fourthly, the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the steps of the system simulation method based on log information described above.

[0033] Compared with existing technologies, the system simulation method, apparatus, device, and storage medium based on log information described in this invention have the following advantages:

[0034] The system simulation method based on log information described in this invention aims to solve the problem of strong dependence on third-party systems in development and testing. By analyzing application system logs, a reliable simulation system can be generated without detailed interface documents and manuals, which helps to reduce communication problems and cooperation costs, and improve the efficiency of development and testing. Attached Figure Description

[0035] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0036] Figure 1 This is a flowchart of the system simulation method based on log information as described in Embodiment 1 of the present invention;

[0037] Figure 2 This is a schematic diagram of the structure of a system simulation device based on log information according to Embodiment 2 of the present invention;

[0038] Figure 3 This is a schematic diagram of the structure of a computer device provided in Embodiment 2 of the present invention. Detailed Implementation

[0039] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0040] Example 1

[0041] To address the issue of strong dependence on third-party systems during development and testing, this first embodiment provides a method that, based on a list of interfaces to be called, mines and analyzes the log data of the application system to obtain the call information and return values ​​of the interfaces, thereby generating a reliable simulation system.

[0042] Figure 1 This is a flowchart of the system simulation method based on log information described in Embodiment 1 of the present invention. This method can be used for the development and testing of application systems. See also... Figure 1 This method specifically includes the following steps:

[0043] Step 101: Print the application system's request interface and parameters, as well as the response results, to the application system's system log with matching tags.

[0044] Specifically, the application system described in this embodiment refers to an application running on hardware (such as a computer, mobile phone, handheld device, etc.) that provides services required by the user. The third-party system described in this embodiment refers to other systems called upon during the development of the application system, providing services required by this application system. The interface in this embodiment refers to the shared boundary for information exchange between the two systems.

[0045] In practical applications, to ensure the feasibility of this method, we communicated with the project team to print the request interface, parameters, and response results to the log with matching identifiers, and the request parameters were in JSON format.

[0046] Step 102: Obtain the application system's interface list and status requirements, and obtain the application system's system logs.

[0047] Specifically, the inputs to the third-party simulation system include: a list of requests from the application system, including a list of interfaces and status requirements; and application system logs, which contain the application system's interface requests and the third-party system's return values, where the return values ​​are the response results or response data.

[0048] In practical applications, third-party simulation systems have the ability to return the correct response value according to different interfaces and status requirements.

[0049] Step 103: Extract data from the system logs, extracting request data and response data, and forming data pairs; wherein, the request data includes interface requests and status values. Specifically, the interface request corresponds to the application system's request interface, and the status value corresponds to the parameters of the application system's request interface.

[0050] For example, you can first read the system log file data of the application system. Then, use regular expression matching to extract request data and response data, and form data pairs; where the request data and response data in each data pair are matched.

[0051] In practical applications, the request data extracts parameters (url, body string). The response data includes (header, body), which are saved in batches as training sample data and test data. This yields data pairs (url, header, body), which are then vectorized using the OneHotEncoder method to serve as input parameters for training the model.

[0052] Step 104: Construct a third-party simulation system based on the MLP regression model, and use the data as input parameters to train the MLP regression model to obtain the trained MLP regression model.

[0053] Specifically, an MLP regression model can be constructed first. Then, the data pairs are vectorized into feature values ​​to obtain training and testing datasets. Next, the MLP regression model is trained using the training dataset based on stochastic gradient optimization. Finally, the trained MLP regression model is validated using the testing dataset, and the learning rate parameter is adjusted to obtain the fully trained MLP regression model. Those skilled in the art can adjust the ratio of the training and testing datasets according to actual needs, for example, using a ratio of 6:4 or 8:2 to achieve the desired training and testing of the MLP regression model. The method of using samples to train and test the MLP regression model, and adjusting the learning parameters to select the learning rate corresponding to the model with the highest accuracy as the final parameter value to obtain the fully trained MLP regression model, is existing technology and will not be elaborated upon here.

[0054] Step 105: Use the trained MLP regression model to generate a response set for the third-party system, and run the application system using the third-party simulation system based on the response set to develop and test the application system.

[0055] For example, the trained MLP regression model can be used first to generate a response set from a third-party system based on the application system's interface list and status requirements; wherein the response set includes multiple sets of request data and their corresponding response data. Then, the application system can be run using a third-party simulation system, and the application system can be developed and tested based on the response set.

[0056] During the development and testing of the application system, a third-party simulation system can be used to receive the application system's interface requests and status values. Then, the request data corresponding to the interface requests and status values ​​is extracted and matched with the response data in the response set to obtain the return value, which is the response data corresponding to the request data in the response set. Testers can then use this data to assess the application system's operational and testing status and proceed with further development and testing.

[0057] In practical applications, the basic process for generating an MLP regression model is explained as follows:

[0058] (1) Set the MLP regression model as y = f(X).

[0059] (2) X: is the feature vector of the training samples. X = [nsamples*[OneHotEncoder[requesturl],OneHotEncoder[requestheader],OneHotEncoder[requestbody]]]. Each request data is transformed into an X vector, the size of which is the total number of sample data nsamples.

[0060] (3) Y: Target value (class label) of the training sample. Y = [nsamples * responseheader + responsebody], the size of which is the total number of sample data nsamples.

[0061] (4) After processing the sample data, the MLP regression model is trained using stochastic gradient-based optimization.

[0062] (5) After training is completed, use test sample data for verification, continuously adjust the learning rate parameter, and select the learning rate corresponding to the model with the highest accuracy as the final parameter value.

[0063] (6) Based on the MLP training model, response data is dynamically generated for different requests. Specifically, by obtaining the response data generated for different requests, the response set of the application system in the third-party system can be obtained.

[0064] In actual use, when the interface and logs change, operators can regenerate a new response set or manually add new interface, parameter and return value data to regain a reliable third-party simulation system.

[0065] This embodiment describes a system simulation method based on log information. By analyzing the log information of the application system, it obtains the call information and return values ​​of the interfaces between the application system and the third-party system, and generates a simulation system for the third-party system. This simulation system can automatically return the corresponding value based on the call information and through algorithm calculation. After the simulation system is generated, developers and testers can directly call this simulation system to perform system integration and testing.

[0066] This embodiment describes a system simulation method based on log information, aiming to solve the problem of strong dependence on third-party systems in development and testing. By analyzing application system logs, a reliable simulation system can be generated without detailed interface documentation and manuals, which helps reduce communication problems and cooperation costs, and improves the efficiency of development and testing. This method obtains the return values ​​and operation lists of called interfaces through log analysis, and by training an MLP regression model, it can dynamically return response data according to different requests to obtain a more realistic and reliable simulation environment. Then, the third-party simulation system is used to replace the third-party system for application system development and testing, solving the problems of unstable third-party system environments and untimely documentation updates.

[0067] Example 2

[0068] Figure 2 This is a schematic diagram of the structure of a system simulation device based on log information according to Embodiment 2 of the present invention. See also... Figure 2 The device includes:

[0069] The printing module 201 is used to print the application system's request interfaces and parameters, as well as the response results, to the application system's system log with matching labels;

[0070] The acquisition module 202 is used to acquire the interface list and status requirements of the application system, and to acquire the system logs of the application system;

[0071] The extraction module 203 is used to extract data from the system log, extract request data and response data, and form data pairs; wherein, the request data includes interface requests and status values;

[0072] The construction module 204 is used to construct a third-party simulation system based on the MLP regression model, and to train the MLP regression model using the data as input parameters to obtain the trained MLP regression model.

[0073] The processing module 205 is used to generate a response set of the third-party system using the trained MLP regression model, and to run the application system using the third-party simulation system based on the response set, so as to develop and test the application system.

[0074] The simulation device described in this embodiment can be used to simulate a third-party system. By extracting data from the system logs, request data and response data can be extracted, and then the MLP regression model can be trained to obtain a reliable third-party simulation system for the development and testing of application systems.

[0075] Example 3

[0076] Figure 3This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention; Figure 3 A block diagram of an exemplary computer device suitable for implementing embodiments of the present invention is shown. Figure 3 The computer device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.

[0077] like Figure 3 As shown, the general-purpose computing device is represented in the form of terminal 12. The components of terminal 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).

[0078] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0079] Terminal 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by terminal 12, including volatile and non-volatile media, removable and non-removable media.

[0080] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Terminal 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 3 Not shown; usually referred to as a "hard drive"). Although Figure 3 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.

[0081] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.

[0082] Terminal 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the terminal 12, and / or with any device that enables the terminal 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, terminal 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of terminal 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with terminal 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0083] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the methods provided in the embodiments of the present invention.

[0084] Example 4

[0085] Embodiment 4 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the steps of the system simulation method based on log information as described above.

[0086] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0087] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0088] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0089] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0090] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A system simulation method based on log information, characterized in that, include: Print the application system's request interfaces and parameters, as well as the response results, to the application system's system log with matching tags; Obtain the application system's interface list and status requirements, and retrieve the application system's system logs; Data is extracted from the system logs, including request data and response data, and the extracted data is paired; the request data includes interface requests and status values. A third-party simulation system based on the MLP regression model is constructed, and the MLP regression model is trained using the data as input parameters to obtain the trained MLP regression model. The trained MLP regression model is used to generate a response set for a third-party system. Based on the response set, the application system is run using a third-party simulation system to develop and test the application system.

2. The method according to claim 1, characterized in that, The step of extracting data from the system logs, extracting request data and response data, and forming data pairs includes: Read system log file data from the application system; Using regular expression matching, request and response data are extracted and paired.

3. The method according to claim 1, characterized in that, The construction of a third-party simulation system based on an MLP regression model, and the use of the data as input parameters to train the MLP regression model to obtain a trained MLP regression model, includes: Construct an MLP regression model; The data pairs are vectorized using feature values ​​to obtain the training sample dataset and the test sample dataset. The MLP regression model was trained using a training sample dataset based on stochastic gradient optimization. The trained MLP regression model was validated using test sample data, and the trained MLP regression model was obtained by adjusting the learning rate parameter.

4. The method according to claim 1, characterized in that, The process of generating a response set for a third-party system using the trained MLP regression model, and then running the application system using a third-party simulation system based on the response set to develop and test the application system includes: Using the trained MLP regression model, a response set from a third-party system is generated based on the interface list and status requirements of the application system; wherein, the response set includes multiple sets of request data and their corresponding response data; The application system is run using a third-party simulation system, and the application system is developed and tested based on the response set.

5. The method according to claim 4, characterized in that, The process of using a third-party simulation system to run the application system and developing and testing the application system based on the response set includes: Utilize a third-party simulation system to receive interface requests and status values ​​from the application system; Extract the request data corresponding to the interface request and status value, and match the request data with the response data in the response set to obtain the return value.

6. A system simulation device based on log information, characterized in that, include: The printing module is used to print the application system's request interfaces and parameters, as well as the response results, to the application system's system log with matching labels; The acquisition module is used to acquire the application system's interface list and status requirements, as well as the application system's system logs; The extraction module is used to extract data from the system logs, extract request data and response data, and form data pairs; wherein, the request data includes interface requests and status values; The module is used to build a third-party simulation system based on the MLP regression model, and to train the MLP regression model using the data as input parameters to obtain the trained MLP regression model. The processing module is used to generate a response set of the third-party system using the trained MLP regression model, and to run the application system using the third-party simulation system based on the response set, so as to develop and test the application system.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the system simulation method based on log information as described in any one of claims 1-5.

8. A storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the steps of the system simulation method based on log information as described in any one of claims 1-5.