Interface request processing method and device, computer equipment and storage medium

By dynamically expanding the MOCK service cluster in MOCK request processing, the problem that existing MOCK solutions cannot specify the response time range and performance bottlenecks are solved, and efficient and accurate interface performance testing is achieved.

CN119537112APending Publication Date: 2025-02-28PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411449553.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

Existing MOCK schemes cannot specify the range of MOCK response time, and when the number of concurrent requests is large, traditional MOCK services may experience performance bottlenecks, resulting in long response time, affecting the efficiency and accuracy of performance testing.

Method used

By judging the key information of the received MOCK request, recording the system time, obtaining the matching target MOCK rules, generating a response message, and calculating the actual time. If the actual time consumed is greater than the preset maximum response time, the extended node will be intelligently started, the MOCK service cluster will be dynamically expanded, and the newly received MOCK requests will be polled to all MOCK service nodes.

Benefits of technology

It realizes dynamic expansion of the MOCK service cluster to ensure that the MOCK response time is within the expected range of users, avoids performance bottlenecks, and improves the efficiency and accuracy of interface performance testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537112A_ABST
    Figure CN119537112A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and relates to an interface request processing method and device, computer equipment and a storage medium, and the method comprises the steps: extracting key information in an MOCK request when the MOCK request sent by a tested designated interface is received, and recording first system time; generating a response message based on a target MOCK rule matched with the key information, and recording second system time; generating actual time consumption based on the second system time and the first system time, and judging whether the actual time consumption is greater than the maximum response time or not; if yes, the response message is sent to a specified interface, and the number of expansion nodes is obtained; starting target MOCK service nodes matched with the expansion nodes in number, and updating the MOCK service cluster based on the target MOCK service nodes to obtain a target MOCK service cluster; and distributing the newly received MOCK request to the target MOCK service cluster in a polling manner. In addition, the actual consumed time can be stored in the block chain. The flexibility, efficiency and accuracy of interface performance testing are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of data processing technology and financial technology, and in particular to methods, devices, computer equipment and storage media for processing interface requests. Background Art

[0002] In complex business scenarios in the financial sector, interface performance testing is a key link to ensure system stability and efficient operation. Performance testing usually involves the evaluation of key indicators such as response speed, throughput, and error rate of a specific interface under extreme conditions such as high concurrency and large data volumes. However, in actual applications, many interfaces do not exist in isolation, but are interrelated and mutually called. This dependency between interfaces brings additional challenges to performance testing.

[0003] Take interface A as an example. It may need to call interface B and interface C to complete specific business logic when processing requests. When performing performance stress testing on interface A, the performance of interface B and interface C will directly affect the test results of interface A. If there is a performance bottleneck in interface B or interface C, then even if the logic processing of interface A itself is very efficient, its overall performance will be greatly reduced due to the drag of relying on the interface.

[0004] To solve this problem, the traditional method is to use MOCK technology in performance testing to simulate the responses of interface B and interface C. MOCK technology builds a simulated service to replace the real interface B and interface C, allowing testers to perform independent performance testing on interface A without relying on the actual backend service.

[0005] However, the traditional MOCK solution cannot specify the range of MOCK response time. In real business scenarios, the response time of interface B and interface C may change due to various factors, such as network latency, server load, etc. If the setting of MOCK response time is too fixed or single, the accuracy and reliability of the test results will be questioned. In addition, when the number of concurrent requests is large, due to the need to simulate a large number of requests and responses, the traditional MOCK service may encounter performance bottlenecks when processing high-concurrency requests, resulting in longer response times, which in turn affects the efficiency and accuracy of the entire performance test. Summary of the invention

[0006] The purpose of the embodiments of the present application is to propose a method, device, computer equipment and storage medium for processing interface requests to solve the technical problems that the existing MOCK solution cannot specify the range of MOCK response time, and when the number of concurrent requests is large, the traditional MOCK service may have performance bottlenecks when processing high-concurrency requests, resulting in a long response time, thereby affecting the efficiency and accuracy of the entire performance test.

[0007] In order to solve the above technical problems, the embodiment of the present application provides a method for processing an interface request, which adopts the following technical solution:

[0008] Determine whether the MOCK request sent by the specified interface under test is received;

[0009] If yes, extract key information from the MOCK request and record the current first system time;

[0010] Obtain target MOCK rules that match the key information;

[0011] Generate a response message corresponding to the MOCK request based on the target MOCK rule, and record the current second system time;

[0012] Generate an actual time consumption based on the second system time and the first system time, and determine whether the actual time consumption is greater than a preset maximum response time;

[0013] If so, the response message is sent to the designated interface, and the number of extended nodes is obtained based on a preset extension strategy;

[0014] Start the target MOCK service node that matches the number of the extended nodes, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster;

[0015] The newly received MOCK request is polled and distributed to all MOCK service nodes in the target MOCK service cluster.

[0016] Further, the step of updating the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster specifically includes:

[0017] Verify the service status of the target MOCK service node based on a preset verification strategy;

[0018] If the target MOCK service node passes the service status verification, a request processing test is performed on the target MOCK service node based on a preset test strategy;

[0019] If the target MOCK service node passes the request processing test, the MOCK service cluster is updated based on the target MOCK service node to obtain the target MOCK service cluster.

