CN112199281A - Data processing method and device, terminal equipment and readable storage medium - Google Patents

Data processing method and device, terminal equipment and readable storage medium Download PDF

Info

Publication number
CN112199281A
CN112199281A CN202011070315.5A CN202011070315A CN112199281A CN 112199281 A CN112199281 A CN 112199281A CN 202011070315 A CN202011070315 A CN 202011070315A CN 112199281 A CN112199281 A CN 112199281A
Authority
CN
China
Prior art keywords
interface
data
data interaction
interaction interface
target data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011070315.5A
Other languages
Chinese (zh)
Inventor
范群星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202011070315.5A priority Critical patent/CN112199281A/en
Publication of CN112199281A publication Critical patent/CN112199281A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging

Abstract

The embodiment of the application provides a data processing method, a data processing device, terminal equipment and a readable storage medium, wherein the data processing method comprises the following steps: receiving a data interaction interface debugging instruction input aiming at a client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged; determining a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to the client to be debugged; calling the target data interaction interface, and if the calling of the target data interaction interface fails, acquiring first interface data corresponding to the target data interaction interface, wherein the first interface data comprises cache interface data or simulation interface data; and performing function test on the client to be debugged based on the first interface data. By the method, the data processing method capable of improving debugging efficiency between the data interaction interfaces of the client and the corresponding server is provided.

Description

