Interface evaluation method, device, equipment, and storage medium based on test indicators
Through the interface evaluation method based on test indicators, the test and operation information of third-party interfaces in the property management system is automatically associated and recorded, and the problem of low efficiency of manual setting reference values is solved, the system development efficiency and operation reliability are improved, and the system is realized. More accurate interface evaluation.
Patent Information
- Application Number
- CN202410707615.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-06-03
AI Technical Summary
The functional modules of the third-party interface in the property management system are distributed in a dispersed manner, and manual reference values are inefficient and prone to errors, which affects the normal operation of the system.
Using an interface evaluation method based on test indicators, obtain test call information through multiple test calls, determine the test indicator and its corresponding indicator test value, automatically associate it with the target third-party interface, record the operation call information, and use the indicator test value and the operation call. Information determines the operation evaluation results of the interface without manually setting the reference value.
It improves the development efficiency and operation reliability of the property management system, accurately characterizes the actual operation of third-party interfaces, and improves the accuracy and reliability of interface evaluation.
Smart Images

Figure CN118733411B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of interface calling, and in particular to an interface evaluation method, device, equipment and storage medium based on test indicators. Background Art
[0002] At present, property management systems are becoming popular, and residents and property management personnel can perform relevant property operations in the property management system, thereby improving property management efficiency and improving resident experience. In the field of property management, there are many types of events involved and the span of the field is large. It is usually necessary to connect multiple third-party systems to the property management system and provide different data support through different third-party systems. For example, after formulating a funding plan through the planning management system, it is imported into the property management system, or the property management system constructs a payment contract for the relevant compensation amount through interaction with the contract system. Therefore, the property management system is equipped with a large number of third-party interfaces, and relevant data is called from the third-party system through different third-party interfaces to run the control logic of the property management system.
[0003] In related technologies, corresponding reference values are usually configured for third-party interfaces when writing codes. When the property management system is running, the error reporting mechanism of the third-party interface is triggered according to the reference value. For example, when the response time through the third-party interface exceeds the reference value, a connection abnormality is prompted, and when the number of call errors of the third-party interface exceeds the reference value, an interface abnormality is prompted. However, the third-party interfaces of the property management system are distributed more dispersedly in the functional modules, and multiple third-party interfaces involved in the same functional module may correspond to different third-party systems. Manually setting reference values is very inefficient and prone to errors, affecting the normal operation of the property management system. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes an interface evaluation method, device, equipment, and storage medium based on test indicators, which can automatically save the index test value of the test indicator after the third-party interface completes the test, and use the index test value to perform operation evaluation without manually setting the reference value, thereby improving the development efficiency and operation reliability of the property management system.
[0005] In a first aspect, an embodiment of the present invention provides an interface evaluation method based on a test indicator, which is applied to a property management system, wherein the property management system includes a target third-party interface, and the target third-party interface is used to interact with a third-party system for data. The interface evaluation method based on the test indicator includes:
[0006] Perform multiple test calls on the target third-party interface to obtain multiple test call information, and determine the indicator test values corresponding to each of the multiple preset test indicators based on the test call information, wherein the test call information is used to indicate the call result and call performance of each test call;
[0007] After determining that the target third-party interface has passed the test and has been activated, associating the corresponding test indicator and the indicator test value to the target third-party interface;
[0008] Whenever a run call is made to the target third-party interface, corresponding run call information is recorded, and the indicator run value corresponding to each of the test indicators is determined based on all the recorded run call information, wherein the run call information is used to indicate the call result and call performance of each run call;
[0009] An operation evaluation result of the target third-party interface is determined based on the indicator operation value and the indicator test value corresponding to the same test indicator.
[0010] According to some embodiments of the present invention, the property management system includes a plurality of available functional modules, each of which includes a plurality of available third-party interfaces, and the available third-party interfaces are used to perform data interaction with the third-party system.
[0011] Perform multiple test calls on the target third-party interface to obtain multiple test call information, including:
[0012] When the target test code is obtained, a preset first code, a second code and a third code are injected into the target test code, wherein the first code is used to record the interface call result, the second code is used to record the interface call performance, and the third code is used to generate an interface identifier;
[0013] Determine at least one target functional module from the plurality of available functional modules based on the target test code, and determine a target third-party interface from the plurality of available third-party interfaces of each of the target functional modules;
[0014] Synchronously initiate a test call to each of the target third-party interfaces based on the target test code, generate a test call result for each interface call based on the first code, generate test performance information for each interface call based on the second code, and add a target interface identifier of the corresponding target third-party interface to the test call result and the test performance information based on the third code;
[0015] The test call result and the test performance information corresponding to each target third-party interface are determined based on the target interface identifier, and the test call result and the test performance information obtained in the same call are combined into the test call information.
[0016] According to some embodiments of the present invention, after determining the indicator test values corresponding to each of the plurality of preset test indicators based on the test call information, the method further includes:
[0017] Obtaining a preset indicator threshold value of each of the test indicators, and applying the indicator threshold value to each of the target third-party interfaces;
[0018] When the indicator test value of the target third-party interface meets the indicator threshold of the corresponding test indicator, it is determined that the target third-party interface test has passed.
[0019] According to some embodiments of the present invention, after performing multiple test calls on the target third-party interface to obtain multiple test call information, the method further includes:
[0020] Determine the module test value corresponding to each test indicator based on all the test call information corresponding to the same target functional module;
[0021] When the module test value meets the indicator threshold of the corresponding test indicator, all the target third-party interfaces corresponding to the target functional module are activated.
[0022] According to some embodiments of the present invention, after determining that the target third-party interface test passes, the method further includes:
[0023] Obtaining a target error code from a preset error code set, wherein the error code set includes a plurality of candidate error codes, the candidate error codes are used to indicate an error call operation, the error call operations corresponding to different candidate error codes are different from each other, the error call operation is used to call system data that does not belong to the third-party system, or the error call operation is used to increase a random delay time before the target third-party interface returns data;
[0024] Based on the target error code, the target third-party interface that has passed the test is called once, and the indicator test value is updated based on the error call information, wherein the error call information is the test call information obtained based on the target error code;
[0025] When the updated indicator test value does not meet the indicator threshold, it returns to the indicator test value before the update;
[0026] Alternatively, when the updated indicator test value meets the indicator threshold, the error call operation and the error call information corresponding to the target error code are recorded;
[0027] A next target error code is obtained from the error code set, the index test value is updated again based on the next target error code, and obtaining a new target error code is stopped after the index test value no longer meets the index threshold.
[0028] According to some embodiments of the present invention, after determining the operation evaluation result of the target third-party interface based on the indicator operation value and the indicator test value corresponding to the same test indicator, the method further includes:
[0029] When the operation evaluation result is used to characterize an operation abnormality, the target third-party interface corresponding to the indicator operation value is determined as an abnormal third-party interface;
[0030] When the abnormal third-party interface records the erroneous call operation and the erroneous call information, based on the target interface identifier of the abnormal third-party interface, the operation call information obtained during each operation call is acquired;
[0031] When the same error calling information is matched based on the running calling information, the error calling operation corresponding to the matched error calling information is determined as the abnormal root cause operation.
[0032] According to some embodiments of the present invention, after determining the erroneous call operation corresponding to the matched erroneous call information as the abnormal root cause operation, the method further includes:
[0033] Determine the data type of the third-party data called by each of the target third-party interfaces from the third-party system;
[0034] When the data type is used to indicate static data, when the target third-party interface is called multiple times and is determined to be the abnormal third-party interface for the first time, the third-party data obtained when the abnormal third-party interface was last called is determined as the return data of this call.
[0035] In a second aspect, an embodiment of the present invention provides an interface evaluation device based on test indicators, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the interface evaluation method based on test indicators as described in the first aspect above.
[0036] In a third aspect, an embodiment of the present invention provides an electronic device, comprising the interface evaluation device based on test indicators as described in the second aspect above.
[0037] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the interface evaluation method based on test indicators as described in the first aspect above.
[0038] According to the interface evaluation method based on test indicators of the embodiment of the present invention, there are at least the following beneficial effects: multiple test calls are made to the target third-party interface to obtain multiple test call information, and the indicator test values corresponding to each of the multiple preset test indicators are determined based on the test call information, wherein the test call information is used to indicate the call result and call performance of each test call; after determining that the target third-party interface has passed the test and is activated, the corresponding test indicator and the indicator test value are associated with the target third-party interface; whenever the target third-party interface is run once, the corresponding run call information is recorded, and the indicator run value corresponding to each test indicator is determined based on all the recorded run call information, wherein the run call information is used to indicate the call result and call performance of each run call; the run evaluation result of the target third-party interface is determined based on the indicator run value and the indicator test value corresponding to the same test indicator. According to the technical solution of the embodiment of the present invention, the indicator test value when the third-party interface test passes can be used as the reference value during operation, without manually setting the reference value, thereby improving the development efficiency of the property management system, and the indicator test value can better characterize the actual operation of the third-party interface, effectively improving the accuracy and reliability of the third-party interface operation evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a schematic diagram of a property management system provided by an embodiment of the present invention;
[0040] Figure 2 is a flow chart of an interface evaluation method based on test indicators provided by another embodiment of the present invention;
[0041] Figure 3 is a complete flow chart of an interface evaluation method based on test indicators provided by another embodiment of the present invention;
[0042] Figure 4 It is a structural diagram of an interface evaluation device based on test indicators provided by another embodiment of the present invention. DETAILED DESCRIPTION
[0043] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0044] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0045] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0046] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0047] The embodiment of the present invention provides an interface evaluation method, device, equipment, and storage medium based on test indicators, wherein the interface evaluation method based on test indicators includes: performing multiple test calls on the target third-party interface to obtain multiple test call information, and determining the indicator test values corresponding to each of the multiple preset test indicators based on the test call information, wherein the test call information is used to indicate the call result and call performance of each test call; after determining that the target third-party interface has passed the test and is activated, associating the corresponding test indicator and the indicator test value to the target third-party interface; each time an operation call is performed on the target third-party interface, recording the corresponding operation call information, and determining the indicator operation value corresponding to each of the test indicators based on all the recorded operation call information, wherein the operation call information is used to indicate the call result and call performance of each operation call; determining the operation evaluation result of the target third-party interface based on the indicator operation value and the indicator test value corresponding to the same test indicator. According to the technical solution of the embodiment of the present invention, the indicator test value when the third-party interface test passes can be used as a reference value during operation, without the need to manually set the reference value, thereby improving the development efficiency of the property management system. Moreover, the indicator test value can better represent the actual operation of the third-party interface, effectively improving the accuracy and reliability of the third-party interface operation evaluation.
[0048] First, refer to Figure 1 , Figure 1 This is a schematic diagram of a property management system provided by an embodiment of the present invention. The property management system 10 of this embodiment includes a target third-party interface 11, and the target third-party interface 11 is used to perform data interaction with a third-party system 20.
[0049] Among them, the target third-party interface 11 can be a functional interface in any functional module in the property management system 10 for data interaction with the third-party system 20, such as reading data from the third-party system 20, or sending data in the property management system 10 to the third-party system 20, or sending data in the property management system 10 to the third-party system 20 for processing, and then the third-party system 20 feeds back the result data to the property management system 10. This embodiment does not limit the specific function of the target third-party interface 11, as long as it can form data interaction with the third-party system 20.
[0050] Among them, the property management system 10 may include multiple target third-party interfaces 11. In the case of multiple target third-party interfaces 11, the technical solution of this embodiment can be executed for each target third-party interface 11 respectively, and will not be repeated later.
[0051] The following is based on the Figure 1 The property management system shown further illustrates the technical solution of the embodiment of the present invention.
[0052] Reference Figure 2 , Figure 2 A flowchart of an interface evaluation method based on test indicators provided by an embodiment of the present invention, the interface evaluation method based on test indicators includes but is not limited to the following steps:
[0053] S10, performing multiple test calls on the target third-party interface to obtain multiple test call information, and determining the indicator test values corresponding to each of the multiple preset test indicators based on the test call information, wherein the test call information is used to indicate the call result and call performance of each test call;
[0054] S20, after determining that the target third-party interface has passed the test and has been activated, associating the corresponding test indicator and the indicator test value with the target third-party interface;
[0055] S30, whenever a run call is made to the target third-party interface, the corresponding run call information is recorded, and the indicator run value corresponding to each test indicator is determined based on all the recorded run call information, wherein the run call information is used to indicate the call result and call performance of each run call;
[0056] S40, determining an operation evaluation result of the target third-party interface based on the indicator operation value and the indicator test value corresponding to the same test indicator.
[0057] It should be noted that the test call can be triggered by a common test case. During the development phase of the property management system, the target third-party interface is called through the test case, and the relevant information is recorded during the call process of the target third-party interface, so as to obtain the test call information of each call. For example, during the test call, a response message is usually fed back to determine whether the interface call is successful, so the call result can be determined based on the response information, such as a successful call, a failed call, or a call timeout; for example, if data feedback is involved during the interface call, the response time of the third-party system feedback data can be recorded, and the call performance of the target third-party interface can be characterized by the response time.
[0058] It should be noted that the test indicators can be set according to the needs, such as call success rate, call error rate, exception frequency, response time, etc. After obtaining the test call information according to the method of the above embodiment, the corresponding indicator test value can be calculated according to the specific test indicators.
[0059] Exemplarily, the test call information includes call results and response time. After 10 calls, the number of successful calls is determined to be 7 times, the number of error calls is 2 times, and the number of exceptions is 1 time based on the results of each call. The success rate is calculated to be 70% based on the number of successful calls and the total number of times, the error rate is calculated to be 20% based on the number of error calls and the total number of times, and the exception rate is calculated to be 10% based on the number of exceptions and the total number of times. The average of multiple response times is calculated to be 2 milliseconds. Therefore, the obtained indicator test values include a success rate of 70%, a failure rate of 20%, an exception rate of 10% and an average time of 2 milliseconds.
[0060] It should be noted that after the target third-party interface test is passed, the test values of each indicator can be determined to be values that meet the actual operating requirements. For example, after the test is passed, it can be determined that the average duration of the indicator test value of 2 milliseconds is able to meet the needs of the property management system. Therefore, the indicator test value can be used as a reference value for the response time of the target third-party interface. Compared with the reference value set during operation based on manual experience, the indicator test value is the value obtained during the actual operation of the target third-party interface, which can be closer to the actual operating status of the target third-party interface, and can automatically determine the reference value during operation, and can also improve the accuracy of the reference value.
[0061] It should be noted that before the target third-party interface passes the test, the target third-party interface will not be put into actual operation. Therefore, the index test value is saved in the property management system as data in the test process. After the target third-party interface passes the test, the property management system automatically associates the index test value with the target third-party interface, so that the target third-party interface automatically configures the reference value for the operation evaluation as the test passes. The operation call information can refer to the test call information. The only difference is that the stage of information collection is the operation stage. For example, the operation call information can also be the call result and response time of the target third-party interface. It will not be repeated here. It is necessary to ensure that the operation call information corresponds to the test indicator for which the index test value has been obtained. The operation call information is recorded after each call of the target third-party interface is completed, and the historical data is accumulated and calculated to obtain the index operation value, and the operation evaluation result is determined based on the comparison between the index operation value and the test operation value.
[0062] Exemplarily, the indicator test values take the test success rate and the test average response time as examples. After completing the Nth run call (N is a natural number), the Nth call result and response time are recorded, and the run success rate and the run average response time are calculated based on the results of the previous N calls. The test success rate is compared based on the run success rate. When the run success rate is greater than or equal to the test success rate, and the run average response time is less than or equal to the test average response time, the run evaluation result of the target third-party interface is determined to be normal. Otherwise, if any condition is not met, the run evaluation result can be determined to be abnormal.
[0063] Through the technical solution of this embodiment, the indicator test value when the test passes can be used as a reference value during operation. When the target third-party interface is running, the indicator operation value generated during the call is compared with the indicator test value to determine the operation evaluation result of the target third-party interface. There is no need to manually set the operation reference value, and automatic matching of the operation reference value can be achieved. In addition, the indicator test value is generated by calling the target third-party interface during the test process, so the indicator test value is closer to the actual response state of the target third-party interface, so that the indicator test value can more accurately represent the normal operating state of the target third-party interface, thereby improving the reliability of the operation evaluation result.
[0064] In addition, in one embodiment, the property management system includes a plurality of available functional modules, each of which includes a plurality of available third-party interfaces, and the available third-party interfaces are used to interact with third-party systems for data. Figure 3 , Figure 2 The step S10 shown also includes but is not limited to the following steps:
[0065] S11, when the target test code is obtained, injecting a preset first code, a second code and a third code into the target test code, wherein the first code is used to record the interface call result, the second code is used to record the interface call performance, and the third code is used to generate an interface identifier;
[0066] S12, determining at least one target functional module from a plurality of available functional modules based on the target test code, and determining a target third-party interface from a plurality of available third-party interfaces of each target functional module;
[0067] S13, synchronously initiate a test call to each target third-party interface based on the target test code, generate a test call result for each interface call based on the first code, generate test performance information for each interface call based on the second code, and add a target interface identifier of the corresponding target third-party interface to the test call result and the test performance information based on the third code;
[0068] S14, determining the test call result and test performance information corresponding to each target third-party interface based on the target interface identifier, and combining the test call result and test performance information obtained in the same call into test call information.
[0069] It should be noted that the target test code can be obtained by parsing the test case. The target test code is used to call the target functional module and trigger the call of each target third-party interface in the process of running the target functional module. Each target test code can call any number of target functional modules. This embodiment does not limit the number of target functional modules.
[0070] It should be noted that the target test code can call some of the available third-party interfaces in the target function module. The same available function module can include available third-party interfaces for data interaction with different third-party systems, and the target third-party interface can be one or more of the available third-party interfaces. For example, the third-party systems connected to the property management system include the capital planning system, the database system, and the financial system. The target function module A includes third-party interface A, third-party interface B, third-party interface C, and third-party interface D. Third-party interface A belongs to the capital planning system, third-party interface B and third-party interface C belong to the database system, third-party interface B is used to obtain amount data, third-party interface C is used to obtain employee data, and third-party interface D belongs to the financial system. The target test code is used to test the acquisition of amount data from the database according to the capital plan, and then generate a payment contract through the financial system. Therefore, the target third-party interface includes third-party interface A, third-party interface B, and third-party interface D.
[0071] It should be noted that the present embodiment does not limit the specific composition of the first code, the second code and the third code, and it is sufficient that the corresponding functions can be realized. The first code, the second code and the third code are universal functional codes, that is, they can play the same role in any target functional module. The first code feeds back the test call result after calling each third-party interface, so the first code can determine whether the third-party interface is successfully called according to the feedback information of the interface call; the second code determines the test performance information after calling each third-party interface, such as the above-mentioned response time. The second code can start the timing when initiating the interface call, and end the timing after obtaining the feedback data of the target third-party interface, so as to determine the response time of the target third-party interface; after each call of the target third-party interface to obtain the test call result and test performance information, since the target functional module can include multiple target third-party interfaces, an identifier is required to distinguish the information of different interfaces. In the present embodiment, the target interface identifier is added to the test call result and the test performance information through the third code. The target interface identifier can be composed of the name of the third-party system and the target third-party interface, or other encoding methods can be used to ensure that the target interface identifiers of different target third-party interfaces are unique. After the target test code is executed, the test call information of different target third-party interfaces can be distinguished according to the target interface identifier, and then various test indicators can be calculated according to the method of the above embodiment.
[0072] In addition, in one embodiment, referring to Figure 3 After executing Figure 2 After step S10, the following steps are also included but not limited to:
[0073] S15, obtaining a preset indicator threshold value of each test indicator, and applying the indicator threshold value to each target third-party interface;
[0074] S16, when the indicator test value of the target third-party interface meets the indicator threshold of the corresponding test indicator, it is determined that the target third-party interface test has passed.
[0075] It should be noted that, for multiple target third-party interfaces connected to a third-party system, although the call data are different, the index threshold can be the same. For example, the test index includes the call success rate and the average response time. The index threshold corresponding to the call success rate is 95%, and the index threshold corresponding to the average response time is 2 milliseconds. Then each target third-party interface needs to meet the call success rate greater than or equal to 95%, and the average response time is less than or equal to 2 milliseconds. It is worth noting that the application of the same index threshold to each target third-party interface does not mean that the index test values of each target third-party interface are the same during actual operation. For example, the index test value of the call success rate of the target third-party interface A is 97%, and 97% is used as the evaluation reference value of the call success rate during operation. The index test value of the call success rate of the target third-party interface B is 99%, and 99% is used as the evaluation reference value during operation. Therefore, this embodiment uses the same index threshold as the judgment standard for each target third-party interface test to pass. After the test passes, it can still ensure that each target third-party interface uses the same or different index test values for operation evaluation, thereby improving the flexibility of the numerical value.
[0076] In addition, in one embodiment, referring to Figure 3 After executing Figure 2 After step S10, the following steps are also included but not limited to:
[0077] S17, determining the module test value corresponding to each test indicator based on all test call information corresponding to the same target functional module;
[0078] S18, when the module test value meets the indicator threshold of the corresponding test indicator, all target third-party interfaces corresponding to the target functional module are activated.
[0079] It should be noted that, according to the principles of the above-mentioned embodiments, test evaluation can be performed based on the test call information of each target third-party interface. The target third-party interface belongs to the target functional module, and the target functional module needs to pass the test as a whole before being put into use. Therefore, after the index test values of some target third-party interfaces in the target functional module meet the index threshold, it is necessary to further determine whether the target functional module meets the index threshold.
[0080] It should be noted that the module test value of the target functional module can be determined based on all the test call information. For example, the target functional module includes 10 target third-party interfaces. After 10 calls are made to each of them, the number of successful calls of each target third-party interface is counted, and then 100 is used as the total number to calculate the call success rate of the target functional module. When the call success rate is greater than the indicator threshold, it can be determined that the target functional module meets the test requirements and all its subordinate target third-party interfaces are activated.
[0081] In addition, in one embodiment, referring to Figure 3 After executing step S16, the following steps are also included but not limited to:
[0082] S161, obtaining a target error code from a preset error code set, wherein the error code set includes a plurality of candidate error codes, the candidate error codes are used to indicate an error call operation, different candidate error codes correspond to different error call operations, the error call operation is used to call system data that does not belong to a third-party system, or the error call operation is used to increase a random delay time before the target third-party interface returns data;
[0083] S162, calling a target third-party interface that has passed a test based on a target error code, and updating an indicator test value based on error call information, wherein the error call information is test call information obtained based on the target error code;
[0084] S163, when the updated index test value does not meet the index threshold, roll back to the index test value before the update;
[0085] S164, when the updated indicator test value meets the indicator threshold, record the error call operation and error call information corresponding to the target error code;
[0086] S165, obtaining the next target error code from the error code set, updating the index test value again based on the next target error code, and stopping obtaining a new target error code after the index test value no longer meets the index threshold.
[0087] It should be noted that the present embodiment pre-sets multiple groups of candidate error codes, and triggers the abnormal call of the target third-party interface through the candidate error codes, thereby forming error call information during the abnormal call, and can accumulate reference information during the abnormal call while ensuring that the target third-party interface passes the test, so that when an abnormality occurs in the actual operation of the target third-party interface, rapid abnormal diagnosis can be achieved through the matching of error call information. For example, the error call operation corresponding to the candidate error code may include modifying the index information of the data called from the target third-party interface, so that the correct data cannot be obtained from the third-party system when the target third-party interface is called, thereby causing an interface call error; for another example, the error call operation may be to generate a random delay time after obtaining the data, and complete the response of the target third-party interface after waiting for the random delay time, thereby extending the response time of the target third-party interface.
[0088] It should be noted that the target error code is called after the target third-party interface test passes, and the target third-party interface is called once based on the target error code, thereby triggering an error call operation, and reducing the index test value in exchange for an error call information as reference information for abnormal diagnosis during normal operation. At the same time, after the target error code is triggered, it is necessary to ensure that the updated index test value meets the index threshold. For example, after referencing the target error code, an error call caused by a data identification error is triggered, thereby reducing the call success rate in the test index. If the reduced call success rate meets the index threshold, it can be determined that the target third-party interface will still pass the test. On this basis, an error call information sample is added. If a data identification error occurs during the actual call, fast and automatic abnormal diagnosis can be achieved based on the saved error call information, thereby improving the reliability of the property management system.
[0089] It should be noted that, in this embodiment, each time a target error code is called, after the error call operation and error call information are collected, an update of the indicator test value is performed. If the updated indicator test value meets the indicator threshold, a new target error code is selected from the remaining candidate error codes, and the above operation is repeated again. If the indicator test value still meets the indicator threshold after the update, one more error call operation and error call information can be added to the sample library of abnormal calls. If the updated indicator test value does not meet the indicator threshold, the operation is abandoned and the indicator test value is rolled back to before the update. In this way, while ensuring that the target third-party interface passes the test, as many error call operations and error call information that can be used for running diagnosis as possible are added.
[0090] In addition, in one embodiment, referring to Figure 3 After executing Figure 2 After step S40, the following steps are also included but not limited to:
[0091] S41, when the operation evaluation result is used to characterize the operation abnormality, the target third-party interface corresponding to the indicator operation value is determined as an abnormal third-party interface;
[0092] S42, when the abnormal third-party interface records an erroneous call operation and erroneous call information, based on the target interface identifier of the abnormal third-party interface, obtain the operation call information obtained during each operation call;
[0093] S43, when the same error call information is matched based on the running call information, the error call operation corresponding to the matched error call information is determined as the abnormal root cause operation.
[0094] It should be noted that during the operation process, by comparing the index test value and the index operation value, it is determined whether the target third-party interface is operating abnormally. After determining the abnormal operation, the corresponding target third-party interface is determined as an abnormal third-party interface. According to the description of the above embodiment, if the abnormal third-party interface records multiple error call information and error call operations during the test phase, each pair of associated error call operations and error call information can be used as a logical embodiment of an abnormality, and the error call operation is used to represent the call operation that causes the abnormality, and the error call information is used to represent the data level embodiment of the call abnormality. On this basis, since the first code, the second code, and the third code are injected, the operation call information of each operation call can be obtained based on the target interface identifier of the abnormal third-party interface, and the operation call information is matched with the error call information to achieve automatic diagnosis, and the error call operation associated with the successfully matched error call information is determined as the abnormal root cause operation.
[0095] Exemplarily, when the operation call information of the abnormal third-party interface indicates that the response time is greater than 5 milliseconds when requesting data A from the third-party system, and the error call operation corresponding to the response time greater than 5 milliseconds in the error call information is calling data A that does not belong to the third-party system, then it can be determined that the root cause operation of the exception is calling data that does not belong to the third-party system. Of course, the root cause operation of the exception in this embodiment is the result of automatic diagnosis, which is used to perform preliminary exception positioning for developers, not to ensure the correct root cause of the exception.
[0096] In addition, in one embodiment, referring to Figure 3 After executing step S43, the following steps are also included but not limited to:
[0097] S44, determining the data type of the third-party data called from the third-party system by each target third-party interface;
[0098] S45, when the data type is used to indicate static data, when the target third-party interface is called multiple times and is determined to be an abnormal third-party interface for the first time, the third-party data obtained when the abnormal third-party interface was last called is determined as the return data of this call.
[0099] It should be noted that each target third-party interface can call multiple third-party data from the third-party system. The third-party data usually includes static data and dynamic data. Static data is pre-set and unchanged data in the third-party system, such as the name of the owner of each resident in the property management. This data does not change frequently, so it is usually set as static data. Dynamic data is data that changes dynamically at runtime, such as the remaining parking spaces in the parking lot in the property management. This data changes dynamically as vehicles enter and exit.
[0100] It should be noted that when making data calls, since the third-party system and property management system targeted by this embodiment do not belong to the same system, data interaction requires the help of a communication network. It is very likely that data calls will fail due to various situations. For example, the network is interrupted when calling the target third-party interface, resulting in the inability to normally obtain the data fed back by the third-party system. On this basis, it is easy to be judged as an abnormal third-party interface due to the long response time. After determining the abnormal third-party interface, this embodiment first determines whether the target data called is static data. If the target data called is static data, and the abnormal third-party interface is not called for the first time, it can be determined that the target data called previously is cached in the property management system. If a call exception occurs, the third-party data called during the last runtime is used as the return data for this time, which can achieve data compensation when the call is abnormal, first ensure the normal operation of the property management system, and then perform relevant abnormality positioning, thereby improving the reliability of the property management system.
[0101] like Figure 4 As shown, Figure 4 : is a structural diagram of an interface evaluation device based on test indicators provided by an embodiment of the present invention. The present invention also provides an interface evaluation device based on test indicators, comprising:
[0102] The processor 401 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0103] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 402 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 402, and the processor 401 calls and executes the interface evaluation method based on the test index of the embodiment of this application;
[0104] Input / output interface 403, used to implement information input and output;
[0105] Communication interface 404, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);
[0106] A bus 404 that transmits information between various components of the device (e.g., processor 401, memory 402, input / output interface 403, and communication interface 404);
[0107] The processor 401 , the memory 402 , the input / output interface 403 and the communication interface 404 are connected to each other in communication within the device via the bus 405 .
[0108] An embodiment of the present application also provides an electronic device, comprising the interface evaluation device based on the test indicator as described above.
[0109] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned interface evaluation method based on test indicators is implemented.
[0110] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0111] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0112] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. An interface evaluation method based on test indicators, characterized in that: Applied to a property management system, the property management system includes a target third-party interface, the target third-party interface is used to interact with a third-party system for data, and the interface evaluation method based on the test indicator includes: Perform multiple test calls on the target third-party interface to obtain multiple test call information, and determine the indicator test values corresponding to each of the multiple preset test indicators based on the test call information, wherein the test call information is used to indicate the call result and call performance of each test call; After determining that the target third-party interface has passed the test and has been activated, associating the corresponding test indicator and the indicator test value to the target third-party interface; Whenever a run call is made to the target third-party interface, corresponding run call information is recorded, and the indicator run value corresponding to each of the test indicators is determined based on all the recorded run call information, wherein the run call information is used to indicate the call result and call performance of each run call; Based on the indicator operation value and the indicator test value corresponding to the same test indicator, the operation evaluation result of the target third-party interface is determined by comparing the indicator test value and the indicator operation value.
2. The interface evaluation method based on test indicators according to claim 1 is characterized in that: The property management system includes a plurality of available functional modules, each of which includes a plurality of available third-party interfaces, and the available third-party interfaces are used to perform data interaction with the third-party system. Perform multiple test calls on the target third-party interface to obtain multiple test call information, including: When the target test code is obtained, a preset first code, a second code and a third code are injected into the target test code, wherein the first code is used to record the interface call result, the second code is used to record the interface call performance, and the third code is used to generate an interface identifier; Determine at least one target functional module from the plurality of available functional modules based on the target test code, and determine a target third-party interface from the plurality of available third-party interfaces of each of the target functional modules; Synchronously initiate a test call to each of the target third-party interfaces based on the target test code, generate a test call result for each interface call based on the first code, generate test performance information for each interface call based on the second code, and add a target interface identifier of the corresponding target third-party interface to the test call result and the test performance information based on the third code; The test call result and the test performance information corresponding to each target third-party interface are determined based on the target interface identifier, and the test call result and the test performance information obtained in the same call are combined into the test call information.
3. The interface evaluation method based on test indicators according to claim 2 is characterized in that: After determining the indicator test values corresponding to each of the plurality of preset test indicators based on the test call information, the method further includes: Obtaining a preset indicator threshold value of each of the test indicators, and applying the indicator threshold value to each of the target third-party interfaces; When the indicator test value of the target third-party interface meets the indicator threshold of the corresponding test indicator, it is determined that the target third-party interface test has passed.
4. The interface evaluation method based on test indicators according to claim 3 is characterized in that: After performing multiple test calls on the target third-party interface to obtain multiple test call information, the method further includes: Determine the module test value corresponding to each test indicator based on all the test call information corresponding to the same target functional module; When the module test value meets the indicator threshold of the corresponding test indicator, all the target third-party interfaces corresponding to the target functional module are activated.
5. The interface evaluation method based on test indicators according to claim 3 is characterized in that: After determining that the target third-party interface test passes, the method further includes: Obtaining a target error code from a preset error code set, wherein the error code set includes a plurality of candidate error codes, the candidate error codes are used to indicate an error call operation, the error call operations corresponding to different candidate error codes are different from each other, the error call operation is used to call system data that does not belong to the third-party system, or the error call operation is used to increase a random delay time before the target third-party interface returns data; Based on the target error code, the target third-party interface that has passed the test is called once, and the indicator test value is updated based on the error call information, wherein the error call information is the test call information obtained based on the target error code; When the updated indicator test value does not meet the indicator threshold, it returns to the indicator test value before the update; Alternatively, when the updated indicator test value meets the indicator threshold, the error call operation and the error call information corresponding to the target error code are recorded; A next target error code is obtained from the error code set, the index test value is updated again based on the next target error code, and obtaining a new target error code is stopped after the index test value no longer meets the index threshold.
6. The interface evaluation method based on test indicators according to claim 5 is characterized in that: After determining the operation evaluation result of the target third-party interface based on the indicator operation value and the indicator test value corresponding to the same test indicator, the method further includes: When the operation evaluation result is used to characterize an operation abnormality, the target third-party interface corresponding to the indicator operation value is determined as an abnormal third-party interface; When the abnormal third-party interface records the erroneous call operation and the erroneous call information, based on the target interface identifier of the abnormal third-party interface, the operation call information obtained during each operation call is acquired; When the same error calling information is matched based on the running calling information, the error calling operation corresponding to the matched error calling information is determined as the abnormal root cause operation.
7. The interface evaluation method based on test indicators according to claim 6 is characterized in that: After determining the erroneous call operation corresponding to the matched erroneous call information as the abnormal root cause operation, the method further includes: Determine the data type of the third-party data called by each of the target third-party interfaces from the third-party system; When the data type is used to indicate static data, when the target third-party interface is called multiple times and is determined to be the abnormal third-party interface for the first time, the third-party data obtained when the abnormal third-party interface was last called is determined as the return data of this call.
8. An interface evaluation device based on test indicators, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the interface evaluation method based on test indicators as described in any one of claims 1 to 7.
9. An electronic device, characterized in that: It includes the interface evaluation device based on test indicators as described in claim 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the interface evaluation method based on test indicators as described in any one of claims 1 to 7.