[0020] Further, the step of obtaining the target MOCK rule matching the key information specifically includes:

[0021] Call the preset cache database;

[0022] Based on the key information, query the cache database to obtain a specified MOCK rule that matches the key information;

[0023] The designated MOCK rule is used as the target MOCK rule.

[0024] Furthermore, the step of extracting key information from the MOCK request specifically includes:

[0025] Parse the MOCK request to obtain corresponding parsing information;

[0026] Extracting path information, parameter information and header information from the parsed information;

[0027] Integrate the path information, the parameter information and the header information to obtain corresponding integrated information;

[0028] The integrated information is used as the key information.

[0029] Further, after the step of determining whether the actual time consumption is greater than the preset maximum response time, the method further includes:

[0030] If the actual time consumption is not greater than the maximum response time, determine whether the actual time consumption is less than a preset minimum response time;

[0031] If the actual time consumption is less than the minimum response time, a corresponding MOCK response time is generated based on the maximum response time and the minimum response time; wherein the MOCK response time is a random value between the minimum response time and the maximum response time;

[0032] Generate a corresponding sleep time based on the MOCK response time and the actual time consumption;

[0033] Entering a sleep state based on the sleep time, and sending the response message to the designated interface after the sleep state ends.

[0034] Further, the step of generating a corresponding MOCK response time based on the maximum response time and the minimum response time specifically includes:

[0035] Call the preset random number generation function;

[0036] Generate a floating point number based on the random number generation function;

[0037] Obtaining a numerical range between the minimum response time and the maximum response time;

[0038] Performing mapping processing on the floating point number based on the numerical range to obtain corresponding mapping data;

[0039] The mapping data is used as the MOCK response time.

[0040] Further, after the step of polling and distributing the newly received MOCK request to all MOCK service nodes in the target MOCK service cluster, it also includes:

[0041] Call the preset monitoring tool;

[0042] Collect monitoring data of the target MOCK service cluster based on the monitoring tool;

[0043] Analyze the monitoring data to obtain corresponding analysis results;

[0044] Based on the monitoring data and the analysis results, corresponding configuration adjustment processing is performed on the target MOCK service cluster.

[0045] In order to solve the above technical problems, the embodiment of the present application further provides a device for processing an interface request, which adopts the following technical solution:

[0046] The first judgment module is used to judge whether a MOCK request sent by the designated interface under test is received;

[0047] A first processing module, configured to extract key information from the MOCK request and record the current first system time;

[0048] An acquisition module, used to acquire a target MOCK rule matching the key information;

[0049] A second processing module, used to generate a response message corresponding to the MOCK request based on the target MOCK rule, and record the current second system time;

[0050] A second judgment module, used to generate an actual time consumption based on the second system time and the first system time, and judge whether the actual time consumption is greater than a preset maximum response time;

[0051] A third processing module is used to send the response message to the designated interface and obtain the number of extended nodes based on a preset extension strategy;

[0052] The fourth processing module is used to start the target MOCK service node that matches the number of the extended nodes, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster;

[0053] The distribution module is used to distribute the newly received MOCK request polling to all MOCK service nodes in the target MOCK service cluster.

[0054] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0055] Determine whether the MOCK request sent by the specified interface under test is received;

[0056] If yes, extract key information from the MOCK request and record the current first system time;

[0057] Obtain target MOCK rules that match the key information;

[0058] Generate a response message corresponding to the MOCK request based on the target MOCK rule, and record the current second system time;

[0059] Generate an actual time consumption based on the second system time and the first system time, and determine whether the actual time consumption is greater than a preset maximum response time;

[0060] If so, the response message is sent to the designated interface, and the number of extended nodes is obtained based on a preset extension strategy;

[0061] Start the target MOCK service node that matches the number of the extended nodes, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster;

[0062] The newly received MOCK request is polled and distributed to all MOCK service nodes in the target MOCK service cluster.

[0063] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0064] Determine whether the MOCK request sent by the specified interface under test is received;

[0065] If yes, extract key information from the MOCK request and record the current first system time;

[0066] Obtain target MOCK rules that match the key information;

[0067] Generate a response message corresponding to the MOCK request based on the target MOCK rule, and record the current second system time;

[0068] Generate an actual time consumption based on the second system time and the first system time, and determine whether the actual time consumption is greater than a preset maximum response time;

[0069] If so, the response message is sent to the designated interface, and the number of extended nodes is obtained based on a preset extension strategy;

[0070] Start the target MOCK service node that matches the number of the extended nodes, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster;

[0071] The newly received MOCK request is polled and distributed to all MOCK service nodes in the target MOCK service cluster.