Data processing method and device, terminal equipment and readable storage medium
Technical Field
The present application relates to the field of testing, and in particular, to a data processing method and apparatus, a terminal device, and a readable storage medium.
Background
Currently, web page development is usually performed by using a front-end and back-end separation method, which means: the front end (or client) and the back end (or server) can be developed in parallel in the development process, and data interaction of the front end and the back end is maintained by establishing a data interaction interface through negotiation. However, when the front end and the back end perform data interaction, a part of data interaction interfaces (i.e., unavailable interfaces) that cannot be called by the front end exist at the back end often due to deployment problems, code problems, environmental problems, associated system problems, and the like, and further, data interaction interfaces associated with the unavailable interfaces (or having logical dependencies) cannot be called normally. Therefore, when the front end is subjected to functional test, the data interaction interface needs to be debugged repeatedly to determine that the front end can call the data interaction interface to realize the front end functional test, so that the development cost of front end development is increased. Therefore, in the existing webpage development mode, the debugging efficiency between the client and the data interaction interface of the corresponding server is low.
Disclosure of Invention
The embodiment of the application provides a data processing method, a data processing device, terminal equipment and a readable storage medium.
In a first aspect, an embodiment of the present application provides a data processing method, where the method is applied to a terminal device deployed with a client to be debugged, and the method includes:
receiving a data interaction interface debugging instruction input by the client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged;
determining a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to the client to be debugged;
calling the target data interaction interface, and if the calling of the target data interaction interface fails, acquiring first interface data corresponding to the target data interaction interface, wherein the first interface data comprise cache interface data corresponding to the target data interaction interface, or simulation interface data generated by the server based on a pre-deployed data generation mechanism;
and performing function test on the client to be debugged based on the first interface data.
In a second aspect, an embodiment of the present application provides a data processing apparatus, where the apparatus is configured to a terminal device in which a client to be debugged is deployed, and the apparatus includes:
the acquisition module is used for receiving a data interaction interface debugging instruction input by the client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged;
the processing module is used for determining a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to the client to be debugged;
the processing module is also used for calling the target data interaction interface;
the obtaining module is further configured to obtain first interface data corresponding to the target data interaction interface if the target data interaction interface fails to be called, where the first interface data includes cache interface data corresponding to the target data interaction interface, or simulation interface data generated by the server based on a pre-deployed data generation mechanism;
the processing module is further configured to perform a function test on the client to be debugged based on the first interface data.
In a third aspect, an embodiment of the present application provides a terminal device, where the terminal device includes an input device and an output device, and the terminal device further includes a processor, and is adapted to implement one or more instructions, where the one or more instructions are adapted to be loaded by the processor and execute the data processing method according to the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute the data processing method of the first aspect.
In the embodiment of the application, the terminal equipment receives the debugging instruction of the data interaction interface input aiming at the client to be debugged, the data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged, so that the terminal equipment can determine a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to a client to be debugged, further, the terminal equipment can call the target data interaction interface, if the target data interaction interface fails to be called, the terminal equipment acquires first interface data corresponding to the target data interaction interface, the first interface data comprises cache interface data corresponding to a target data interaction interface, or simulation interface data generated based on a data generation mechanism pre-deployed for the target data interaction interface, and the function test is performed on the client to be debugged based on the first interface data. By the mode, the stability of the data interaction interface of the back end (or the server corresponding to the client) is ensured, and the debugging efficiency between the data interaction interface of the client and the data interaction interface of the corresponding server is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a system architecture diagram of a data processing system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of another data processing method provided in the embodiments of the present application;
FIG. 4 is a schematic diagram of a prompt message provided by an embodiment of the present application;
fig. 5 is a schematic diagram of an execution logic of an application scenario of a data processing method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Please refer to fig. 1, which is a system framework diagram of data processing provided in an embodiment of the present application, wherein the data processing system includes a terminal device 10 configured with a client to be debugged, and a server 11 including at least one data interaction interface.
The terminal device 10 receives a data interaction interface debugging instruction input by a user for a client to be debugged, where the data interaction interface debugging instruction includes identification information of a data interaction interface to be debugged. Further, the terminal device 10 may determine a target data interaction interface matched with the identification information from at least one data interaction interface included in the server 11, and call the target data interaction interface, and if the target data interaction interface fails to be called, obtain first interface data corresponding to the target data interaction interface, where the first interface data includes cache interface data corresponding to the target data interaction interface, or simulation interface data generated by the server based on a pre-deployed data generation mechanism, and further, the terminal device 10 may perform a function test on the to-be-debugged client based on the first interface data. By the mode, when the front end (client) performs function test, the cache interface data or the simulation interface data corresponding to the target data interaction interface can be obtained under the condition that the calling of the target data interaction interface fails, so that the stability of the back end data interaction interface is ensured, and the debugging efficiency between the client and the data interaction interface of the corresponding server is improved.
It should be understood that the server mentioned in the embodiment of the present application is not limited to one server, and may be a server cluster. The terminal device is provided with at least one client to be debugged, the number of the clients to be debugged is not specifically limited in the embodiment of the application, and only the scene of one client to be debugged is exemplarily described. At least one of the embodiments mentioned in the present application is one or more.
Please refer to fig. 2, which is a schematic flowchart of a data processing method provided in an embodiment of the present application, where the data processing method is applied to a terminal device deployed with a client to be debugged, and the data processing method includes the following steps:
s201: and receiving a data interaction interface debugging instruction input aiming at the client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of the data interaction interface to be debugged.
And a user aims at a data interaction interface debugging instruction input by the client to be debugged, wherein the data interaction interface debugging instruction is used for testing whether the client to be debugged can call the data interaction interface to be debugged to acquire data. And the terminal equipment receives the data interaction interface debugging instruction input aiming at the client to be debugged. The data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged, wherein the identification information is used for identifying a unique data interaction interface, such as the name or the number of the data interaction interface. For example, the data interaction interface debugging instruction may be an Asynchronous JAVAScript and XML (Asynchronous JAVAScript and XML, AJAX) request.
S202: and determining a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to the client to be debugged.
And the terminal equipment determines a target data interaction interface matched with the identification information from a plurality of data interaction interfaces included in a server corresponding to the client to be debugged according to the data interaction interface debugging instruction. For example, the data interaction interface debugging instruction input for the client to be debugged is: "call the data interaction interface with the number of 01 to obtain the target interface data", then the terminal device connects to the server, and the number of the data interaction interface included in the server includes: the data interaction interface 01, the data interaction interface 02 and the data interaction interface 03. And the terminal equipment determines the data interaction interface numbered as the data interaction interface 01 in the server as a target data interaction interface.
S203: and calling the target data interaction interface, and if the calling of the target data interaction interface fails, acquiring first interface data corresponding to the target data interaction interface.
The first interface data comprises cache interface data corresponding to the target data interaction interface, or simulation interface data generated by the server based on a pre-deployed data generation mechanism. The pre-deployed data generation mechanism may be a mock generation (mock.js) mechanism.
And the terminal equipment calls the target data interaction interface and determines target interface data according to the calling state of the target data interaction interface. And if the calling of the target data interaction interface fails, acquiring first interface data corresponding to the target data interaction interface.
In one embodiment, after the terminal device calls the target data interaction interface, an interface calling state for the target data interaction interface is obtained, where the interface calling state includes an interface connection state and a data return state. And when the interface connection state is a failure state and/or the data return state is a failure state, the target data interaction interface is considered to be failed to call. Otherwise, when the interface connection state is a success state and the data return state is a success state, the target data interaction interface is considered to be successfully called.
It should be understood that the interface connection status may be reflected by a preset connection status code, and the preset connection status code corresponds to the interface connection status one to one. The preset connection state code is set by a developer according to an experimental scene, and corresponding adjustment can be performed subsequently according to a specific application scene. For example, when the predetermined connection status code is 200, the interface connection status is a successful status, and when the predetermined connection status code is 400, the interface connection status is a failed status. The data return state may be reflected by a preset data return state code, where the preset data return state code corresponds to the data return state one to one, for example, when the preset data return state code is 1, the data return state is a success state, when the preset data return state code is 2, the data return state is a failure state, and when the preset data return state code is 3, the data return state is an abnormal state.
In an embodiment, the foregoing data interaction interface debugging instruction may further include first data format information, that is, data format information corresponding to data that is expected to be returned by the server through the data interaction interface to be debugged by the client to be debugged is the first data format information. In this case, if the format information of the data returned by the server to the client to be debugged through the data interaction interface to be debugged is the second data format information. And when the second data format information does not match (or is different from) the first data format information, the target data interaction interface is considered to be failed to call. For example, the first data format information included in the data interaction interface debugging instruction is text format txt, and the second data format information of the data returned by the server to the client to be debugged through the data interaction interface to be debugged is picture format jpg, which is considered that the target data interaction interface is failed to be called.
In an embodiment, if the target data interaction interface is successfully called, the terminal device performs a function test on the to-be-debugged client based on second interface data returned by the server through the target data interaction interface. And the terminal equipment determines the second interface data as cache interface data corresponding to the target data interaction interface, and stores the identification information of the target data interaction interface and the cache interface data corresponding to the target data interaction interface in a cache space in an associated manner. By the mode, a local cache strategy is realized, namely when the target data interaction interface is successfully called, the interface data is stored into a cache space as cache interface data corresponding to the data interaction interface so that data acquisition fails, the cache interface data corresponding to the target data interaction interface can be acquired from the cache space, and the front end (or the client) is ensured to have available data. After the identification information of the target data interaction interface and the cache interface data corresponding to the target data interaction interface are stored in the cache space in an associated manner, the terminal device may further record the storage time of the cache interface data.
It should be known that the manner of storing the cache interface data corresponding to the target data interaction interface in association with the identification information of the target data interaction interface may be one or more of a small text file (cookie), a local storage (local storage), and a session storage (session storage).
In an embodiment, the cache interface data is provided with an effective duration, after the identification information of the target data interaction interface and the cache interface data corresponding to the target data interaction interface are stored in the cache space in an associated manner, the terminal device may further obtain a system time and a storage time for storing the cache interface data in the storage space, and determine a difference between the system time and the storage time as a lifetime of the cache interface data. Further, if the lifetime is longer than the valid duration, the cache interface data is deleted in the cache space. By the mode, the cache space is dynamically managed, so that the memory of the cache space is saved. The effective duration is obtained by the developer through measurement and calculation according to the experimental scene data, and corresponding adjustment can be subsequently performed according to a specific application scene, which is not specifically limited.
Illustratively, the valid duration of the cache interface data 1 is 5 days, in this case, the terminal device obtains the current system time as 10-day and the current system time as 2020 and 8-month and 4-day and zero-point of the cache interface data stored in the storage space, and according to the difference between the system time and the storage time as 6 days, that is, the lifetime of the cache interface data is 6 days and is longer than the valid time, the terminal device deletes the cache interface data 1 from the cache space.
It should be understood that the terminal device may periodically compare the lifetime and the valid duration of the cache interface data according to a preset time period, where the preset time period is obtained by a developer through measurement and calculation according to experimental scene data, and may subsequently perform corresponding adjustment according to a specific application scene, which is not specifically limited. For example, the terminal device may use 3 days as a preset time period to periodically detect the lifetime of the cache interface data, that is, the terminal device compares the lifetime of the cache interface data with the effective duration every 3 days, and deletes the cache interface data from the cache space when the lifetime is longer than the effective duration. The terminal device may also detect the lifetime of the cache interface data according to the received detection command, for example, when the terminal device detects that the remaining cache space of the cache space is smaller than the preset threshold, it is regarded that the terminal device receives the detection command, the lifetime of the cache interface data is compared with the effective lifetime, and when the lifetime is longer than the effective lifetime, the terminal device deletes the cache interface data from the cache space. The preset threshold is obtained by the developer through measurement and calculation according to experimental scene data, and corresponding adjustment can be subsequently performed according to a specific application scene, which is not specifically limited.
S204: and performing function test on the client to be debugged based on the first interface data.
And the terminal equipment performs function test on the client to be debugged according to the first interface data, wherein the function test refers to testing the function of the client to be debugged by using the first interface data, and the function test can comprise link test, form test, navigation test, graphic test, integral interface test and the like. For example, when the function test is a form test, after the terminal device obtains the first interface data, the first interface data may be displayed in a display interface of the client to be debugged in a form of a form; when the function test is a link test, whether a page connected in the client to be debugged exists or is correct can be tested according to the first interface data; when the function test is a navigation test, the terminal device may determine whether the page structure of the client to be debugged is easy for page navigation jump or the like according to the first interface data.
In the embodiment of the application, the terminal device receives a data interaction interface debugging instruction input by a client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged. Further, the terminal device may determine a target data interaction interface matched with the identification information from at least one data interaction interface included in the server corresponding to the client to be debugged, and call the target data interaction interface, and if the target data interaction interface fails to be called, obtain first interface data corresponding to the target data interaction interface, and perform a function test on the client to be debugged based on the first interface data. By the method, the cache interface data or the simulation interface data corresponding to the target data interaction interface can be acquired when the front-end calling of the target data interaction interface fails, so that the stability of the back-end data interaction interface is ensured, and the debugging efficiency between the client and the data interaction interface of the corresponding server is improved.
Please refer to fig. 3, which is a schematic flow chart of another data processing method provided in an embodiment of the present application, where the data processing method is applied to a terminal device deployed with a client to be debugged, and the data processing method includes the following steps:
s301: and receiving a data interaction interface debugging instruction input aiming at the client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of the data interaction interface to be debugged.
S302: and determining a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to the client to be debugged.
For specific implementation manners of steps S301 to S302, reference may be made to the specific implementation manners of steps S201 to S202 in the foregoing embodiment, and details are not repeated here.
S303: and calling the target data interaction interface, and if the calling of the target data interaction interface fails, inquiring whether cache interface data corresponding to the target data interaction interface exists in a cache space according to the identification information of the target data interaction interface.
And the terminal equipment calls the target data interaction interface, if the calling fails, the identification information of the target data interaction interface is matched with the identification information of the data interaction interface corresponding to each cache interface data in the cache space, and if the matching succeeds, the cache space is determined to have the cache interface data corresponding to the target data interaction interface. And if the matching fails, determining that the cache space does not have cache interface data corresponding to the target data interaction interface. Illustratively, the cache interface data included in the cache space is shown in table 1.
TABLE 1
Caching interface identification information Caching data
Data interaction interface 1 Caching data 1
Data interaction interface 2 Caching data 2
Data interaction interface 3 Buffer data 3
When the identification information of the target data interaction interface is the data interaction interface 2, the terminal device matches the identification information of the target data interaction interface with the cache interface identification information in the cache space (i.e. table 1), and if the matching is successful, it is determined that cache interface data corresponding to the target data interaction interface exists in the cache space. When the identification information of the target data interaction interface is the data interaction interface 4, matching the identification information of the target data interaction interface with the cache interface identification in the cache space (namely, table 1), and determining that the cache interface data corresponding to the target data interaction interface does not exist in the cache space if the matching fails.
S304: if the cache interface data corresponding to the target data interaction interface exists in the cache space, the cache interface data corresponding to the target data interaction interface is obtained, and the cache interface data corresponding to the target data interaction interface is determined as the first interface data.
If the terminal equipment determines that the cache interface data corresponding to the target data interaction interface exists in the cache space according to the identification information of the target data interaction interface, the terminal equipment acquires the cache interface data corresponding to the target data interaction interface and determines the cache interface data corresponding to the target data interaction interface as first interface data.
In an embodiment, if the target data interaction interface fails to be called, the terminal device may further record one or more of identification information of the target data interaction interface, identification information of the client to be debugged, and time information for acquiring the cache interface and the data, and further, the terminal device generates an interface call log for the target data interaction interface according to one or more of the identification information of the target data interaction interface, the identification information of the client to be debugged, and the time information for acquiring the cache interface and the data, and outputs the interface call log. For example, the interface call log may be: and in 13 hours of 8, 10 and 10 in 2020, 18 minutes, the client A to be debugged fails to call the data interaction interface 1, and in 13 hours of 8, 10 and 10 in 2020, 19 minutes, cache interface data corresponding to the data interaction interface 1 in the cache space is obtained.
In an embodiment, if the cache interface data corresponding to the target data interaction interface does not exist in the cache space, sending indication information to a server, where the indication information is used to indicate the server to generate the simulation interface data based on a pre-deployed data generation mechanism, and returning the simulation interface data to the terminal device. And if the terminal equipment receives the analog interface data returned by the server, determining the analog interface data as first interface data.
If the terminal device determines that the cache interface data corresponding to the target data interaction interface does not exist in the cache space, that is, when the data interaction interface identification information corresponding to the cache interface data in the cache space is not matched with the target data interaction interface identification information, the terminal device determines that the terminal device is in the early stage of web page development at this time, and connectivity test of a front end (client) and a back end (server) is being performed, the terminal device may send indication information to the server, where the indication information may include identification information of the target data interaction interface, and after receiving the indication information, the server generates, based on a pre-deployed data generation mechanism, for example, a mock-js mechanism, analog interface data corresponding to the target data interaction interface, and sends the analog interface data to the terminal device. The terminal equipment receives the analog interface data and determines the analog interface data as first interface data.
In one embodiment, if the simulation interface data returned by the server is not received, prompt information is output, wherein the prompt information is used for indicating that the debugging instruction of the data interaction interface is wrong.
If the terminal device does not have the cache interface data corresponding to the target data interaction interface in the cache space and does not receive the simulation interface data returned by the server, the terminal device may output the prompt information as shown in fig. 4, where the prompt information is used to prompt the user that the debugging instruction of the data interaction interface is wrong, and possible reasons for the mistake include: the data interaction interface to be debugged does not exist; and debugging the instruction format error of the input data interaction interface.
S305: and performing function test on the client to be debugged based on the first interface data.
For a specific implementation manner of step S305, reference may be made to the specific implementation manner of step S204 in the foregoing embodiment, and details are not repeated here.
In an application scenario, the execution logic of the data processing method described in the embodiment of the present application is shown in fig. 5. The terminal equipment receives a data interaction interface debugging instruction input by a client to be debugged, determines a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to the client to be debugged, calls the target data interaction interface to acquire interface data, associates and stores the interface data and the identification information of the target data interaction interface in a cache space if the interface data is successfully acquired by calling the target data interaction interface, and performs function test on the client to be debugged according to the interface data. If the calling of the target data interaction interface to acquire the interface data fails, inquiring whether cache interface data corresponding to the target data interaction interface exist in a cache space, and if the cache interface data corresponding to the target data interaction interface exist in the cache space, performing function test on the client to be debugged according to the cache interface data. If the cache interface data corresponding to the target data interaction interface does not exist in the cache space, sending indication information to the server to indicate the server to generate simulation interface data based on a pre-deployed mock-JS mechanism according to the indication information, sending the simulation interface data to the terminal equipment, and if the terminal equipment acquires the simulation interface data returned by the server, carrying out function test on the client to be debugged according to the simulation interface data by the terminal equipment. And if the terminal equipment does not receive the simulation interface data returned by the server, outputting error prompt information.
In the embodiment of the application, the terminal device receives a data interaction interface debugging instruction input by a client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged. Further, the terminal device may determine a target data interaction interface matched with the identification information from at least one data interaction interface included in the server corresponding to the client to be debugged, and call the target data interaction interface, and if the target data interaction interface fails to be called, query whether cache interface data corresponding to the target data interaction interface exists in the cache space according to the identification information of the target data interaction interface. If the cache interface data corresponding to the target data interaction interface exists in the cache space, the terminal device obtains the cache interface data corresponding to the target data interaction interface, determines the cache interface data corresponding to the target data interaction interface as first interface data, and performs function test on the client to be debugged based on the first interface data. By the method, the cache interface data corresponding to the target data interaction interface can be acquired when the front-end calling of the target data interaction interface fails, so that the interface data corresponding to the target data interaction interface can be acquired from the back-end (server) during the function test of the front-end (client), the influence of instability of the server interface on the function test of the client is reduced, and the debugging efficiency between the client and the data interaction interface of the corresponding server is improved.
Referring to fig. 6, a schematic structural diagram of a data processing apparatus according to an embodiment of the present application is shown, where the apparatus is configured to a terminal device where a client to be debugged is deployed, and the apparatus includes:
an obtaining module 60, configured to receive a data interaction interface debugging instruction input for the client to be debugged, where the data interaction interface debugging instruction includes identification information of a data interaction interface to be debugged;
the processing module 61 is configured to determine a target data interaction interface matched with the identification information from at least one data interaction interface included in the server corresponding to the client to be debugged;
the processing module 61 is further configured to invoke the target data interaction interface;
the obtaining module 60 is further configured to obtain, if the target data interaction interface fails to be called, first interface data corresponding to the target data interaction interface, where the first interface data includes cache interface data corresponding to the target data interaction interface, or simulation interface data generated by the server based on a pre-deployed data generation mechanism;
the processing module 61 is further configured to perform a function test on the client to be debugged based on the first interface data.
In an embodiment, the output module 62 is further configured to perform, if the target data interaction interface is successfully called, a function test on the client to be debugged based on second interface data returned by the server through the target data interaction interface; the processing module 61 is further configured to determine the second interface data as cache interface data corresponding to the target data interaction interface, and store the identification information of the target data interaction interface and the cache interface data corresponding to the target data interaction interface in a cache space in an associated manner.
In an embodiment, the cache interface data has an effective duration, and after the identification information of the target data interaction interface and the cache interface data corresponding to the target data interaction interface are stored in a cache space in an associated manner, the obtaining module 60 is further configured to obtain a system time and a storage time from the cache interface data to the cache space; the processing module 61 is further configured to determine a difference between the system time and the storage time as a lifetime of the cache interface data; and if the survival time is longer than the effective time, deleting the cache interface data in the cache space.
In an embodiment, the processing module 61 is specifically configured to, if the target data interaction interface fails to be called, query whether cache interface data corresponding to the target data interaction interface exists in the cache space according to identification information of the target data interaction interface; the obtaining module 60 is specifically configured to, if the cache interface data corresponding to the target data interaction interface exists in the cache space, obtain the cache interface data corresponding to the target data interaction interface, and determine the cache interface data corresponding to the target data interaction interface as the first interface data.
In an embodiment, the processing module 61 is further configured to record one or more of identification information of the target data interaction interface, identification information of the client to be debugged, and time information for acquiring the cache interface data if the target data interaction interface fails to be called; and generating an interface call log aiming at the target data interaction interface according to one or more of the identification information of the target data interaction interface, the identification information of the client to be debugged and the time information for acquiring the cache interface data. The device further comprises an output module 62, wherein the output module 62 is used for outputting the interface call log.
In an embodiment, the output module 62 is further configured to send, if cache interface data corresponding to the target data interaction interface does not exist in the cache space, indication information to the server, where the indication information is used to indicate the server to generate simulated interface data based on the pre-deployed data generation mechanism, and return the simulated interface data to the terminal device; the processing module 61 is further configured to determine the analog interface data as first interface data if the analog interface data returned by the server is received.
In an embodiment, the output module 62 is further configured to output a prompt message if the simulated interface data returned by the server is not received, where the prompt message is used to indicate that the data interaction interface debugging instruction is incorrect.
It should be noted that the functions of each unit module of the data processing apparatus described in the embodiment of the present application may be specifically implemented according to the method in the method embodiment described in fig. 2 or fig. 3, and the specific implementation process may refer to the description related to the method embodiment in fig. 2 or fig. 3, which is not described herein again.
Based on the description of the method embodiment and the apparatus item embodiment, the embodiment of the present application further provides a terminal device. Referring to fig. 7, the terminal device may include at least a processor 701, an input device 702, an output device 703 and a memory 704; the processor 701, the input device 702, the output device 703, and the memory 704 may be connected by a bus or other connection. The memory 704 may also include a computer-readable storage medium for storing a computer program comprising program instructions, the processor 701 being configured to execute the program instructions stored by the memory 704. The processor 701 (or CPU) is a computing core and a control core of the terminal device, and is adapted to implement one or more instructions, and specifically, adapted to load and execute the one or more instructions so as to implement the corresponding method flow or the corresponding function in the data Processing method embodiment. Wherein the processor 701 is configured to call the program instruction to perform: receiving a data interaction interface debugging instruction input by the client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged; determining a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to the client to be debugged; calling the target data interaction interface, and if the calling of the target data interaction interface fails, acquiring first interface data corresponding to the target data interaction interface, wherein the first interface data comprises cache interface data corresponding to the target data interaction interface, or simulation interface data generated based on a data generation mechanism pre-deployed for the target data interaction interface; and performing function test on the client to be debugged based on the first interface data.
In an embodiment, the processor 701 is further configured to perform, if the target data interaction interface is successfully called, a function test on the client to be debugged based on second interface data returned by the server through the target data interaction interface; and determining the second interface data as cache interface data corresponding to the target data interaction interface, and storing the identification information of the target data interaction interface and the cache interface data corresponding to the target data interaction interface in a cache space in an associated manner.
In an embodiment, the cache interface data has an effective duration, and after the identification information of the target data interaction interface and the cache interface data corresponding to the target data interaction interface are stored in a cache space in an associated manner, the processor 701 is further configured to obtain a system time and a storage time from the cache interface data to the cache space; determining the difference between the system time and the storage time as the survival time of the cache interface data; and if the survival time is longer than the effective time, deleting the cache interface data in the cache space.
In an embodiment, the processor 701 is specifically configured to, if the invocation of the target data interaction interface fails, query whether cache interface data corresponding to the target data interaction interface exists in the cache space according to identification information of the target data interaction interface; if the cache interface data corresponding to the target data interaction interface exists in the cache space, the cache interface data corresponding to the target data interaction interface is obtained, and the cache interface data corresponding to the target data interaction interface is determined as first interface data.
In an embodiment, the processor 701 is further configured to record one or more of identification information of the target data interaction interface, identification information of the client to be debugged, and time information for acquiring the cache interface data if the target data interaction interface fails to be invoked; and generating an interface call log aiming at the target data interaction interface according to one or more of the identification information of the target data interaction interface, the identification information of the client to be debugged and the time information for acquiring the cache interface data, and outputting the interface call log.
In an embodiment, the processor 701 is further configured to send, if cache interface data corresponding to the target data interaction interface does not exist in the cache space, indication information to the server, where the indication information is used to indicate the server to generate simulated interface data based on the pre-deployed data generation mechanism, and return the simulated interface data to the terminal device; and if the simulation interface data returned by the server are received, determining the simulation interface data as first interface data.
In an embodiment, the processor 701 is further configured to output a prompt message if the simulated interface data returned by the server is not received, where the prompt message is used to indicate that the data interaction interface debugging instruction is incorrect.
It should be understood that, in the embodiment of the present Application, the Processor 701 may be a Central Processing Unit (CPU), and the Processor 701 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete a hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 704 may include both read-only memory and random-access memory, and provides instructions and data to the processor 701. A portion of the memory 704 may also include non-volatile random access memory. For example, the memory 704 may also store device type information. The input device 702 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user), a microphone, a physical keyboard, etc., and the output device 703 may include a display (LCD, etc.), a speaker, etc.
In specific implementation, the processor 701, the memory 704, the input device 702, and the output device 703 described in this embodiment of the present application may perform the implementation described in the method embodiment shown in fig. 2 or fig. 3 provided in this embodiment of the present application, and may also perform the implementation method of the data processing apparatus described in fig. 6 in this embodiment of the present application, which is not described herein again.
In another embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, where the computer program includes program instructions, and the program instructions, when executed by a processor, implement the implementation described in the method implementation in fig. 2 or fig. 3 provided in this application, where the computer-readable storage medium may be an internal storage unit of a terminal device, such as a hard disk or a memory of the terminal device, in any of the foregoing embodiments. The computer readable storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the terminal device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the terminal device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above.
The readable storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the present disclosure has been described with reference to particular embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present disclosure.