[0072] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0073] The present application first determines whether a MOCK request sent by the designated interface under test is received; if so, extracts key information in the MOCK request and records the current first system time; then obtains a target MOCK rule that matches the key information; then generates a response message corresponding to the MOCK request based on the target MOCK rule, and records the current second system time; subsequently generates an actual time based on the second system time and the first system time, and determines whether the actual time is greater than a preset maximum response time; if so, sends the response message to the designated interface, and obtains the number of extended nodes based on a preset extension strategy; further starts a target MOCK service node that matches the number of extended nodes, and updates the MOCK service cluster based on the target MOCK service node to obtain a target MOCK service cluster; finally, polls and distributes the newly received MOCK request to all MOCK service nodes in the target MOCK service cluster. The present application extracts key information from the MOCK request received and sent by the designated interface being tested, and records the current first system time, then generates a response message corresponding to the MOCK request based on the target MOCK rule matching the key information, and records the current second system time, and then generates the actual time based on the second system time and the first system time, and when it is detected that the actual time is greater than the preset maximum response time, it will intelligently start the target MOCK service node that matches the number of extension nodes obtained based on the extension strategy, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster, thereby automatically and intelligently realizing the dynamic expansion of the MOCK service cluster, satisfying that most of the MOCK response time is within the user's expected range, and the designated interface being tested will not be affected by the performance of the surrounding interfaces on the test results. Subsequently, by polling and distributing the newly received MOCK request to all MOCK service nodes in the target MOCK service cluster, the flexibility and robustness of the interface performance test can be increased, and the performance bottleneck in the processing of the MOCK request can be effectively avoided, resulting in the problem of long response time, thereby improving the efficiency and accuracy of the interface performance test. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0075] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0076] Figure 2 A flowchart of an embodiment of a method for processing an interface request according to the present application;

[0077] Figure 3 is a structural diagram of an embodiment of a device for processing an interface request according to the present application;

[0078] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0080] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0081] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0082] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0083] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0084] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0085] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0086] It should be noted that the method for processing interface requests provided in the embodiments of the present application is generally executed by a server / terminal device, and accordingly, the interface request processing device is generally set in the server / terminal device.

[0087] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0088] Continue to refer Figure 2 , a flowchart of an embodiment of a method for processing an interface request according to the present application is shown. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. The method for processing an interface request provided in the embodiment of the present application can be applied to any scenario where interface request processing is required, and the method for processing an interface request can be applied to products in these scenarios, for example, interface request processing in the financial insurance field. The method for processing an interface request comprises the following steps:

[0089] Step S201, determining whether a MOCK request sent by a designated interface under test is received.

[0090] In this embodiment, the method for processing an interface request is executed on an electronic device (eg Figure 1The server / terminal device shown in the figure) can obtain the MOCK request through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future. The execution subject of this application is specifically a MOCK service node. In the business scenario of performance testing of financial interfaces in the field of finance and insurance, the above-mentioned designated interfaces to be tested may include transaction interfaces, payment interfaces, business interfaces, and the like. When the client sends a request to the designated interface A to be tested, the designated interface A will initiate a call to the peripheral interfaces (such as interface B and interface C) internally. In this case, the designated interface A will initiate a request to the MOCK service node to simulate the behavior of the peripheral interfaces, that is, simulate the call to the peripheral interfaces. Among them, the above-mentioned client may be a performance testing tool. When the designated interface A receives the request sent by the client, it will recognize in the internal logic that the peripheral interfaces (such as interface B and interface C) need to be called, but due to the needs of performance testing, these calls are redirected to the MOCK service. MOCK testing is a commonly used technique in software testing. It refers to a testing method in which a virtual object (i.e., MOCK object) is used to create some objects that are not easy to construct or obtain for testing during the testing process.

[0091] Step S202: If yes, extract key information in the MOCK request and record the current first system time.

[0092] In this embodiment, after receiving the MOCK request, the current system time is recorded and used as the first system time Ts. The specific implementation process of extracting the key information in the MOCK request will be further described in detail in the subsequent specific embodiments, and will not be elaborated here.

[0093] Step S203, obtaining a target MOCK rule that matches the key information.

[0094] In this embodiment, the specific implementation process of the above-mentioned acquisition of the target MOCK rule matching the key information will be further described in detail in the subsequent specific embodiments of the present application, and will not be elaborated in detail here.

[0095] Step S204: Generate a response message corresponding to the MOCK request based on the target MOCK rule, and record the current second system time.

[0096] In this embodiment, after obtaining the target MOCK rule that matches the key information, the corresponding HTTP response message can be assembled according to the response content, status code and other information defined in the target MOCK rule, that is, the above response message is obtained. After completing the assembly of the response message, the current system time is recorded as the second system time Te.

[0097] Step S205: generating an actual time consumption based on the second system time and the first system time, and determining whether the actual time consumption is greater than a preset maximum response time.

[0098] In this embodiment, the actual time consumption can be generated by using the formula Vt=Te-Ts. Wherein, Vt is the actual time consumption, Te is the second system time, and Ts is the first system time. The actual time consumption refers to the time taken from receiving the MOCK request to preparing the response message. Among them, the user can configure the delay range value (Tmin-Tmax) of the MOCK response according to actual needs, Tmin is the minimum response time, and Tmax is the maximum response time.

[0099] Step S206: If yes, the response message is sent to the designated interface, and the number of extended nodes is obtained based on a preset extension strategy.

[0100] In the present embodiment, the above-mentioned expansion strategy may include determining the number of new nodes that need to be started according to the user configuration or 1 / 3 of the existing MOCK service node number, that is, obtaining the above-mentioned number of expanded nodes. Wherein, during performance testing, the number of concurrent requests at the same time is very large. If the number of requests processed by a single MOCK service node does not meet the requirements, it is necessary to establish a dynamic cluster response mode. When the actual time consumption (Vt) is greater than the maximum value of the response delay range set (i.e., the maximum response time Tmax), it is necessary to automatically expand the node, and the specific number of nodes can be configured by the user or 1 / 3 of the existing number of nodes. Subsequently, when the MOCK request polling is distributed to each MOCK service node, the processed MOCK request becomes less, thereby shortening the response time. In this way, it is ensured that during performance testing, the response time of MOCK is within the user's expected range, and the interface of the tested performance is not affected by the performance of the surrounding interfaces on the test results.

[0101] Step S207, start the target MOCK service node that matches the number of the extended nodes, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster.

[0102] In this embodiment, the cluster management script can be called to start a new target MOCK service node. Among them, the above-mentioned MOCK service cluster update based on the target MOCK service node to obtain the specific implementation process of the target MOCK service cluster will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.

[0103] Step S208: distribute the newly received MOCK request to all MOCK service nodes in the target MOCK service cluster in round-robin fashion.

[0104] In this embodiment, after starting a new target MOCK service node, the list of nodes in the MOCK service cluster is updated to obtain the target MOCK service cluster. Subsequent newly received MOCK requests are distributed to all MOCK service nodes (including the newly started target MOCK service node) in the target MOCK service cluster through a load balancer or distribution strategy. And each MOCK service node in the target MOCK service cluster processes the received MOCK request according to the processing steps for the above MOCK request.

[0105] The present application first determines whether a MOCK request sent by the designated interface under test is received; if so, extracts key information in the MOCK request and records the current first system time; then obtains a target MOCK rule that matches the key information; then generates a response message corresponding to the MOCK request based on the target MOCK rule, and records the current second system time; subsequently generates an actual time based on the second system time and the first system time, and determines whether the actual time is greater than a preset maximum response time; if so, sends the response message to the designated interface, and obtains the number of extended nodes based on a preset extension strategy; further starts a target MOCK service node that matches the number of extended nodes, and updates the MOCK service cluster based on the target MOCK service node to obtain a target MOCK service cluster; finally, polls and distributes the newly received MOCK request to all MOCK service nodes in the target MOCK service cluster. The present application extracts key information from the MOCK request received and sent by the designated interface being tested, and records the current first system time, then generates a response message corresponding to the MOCK request based on the target MOCK rule matching the key information, and records the current second system time, and then generates the actual time based on the second system time and the first system time, and when it is detected that the actual time is greater than the preset maximum response time, it will intelligently start the target MOCK service node that matches the number of extension nodes obtained based on the extension strategy, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster, thereby automatically and intelligently realizing the dynamic expansion of the MOCK service cluster, satisfying that most of the MOCK response time is within the user's expected range, and the designated interface being tested will not be affected by the performance of the surrounding interfaces on the test results. Subsequently, by polling and distributing the newly received MOCK request to all MOCK service nodes in the target MOCK service cluster, the flexibility and robustness of the interface performance test can be increased, and the performance bottleneck in the processing of the MOCK request can be effectively avoided, resulting in the problem of long response time, thereby improving the efficiency and accuracy of the interface performance test.

[0106] In some optional implementations, the updating of the MOCK service cluster based on the target MOCK service node in step S206 to obtain the target MOCK service cluster includes the following steps:

[0107] The service status of the target MOCK service node is verified based on a preset verification strategy.

[0108] In this embodiment, the information of the target MOCK service node, including the node ID, IP address, service status, etc., can be obtained by using a cluster management tool. And according to the service status obtained by the query, the PID, port monitoring status, log output, etc. of the target MOCK service node are checked to determine whether the target MOCK service node has been successfully started and run. If all target MOCK service nodes have been successfully started and run, the target MOCK service node is determined to have passed the service status verification, otherwise the target MOCK service node is determined to have failed the service status verification.

[0109] If the target MOCK service node passes the service status verification, a request processing test is performed on the target MOCK service node based on a preset test strategy.

[0110] In this embodiment, a request can be sent to the target MOCK service node using a test tool or a test script to verify that it can process the request normally and return the expected result. If the target MOCK service node can process the request normally and return the expected result, the target MOCK service node is determined to have passed the request processing test, otherwise the target MOCK service node is determined to have failed the request processing test. Among them, the request processing test can be implemented by simulating user requests, API calls, or automated test scripts.

[0111] If the target MOCK service node passes the request processing test, the MOCK service cluster is updated based on the target MOCK service node to obtain the target MOCK service cluster.

[0112] In this embodiment, only when it is detected that the target MOCK service node passes both the service status verification and the request processing test, will the MOCK service cluster be updated based on the target MOCK service node to obtain the corresponding target MOCK service cluster.

[0113] The present application verifies the service status of the target MOCK service node based on a preset verification strategy; if the target MOCK service node passes the service status verification, the target MOCK service node is tested for request processing based on a preset test strategy; if the target MOCK service node passes the request processing test, the MOCK service cluster is updated based on the target MOCK service node to obtain the target MOCK service cluster. After starting the target MOCK service node that matches the number of expansion nodes, the present application will automatically and intelligently verify the target MOCK service node based on the verification strategy and the test strategy, and only when it is detected that the target MOCK service node passes both the service status verification and the request processing test, will the MOCK service cluster be updated based on the target MOCK service node, thereby obtaining the corresponding target MOCK service cluster, which can effectively ensure that the obtained target MOCK service cluster can process requests normally, thereby improving the stability and reliability of request processing.