Claims (10)

1. A data processing method is applied to a terminal device with a client to be debugged, and comprises the following steps:
receiving a data interaction interface debugging instruction input by the client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged;
determining a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to the client to be debugged;
calling the target data interaction interface, and if the calling of the target data interaction interface fails, acquiring first interface data corresponding to the target data interaction interface, wherein the first interface data comprise cache interface data corresponding to the target data interaction interface, or simulation interface data generated by the server based on a pre-deployed data generation mechanism;
and performing function test on the client to be debugged based on the first interface data.
2. The method of claim 1, further comprising:
if the target data interaction interface is successfully called, performing a function test on the client to be debugged based on second interface data returned by the server through the target data interaction interface;
and determining the second interface data as cache interface data corresponding to the target data interaction interface, and storing the identification information of the target data interaction interface and the cache interface data corresponding to the target data interaction interface in a cache space in an associated manner.
3. The method according to claim 2, wherein the cache interface data is provided with a valid duration, and after the identification information of the target data interaction interface and the cache interface data corresponding to the target data interaction interface are stored in the cache space in an associated manner, the method further comprises:
acquiring system time and storage time of the cache interface data stored in the cache space;
determining the difference between the system time and the storage time as the survival time of the cache interface data;
and if the survival time is longer than the effective time, deleting the cache interface data in the cache space.
4. The method according to claim 3, wherein the obtaining first interface data corresponding to the target data interaction interface if the target data interaction interface fails to be called comprises:
if the calling of the target data interaction interface fails, whether cache interface data corresponding to the target data interaction interface exist in the cache space or not is inquired according to the identification information of the target data interaction interface;
if the cache interface data corresponding to the target data interaction interface exists in the cache space, the cache interface data corresponding to the target data interaction interface is obtained, and the cache interface data corresponding to the target data interaction interface is determined as first interface data.
5. The method of claim 4, further comprising:
if the calling of the target data interaction interface fails, recording one or more of identification information of the target data interaction interface, identification information of the client to be debugged and time information for acquiring the cache interface data;
and generating an interface call log aiming at the target data interaction interface according to one or more of the identification information of the target data interaction interface, the identification information of the client to be debugged and the time information for acquiring the cache interface data, and outputting the interface call log.
6. The method of claim 4, further comprising:
if the cache interface data corresponding to the target data interaction interface does not exist in the cache space, sending indication information to the server, wherein the indication information is used for indicating the server to generate simulation interface data based on the pre-deployed data generation mechanism and returning the simulation interface data to the terminal equipment;
and if the simulation interface data returned by the server are received, determining the simulation interface data as first interface data.
7. The method of claim 6, further comprising:
and if the simulation interface data returned by the server are not received, outputting prompt information, wherein the prompt information is used for indicating that the data interaction interface debugging instruction is wrong.
8. A data processing apparatus, wherein the apparatus is configured to deploy a terminal device to which a client to be debugged is disposed, the data processing apparatus comprising:
the acquisition module is used for receiving a data interaction interface debugging instruction input by the client to be debugged, wherein the data interaction interface debugging instruction comprises identification information of a data interaction interface to be debugged;
the processing module is used for determining a target data interaction interface matched with the identification information from at least one data interaction interface included in a server corresponding to the client to be debugged;
the processing module is also used for calling the target data interaction interface;
the obtaining module is further configured to obtain first interface data corresponding to the target data interaction interface if the target data interaction interface fails to be called, where the first interface data includes cache interface data corresponding to the target data interaction interface, or simulation interface data generated by the server based on a pre-deployed data generation mechanism;
the processing module is further configured to perform a function test on the client to be debugged based on the first interface data.
9. A terminal device, characterized in that the terminal device comprises a processor and a storage means, the processor and the storage means being interconnected, wherein the storage means is adapted to store a computer program, the computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method according to any one of claims 1 to 7.
10. A computer storage medium having stored thereon program instructions for implementing the method of any one of claims 1-7 when executed.
CN202011070315.5A 2020-09-30 2020-09-30 Data processing method and device, terminal equipment and readable storage medium Pending CN112199281A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011070315.5A CN112199281A (en) 2020-09-30 2020-09-30 Data processing method and device, terminal equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011070315.5A CN112199281A (en) 2020-09-30 2020-09-30 Data processing method and device, terminal equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112199281A true CN112199281A (en) 2021-01-08