[0114] In some optional implementations of this embodiment, step S203 includes the following steps:

[0115] Call the preset cache database.

[0116] In this embodiment, the cache database may specifically adopt a Redis database.

[0117] The cache database is queried based on the key information to obtain a specified MOCK rule that matches the key information.

[0118] In this embodiment, by connecting to the Redis database, the key information in the MOCK request is used as a key to find the matching MOCK rule from the Redis database. If a matching specified MOCK rule is found, the corresponding HTTP response message will be assembled based on the response content, status code and other information defined in the specified MOCK rule.

[0119] The designated MOCK rule is used as the target MOCK rule.

[0120] The present application calls a preset cache database; then queries the cache database based on the key information to obtain a specified MOCK rule that matches the key information; and subsequently uses the specified MOCK rule as the target MOCK rule. The present application stores MOCK rule data based on the use of a cache database, which can effectively increase the efficiency and speed of MOCK processing when multiple MOCK service nodes access MOCK rules.

[0121] In some optional implementations, the extracting key information in the MOCK request in step S202 includes the following steps:

[0122] The MOCK request is parsed to obtain corresponding parsing information.

[0123] In this embodiment, the MOCK request is parsed to obtain corresponding parsing information, wherein the parsing information may include at least path information, parameter information and header information.

[0124] Path information, parameter information and header information are extracted from the parsed information.

[0125] In this embodiment, information extraction may be performed on the parsed information according to the path field, the parameter field, and the header field, thereby obtaining corresponding path information, parameter information, and header information.

[0126] The path information, the parameter information and the header information are integrated to obtain corresponding integrated information.

[0127] In this embodiment, the integration information is composed of the path information, the parameter information and the header information.

[0128] The integrated information is used as the key information.

[0129] The present application obtains the corresponding parsing information by parsing the MOCK request; then extracts the path information, parameter information and header information from the parsing information; then integrates the path information, parameter information and header information to obtain the corresponding integrated information; and subsequently uses the integrated information as the key information. The present application obtains the parsing information by parsing the MOCK request; then extracts the path information, parameter information and header information from the parsing information; then integrates the obtained path information, parameter information and header information to achieve fast and accurate acquisition of the key information in the MOCK request, thereby ensuring the accuracy of the obtained key information.

[0130] In some optional implementations, after step S205, the electronic device may further perform the following steps:

[0131] If the actual time consumption is not greater than the maximum response time, it is determined whether the actual time consumption is less than a preset minimum response time.

[0132] In this embodiment, if the actual time consumption is not less than the above minimum response time, a MOCK response is directly performed, and a corresponding response message is returned to the designated interface.

[0133] If the actual time consumed is less than the minimum response time, a corresponding MOCK response time is generated based on the maximum response time and the minimum response time.

[0134] In this embodiment, the MOCK response time is a random value between the minimum response time and the maximum response time. The specific implementation process of generating the corresponding MOCK response time based on the maximum response time and the minimum response time will be further described in detail in the subsequent specific embodiments of the present application, and will not be elaborated on here.

[0135] The corresponding sleep time is generated based on the MOCK response time and the actual time consumption.

[0136] In this embodiment, the sleep time can be calculated by using the formula Lt=Rt-Vt. Wherein, Lt is the sleep time, Rt is the MOCK response time, and Vt is the actual time. When the actual time (Vt) corresponding to the matched target MOCK rule is less than the configured minimum response time (Tmin), the MOCK service node takes a random value within the response range and then sleeps for Lt (equal to Rt-Vt) time.

[0137] Entering a sleep state based on the sleep time, and sending the response message to the designated interface after the sleep state ends.

[0138] In this embodiment, the Vt time is hibernated, and a MOCK response is performed after the hibernation ends, and a corresponding response message is returned to the specified interface. Among them, by performing MOCK hibernation and calculating a random value between the minimum response time and the maximum response time to determine the hibernation time, the actual interface response time can be more truly reflected.

[0139] If the present application detects that the actual time consumption is not greater than the maximum response time, it determines whether the actual time consumption is less than the preset minimum response time; if the actual time consumption is less than the minimum response time, a corresponding MOCK response time is generated based on the maximum response time and the minimum response time; wherein the MOCK response time is a random value between the minimum response time and the maximum response time; then a corresponding sleep time is generated based on the MOCK response time and the actual time consumption; subsequently, the sleep state is entered based on the sleep time, and after the sleep ends, the response message is sent to the designated interface. When the present application detects that the actual time consumption is not greater than the maximum response time and the actual time consumption is less than the minimum response time, the present application generates a corresponding MOCK response time based on the maximum response time and the minimum response time, and generates a corresponding sleep time based on the MOCK response time and the actual time consumption, and then enters a sleep state based on the sleep time, and after the sleep state ends, sends the response message to the designated interface, thereby effectively ensuring that when performing a performance test on the designated interface being tested, the response time of the MOCK request sent to the designated interface is within the user's expected range, and the designated interface being tested will not be affected by the performance of surrounding interfaces on the test results, thereby improving the accuracy and intelligence of the performance test on the designated interface.

[0140] In some optional implementations of this embodiment, generating the corresponding MOCK response time based on the maximum response time and the minimum response time includes the following steps:

[0141] Call the preset random number generation function.

[0142] In this embodiment, the random number generation function may adopt a rand() function, a srand() function or a time() function.

[0143] A floating point number is generated based on the random number generation function.

[0144] In this embodiment, a floating point number between 0 and 1 is generated by using a random number generation function.

[0145] Obtain a numerical range between the minimum response time and the maximum response time.

[0146] In this embodiment, the above numerical range refers to the range of [Tmin, Tmax], where Tmin refers to the minimum response time and Tmax refers to the maximum response time.

[0147] The floating point number is mapped based on the numerical range to obtain corresponding mapping data.

[0148] In this embodiment, the floating point number is mapped to the above-mentioned numerical range by mapping processing, thereby obtaining corresponding mapping data. Among them, it can be achieved by the formula Rt=Tmin+(Tmax-Tmin)*r. Rt is the MOCK response time, Tmin refers to the minimum response time, Tmax refers to the maximum response time, and r is a floating point number.

[0149] The mapping data is used as the MOCK response time.

[0150] The present application generates a floating-point number by calling a preset random number generation function; then generates a floating-point number based on the random number generation function; then obtains the numerical range between the minimum response time and the maximum response time; subsequently maps the floating-point number based on the numerical range to obtain corresponding mapping data, and uses the mapping data as the MOCK response time. The present application generates a floating-point number based on the use of a random number generation function, and then maps the floating-point number based on the numerical range between the minimum response time and the maximum response time, so that the MOCK response time can be generated quickly and accurately, ensuring the data accuracy of the generated MOCK response time.

[0151] In some optional implementations of this embodiment, after step S208, the electronic device may further perform the following steps:

[0152] Call the preset monitoring tool.

[0153] In this embodiment, the monitoring tool is a pre-built tool with the function of monitoring performance indicators. The performance indicators may include response time, throughput, error rate, CPU usage, memory usage, disk I / O, etc. Among them, the monitoring tool can be deployed and configured according to the cluster environment, and the monitoring threshold and alarm strategy can be reasonably configured according to business requirements and cluster characteristics.

[0154] The monitoring data of the target MOCK service cluster is collected based on the monitoring tool.

[0155] In this embodiment, monitoring data of the target MOCK service cluster is collected by using a monitoring tool, including historical data and real-time data.

[0156] The monitoring data is analyzed to obtain corresponding analysis results.

[0157] In this embodiment, by analyzing the monitoring data and comparing historical data with current data, performance bottlenecks, abnormal fluctuations or potential problems are identified, thereby obtaining corresponding analysis results.

[0158] Based on the monitoring data and the analysis results, corresponding configuration adjustment processing is performed on the target MOCK service cluster.

[0159] In this embodiment, the configuration adjustment process includes: if the resource utilization of a node or service is too high, by adding resources (such as CPU, memory) or reallocating resources. If the load of a service or node is unbalanced, adjust the load balancing strategy, such as changing the weight, adding more nodes, or enabling a more advanced load balancing algorithm. If the fault recovery time is long or the error rate is high, optimize the fault tolerance mechanism, such as adding redundancy, enabling automatic restart or failover function.

[0160] This application calls a preset monitoring tool; then collects the monitoring data of the target MOCK service cluster based on the monitoring tool; then analyzes the monitoring data to obtain corresponding analysis results; and subsequently performs corresponding configuration adjustment processing on the target MOCK service cluster based on the monitoring data and the analysis results. After the newly received MOCK request polling is distributed to all MOCK service nodes in the target MOCK service cluster, the application will automatically and intelligently call the monitoring tool to collect the monitoring data of the target MOCK service cluster, and analyze the monitoring data to obtain corresponding analysis results, and then perform corresponding configuration adjustment processing on the target MOCK service cluster based on the monitoring data and the analysis results, thereby effectively ensuring that the performance of the target MOCK service cluster is improved or maintained stable.

[0161] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.

[0162] In addition, the non-Company software tools or components that appear in the embodiments of the present application are merely examples and do not represent actual use.

[0163] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0164] It should be emphasized that in order to further ensure the privacy and security of the above actual time consumption, the above actual time consumption can also be stored in a node of a blockchain.

[0165] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0166] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0167] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0168] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0169] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0170] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a device for processing an interface request, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0171] like Figure 3 As shown, the interface request processing device 300 described in this embodiment includes: a first judgment module 301, a first processing module 302, an acquisition module 303, a second processing module 304, a second judgment module 305, a third processing module 306, a fourth processing module 307 and a distribution module 308. Among them:

[0172] The first judgment module 301 is used to judge whether a MOCK request sent by the designated interface under test is received;

[0173] The first processing module 302 is used to extract key information in the MOCK request and record the current first system time;

[0174] An acquisition module 303 is used to acquire a target MOCK rule matching the key information;

[0175] The second processing module 304 is used to generate a response message corresponding to the MOCK request based on the target MOCK rule, and record the current second system time;

[0176] A second judgment module 305 is used to generate an actual time consumption based on the second system time and the first system time, and judge whether the actual time consumption is greater than a preset maximum response time;