Family

ID=74013716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011070315.5A Pending CN112199281A (en) 2020-09-30 2020-09-30 Data processing method and device, terminal equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112199281A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051510A (en) * 2021-03-05 2021-06-29 北京百度网讯科技有限公司 Interactive processing method and device, front-end equipment, back-end equipment and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899106A (en) * 2014-03-07 2015-09-09 阿里巴巴集团控股有限公司 Processing method and processing device when interface service is abnormal
CN108268369A (en) * 2016-12-30 2018-07-10 北京国双科技有限公司 Test data acquisition methods and device
CN108563567A (en) * 2018-04-09 2018-09-21 平安普惠企业管理有限公司 Automated testing method, device, equipment and computer readable storage medium
CN108833355A (en) * 2018-05-21 2018-11-16 深圳云之家网络有限公司 Data processing method, device, computer equipment and computer readable storage medium
CN109688202A (en) * 2018-12-04 2019-04-26 北京腾云天下科技有限公司 A kind of processing method of interface data, calculates equipment and storage medium at device
CN110334246A (en) * 2019-07-08 2019-10-15 北京字节跳动网络技术有限公司 A kind of data request processing method, apparatus, terminal device and storage medium
CN110704307A (en) * 2019-09-09 2020-01-17 平安普惠企业管理有限公司 Application product testing method and device, user equipment and computer storage medium
CN110727580A (en) * 2019-09-03 2020-01-24 深圳壹账通智能科技有限公司 Response data generation method, full-flow interface data processing method and related equipment
CN110727587A (en) * 2019-09-20 2020-01-24 平安普惠企业管理有限公司 Test data acquisition method and device, storage medium and computer equipment
CN111159269A (en) * 2019-12-30 2020-05-15 北京奇艺世纪科技有限公司 Data processing method, device and system
CN111367691A (en) * 2020-03-09 2020-07-03 北京奇艺世纪科技有限公司 Data feedback method and device, electronic equipment and storable medium
CN111427766A (en) * 2020-02-20 2020-07-17 北京齐尔布莱特科技有限公司 Request processing method and device and proxy server
CN111510482A (en) * 2020-04-09 2020-08-07 广州酷狗计算机科技有限公司 Method and device for determining failed network request and computer storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899106A (en) * 2014-03-07 2015-09-09 阿里巴巴集团控股有限公司 Processing method and processing device when interface service is abnormal
CN108268369A (en) * 2016-12-30 2018-07-10 北京国双科技有限公司 Test data acquisition methods and device
CN108563567A (en) * 2018-04-09 2018-09-21 平安普惠企业管理有限公司 Automated testing method, device, equipment and computer readable storage medium
CN108833355A (en) * 2018-05-21 2018-11-16 深圳云之家网络有限公司 Data processing method, device, computer equipment and computer readable storage medium
CN109688202A (en) * 2018-12-04 2019-04-26 北京腾云天下科技有限公司 A kind of processing method of interface data, calculates equipment and storage medium at device
CN110334246A (en) * 2019-07-08 2019-10-15 北京字节跳动网络技术有限公司 A kind of data request processing method, apparatus, terminal device and storage medium
CN110727580A (en) * 2019-09-03 2020-01-24 深圳壹账通智能科技有限公司 Response data generation method, full-flow interface data processing method and related equipment
CN110704307A (en) * 2019-09-09 2020-01-17 平安普惠企业管理有限公司 Application product testing method and device, user equipment and computer storage medium
CN110727587A (en) * 2019-09-20 2020-01-24 平安普惠企业管理有限公司 Test data acquisition method and device, storage medium and computer equipment
CN111159269A (en) * 2019-12-30 2020-05-15 北京奇艺世纪科技有限公司 Data processing method, device and system
CN111427766A (en) * 2020-02-20 2020-07-17 北京齐尔布莱特科技有限公司 Request processing method and device and proxy server
CN111367691A (en) * 2020-03-09 2020-07-03 北京奇艺世纪科技有限公司 Data feedback method and device, electronic equipment and storable medium
CN111510482A (en) * 2020-04-09 2020-08-07 广州酷狗计算机科技有限公司 Method and device for determining failed network request and computer storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051510A (en) * 2021-03-05 2021-06-29 北京百度网讯科技有限公司 Interactive processing method and device, front-end equipment, back-end equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111177005B (en) Service application testing method, device, server and storage medium
US11893331B2 (en) Device verification method, UVM verification platform, electronic apparatus and storage medium
CN108170552B (en) Method, device and equipment for capturing Dump file
CN108459850B (en) Method, device and system for generating test script
CN108038039B (en) Method for recording log and micro-service system
CN111597110B (en) Page test method and device, electronic equipment and storage medium
US11269705B2 (en) Method and apparatus for outputting information
CN108874441B (en) Board card configuration method, device, server and storage medium
CN112732499A (en) Test method and device based on micro-service architecture and computer system
CN112100070A (en) Version defect detection method and device, server and storage medium
CN110046086B (en) Expected data generation method and device for test and electronic equipment
CN111309602A (en) Software testing method, device and system
CN112199281A (en) Data processing method and device, terminal equipment and readable storage medium
CN115276844B (en) Communication module testing method and device, storage medium and electronic equipment
CN111638439A (en) Communication module testing method, device, computer equipment and storage medium
CN112395194B (en) Method and device for accessing test platform
CN113986676A (en) Server health check method and device, electronic equipment and storage medium
CN114338846A (en) Message testing method and device
CN108845932B (en) Unit testing method and device of network library, storage medium and terminal
CN113220362A (en) Log record obtaining method and device, computer equipment and storage medium
US10671505B2 (en) System and method for monitoring service
CN113760631A (en) Page loading duration determination method, device, equipment and storage medium
CN111008147B (en) Application program testing method, terminal and computer readable storage medium
CN117407460A (en) Cross-environment data synchronization method and device, storage medium and electronic equipment
CN113220510A (en) Device detection method, detection device, and computer-readable storage medium

Legal Events

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