[0177] The third processing module 306 is used to send the response message to the designated interface and obtain the number of extended nodes based on a preset extension strategy;

[0178] The fourth processing module 307 is used to start the target MOCK service node that matches the number of the extended nodes, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster;

[0179] The distribution module 308 is used to distribute the newly received MOCK request polling to all MOCK service nodes in the target MOCK service cluster.

[0180] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the method for processing interface requests in the aforementioned implementation mode, and are not described in detail here.

[0181] In some optional implementations of this embodiment, the fourth processing module 307 includes:

[0182] A verification submodule, used to verify the service status of the target MOCK service node based on a preset verification strategy;

[0183] A test submodule, used for performing a request processing test on the target MOCK service node based on a preset test strategy if the target MOCK service node passes the service status verification;

[0184] The update submodule is used to update the MOCK service cluster based on the target MOCK service node if the target MOCK service node passes the request processing test to obtain the target MOCK service cluster.

[0185] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the method for processing interface requests in the aforementioned implementation mode, and are not described in detail here.

[0186] In some optional implementations of this embodiment, the acquisition module 303 includes:

[0187] The first calling submodule is used to call a preset cache database;

[0188] A query submodule, used to query the cache database based on the key information to obtain a specified MOCK rule matching the key information;

[0189] The first determination submodule is used to use the specified MOCK rule as the target MOCK rule.

[0190] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the method for processing interface requests in the aforementioned implementation mode, and are not described in detail here.

[0191] In some optional implementations of this embodiment, the first processing module 302 includes:

[0192] The parsing submodule is used to parse the MOCK request to obtain corresponding parsing information;

[0193] An extraction submodule, used to extract path information, parameter information and header information from the parsed information;

[0194] An integration submodule, used for integrating the path information, the parameter information and the header information to obtain corresponding integrated information;

[0195] The second determining submodule is configured to use the integrated information as the key information.

[0196] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the method for processing interface requests in the aforementioned implementation mode, and are not described in detail here.

[0197] In some optional implementations of this embodiment, the interface request processing device further includes:

[0198] A third judgment module is used to judge whether the actual time consumption is less than a preset minimum response time if the actual time consumption is not greater than the maximum response time;

[0199] A first generating module, configured to generate a corresponding MOCK response time based on the maximum response time and the minimum response time if the actual time consumption is less than the minimum response time; wherein the MOCK response time is a random value between the minimum response time and the maximum response time;

[0200] A second generating module is used to generate a corresponding sleep time based on the MOCK response time and the actual time consumption;

[0201] The sending module is used to enter the sleep state based on the sleep time, and send the response message to the designated interface after the sleep state ends.

[0202] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the method for processing interface requests in the aforementioned implementation mode, and are not described in detail here.

[0203] In some optional implementations of this embodiment, the first generating module includes:

[0204] The second calling submodule is used to call a preset random number generation function;

[0205] A generating submodule, used for generating a floating point number based on the random number generating function;

[0206] An acquisition submodule, used to acquire a numerical range between the minimum response time and the maximum response time;

[0207] A mapping submodule, used for performing mapping processing on the floating point number based on the numerical range to obtain corresponding mapping data;

[0208] The third determining submodule is used to use the mapping data as the MOCK response time.

[0209] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the method for processing interface requests in the aforementioned implementation mode, and are not described in detail here.

[0210] In some optional implementations of this embodiment, the interface request processing device further includes:

[0211] A calling module is used to call the preset monitoring tool;

[0212] A collection module, used to collect monitoring data of the target MOCK service cluster based on the monitoring tool;

[0213] An analysis module, used to analyze the monitoring data to obtain corresponding analysis results;

[0214] The adjustment module is used to perform corresponding configuration adjustment processing on the target MOCK service cluster based on the monitoring data and the analysis results.

[0215] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the method for processing interface requests in the aforementioned implementation mode, and are not described in detail here.

[0216] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0217] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0218] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0219] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the processing method of the interface request, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0220] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions or process data stored in the memory 41, such as computer-readable instructions for running the method for processing the interface request.

[0221] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0222] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0223] In the embodiment of the present application, by extracting key information from the MOCK request received and sent by the designated interface being tested, and recording the current first system time, then generating a response message corresponding to the MOCK request based on the target MOCK rule matching the key information, and recording the current second system time, then generating the actual time based on the second system time and the first system time, and when detecting that the actual time is greater than the preset maximum response time, the target MOCK service node matching the number of extension nodes obtained based on the extension strategy will be intelligently started, and the MOCK service cluster will be updated based on the target MOCK service node to obtain the target MOCK service cluster, thereby realizing automatic and intelligent dynamic expansion of the MOCK service cluster, satisfying that most of the MOCK response time is within the user's expected range, and the designated interface being tested will not be affected by the performance of the surrounding interfaces on the test results. Subsequently, by polling and distributing the newly received MOCK request to all MOCK service nodes in the target MOCK service cluster, the flexibility and robustness of the interface performance test can be increased, and the performance bottleneck in the processing of the MOCK request can be effectively avoided, resulting in the problem of long response time, thereby improving the efficiency and accuracy of the interface performance test.

[0224] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the method for processing interface requests as described above.

[0225] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0226] In the embodiment of the present application, by extracting key information from the MOCK request received and sent by the designated interface being tested, and recording the current first system time, then generating a response message corresponding to the MOCK request based on the target MOCK rule matching the key information, and recording the current second system time, then generating the actual time based on the second system time and the first system time, and when detecting that the actual time is greater than the preset maximum response time, the target MOCK service node matching the number of extension nodes obtained based on the extension strategy will be intelligently started, and the MOCK service cluster will be updated based on the target MOCK service node to obtain the target MOCK service cluster, thereby realizing automatic and intelligent dynamic expansion of the MOCK service cluster, satisfying that most of the MOCK response time is within the user's expected range, and the designated interface being tested will not be affected by the performance of the surrounding interfaces on the test results. Subsequently, by polling and distributing the newly received MOCK request to all MOCK service nodes in the target MOCK service cluster, the flexibility and robustness of the interface performance test can be increased, and the performance bottleneck in the processing of the MOCK request can be effectively avoided, resulting in the problem of long response time, thereby improving the efficiency and accuracy of the interface performance test.

[0227] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0228] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A method for processing an interface request, characterized in that: The steps include: Determine whether the MOCK request sent by the specified interface under test is received; If yes, extract key information from the MOCK request and record the current first system time; Obtain target MOCK rules that match the key information; Generate a response message corresponding to the MOCK request based on the target MOCK rule, and record the current second system time; Generate an actual time consumption based on the second system time and the first system time, and determine whether the actual time consumption is greater than a preset maximum response time; If so, the response message is sent to the designated interface, and the number of extended nodes is obtained based on a preset extension strategy; Start the target MOCK service node that matches the number of the extended nodes, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster; The newly received MOCK request is polled and distributed to all MOCK service nodes in the target MOCK service cluster.

2. The method for processing an interface request according to claim 1, characterized in that: The step of updating the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster specifically includes: Verify the service status of the target MOCK service node based on a preset verification strategy; If the target MOCK service node passes the service status verification, a request processing test is performed on the target MOCK service node based on a preset test strategy; If the target MOCK service node passes the request processing test, the MOCK service cluster is updated based on the target MOCK service node to obtain the target MOCK service cluster.

3. The method for processing an interface request according to claim 1, characterized in that: The step of obtaining the target MOCK rule matching the key information specifically includes: Call the preset cache database; Based on the key information, query the cache database to obtain a specified MOCK rule that matches the key information; The designated MOCK rule is used as the target MOCK rule.

4. The method for processing an interface request according to claim 1, characterized in that: The step of extracting key information from the MOCK request specifically includes: Parse the MOCK request to obtain corresponding parsing information; Extracting path information, parameter information and header information from the parsed information; Integrate the path information, the parameter information and the header information to obtain corresponding integrated information; The integrated information is used as the key information.

5. The method for processing an interface request according to claim 1, characterized in that: After the step of determining whether the actual time consumption is greater than the preset maximum response time, the method further includes: If the actual time consumption is not greater than the maximum response time, determine whether the actual time consumption is less than a preset minimum response time; If the actual time consumption is less than the minimum response time, a corresponding MOCK response time is generated based on the maximum response time and the minimum response time; wherein the MOCK response time is a random value between the minimum response time and the maximum response time; Generate a corresponding sleep time based on the MOCK response time and the actual time consumption; Entering a sleep state based on the sleep time, and sending the response message to the designated interface after the sleep state ends.

6. The method for processing an interface request according to claim 5, characterized in that: The step of generating a corresponding MOCK response time based on the maximum response time and the minimum response time specifically includes: Call the preset random number generation function; Generate a floating point number based on the random number generation function; Obtaining a numerical range between the minimum response time and the maximum response time; Performing mapping processing on the floating point number based on the numerical range to obtain corresponding mapping data; The mapping data is used as the MOCK response time.

7. The method for processing an interface request according to claim 1, characterized in that: After the step of polling and distributing the newly received MOCK request to all MOCK service nodes in the target MOCK service cluster, the method further includes: Call the preset monitoring tool; Collect monitoring data of the target MOCK service cluster based on the monitoring tool; Analyze the monitoring data to obtain corresponding analysis results; Based on the monitoring data and the analysis results, corresponding configuration adjustment processing is performed on the target MOCK service cluster.

8. A device for processing an interface request, characterized in that: include: The first judgment module is used to judge whether a MOCK request sent by the designated interface under test is received; A first processing module, configured to extract key information from the MOCK request and record the current first system time; An acquisition module, used to acquire a target MOCK rule matching the key information; A second processing module, used to generate a response message corresponding to the MOCK request based on the target MOCK rule, and record the current second system time; A second judgment module is used to generate an actual time consumption based on the second system time and the first system time, and judge whether the actual time consumption is greater than a preset maximum response time; A third processing module is used to send the response message to the designated interface and obtain the number of extended nodes based on a preset extension strategy; The fourth processing module is used to start the target MOCK service node that matches the number of the extended nodes, and update the MOCK service cluster based on the target MOCK service node to obtain the target MOCK service cluster; The distribution module is used to distribute the newly received MOCK request polling to all MOCK service nodes in the target MOCK service cluster.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the method for processing an interface request as claimed in any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the method for processing an interface request according to any one of claims 1 to 7 are implemented.