A service interface self-test method, system, readable storage medium and device
Through the automated service interface self-test method, the service is registered to the service pool, parameters are assembled and replaced, and service requests and robustness judgments are made. This solves the time-consuming and labor-intensive problem of service interface docking and debugging, and improves development efficiency.
Patent Information
- Application Number
- CN202410684464.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the service interface docking process, manual debugging is time-consuming and laborious, especially when there are a large number of service interfaces in the service bus system, resulting in low debugging efficiency.
By registering the service into the service pool, determining the target interface address, obtaining and assembling the parameter prototype, replacing test data, generating test request data, making service requests according to the service invocation strategy, making robustness judgments, and executing the above steps in a loop to complete Self-test.
It implements automated service interface self-test, detects whether the service interface is correct, and outputs the input and output parameters after the self-test, which improves the development speed and reduces the time and energy of manual debugging.
Smart Images

Figure CN118277280B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of service interface self-test, and in particular relates to a service interface self-test method, system, readable storage medium and device. Background Art
[0002] Services are provided by the lower layer to the upper layer through the inter-layer interface. It should be noted that not all functions completed in a layer are called services. Only those functions that can be seen by entities in a higher layer can be called "services". Interfaces are the transmitters of services, and through interfaces, the lower layer can provide services to the upper layer.
[0003] When developing a system, you often encounter service interface docking. When docking the service interface, errors such as different service interfaces or inaccurate parameters passed to the service interface often occur, which wastes a lot of time on debugging. It is understandable that the service bus (HSB) system has nearly 200 service interfaces built in. If you test them one by one manually, it will be time-consuming and laborious. Summary of the invention
[0004] Based on this, the embodiments of the present invention provide a service interface self-test method, system, readable storage medium and device to solve the problem of time-consuming and labor-intensive manual debugging of the service interface in the prior art.
[0005] A first aspect of an embodiment of the present invention provides a service interface self-test method, the method comprising:
[0006] Step 1: Register the service in the service pool, where the service includes the service address, service name and parameter prototype. The service pool is a storage area running in the memory.
[0007] Step 2: determine the target interface address, and query the corresponding service according to the target interface address;
[0008] Step 3: Obtain the parameter prototype in the service obtained by querying in step 2, assemble the preset parameters in the parameter prototype, and replace the test data to obtain the test request data, wherein the preset parameters include name, category, type, belonging object and associated object, the name is the name of the object or field, the category includes objects and fields, specifically including:
[0009] Get the names of all objects according to their category;
[0010] Loop through each object, match and group the object name with the data of the object to which it belongs, and obtain all the fields of each object in groups to obtain several target groups;
[0011] Assembling the target group according to the associated objects to obtain target data;
[0012] According to the type, the target data is replaced to obtain test request data, wherein the target data is replaced with a default value corresponding to each type;
[0013] Step 4: Perform a service request according to the test request data and the service call strategy, and obtain a service request return value;
[0014] Step 5: Determine the robustness of the service based on the return value of the service request;
[0015] Step 6: Repeat steps 3 to 5.
[0016] Furthermore, in the step of determining the target interface address and querying the corresponding service based on the target interface address, the service request path of the target interface address is formed by concatenating the service address and the service name in accordance with regulations, wherein the service name is placed after the service address and “ / ” is added between them to obtain the target interface address.
[0017] Furthermore, in the step of looping through each object, matching and grouping the object name with the data of the object to which it belongs, and obtaining all the fields of each object in groups to obtain several target groups, the data type of the field to be replaced in each target group uses the existing type name as data placeholder.
[0018] Furthermore, the step of looping through each object, matching and grouping the object name with the data of the object to which it belongs, and obtaining all the fields of each object in groups to obtain a plurality of target groups includes:
[0019] Loop through each object and determine the number of target groups based on the number of objects;
[0020] According to the number of target groups, generate blank groups that are arranged in order of the corresponding objects;
[0021] Match the object name with the data of the object to which it belongs, and list them in the corresponding blank group;
[0022] All fields of each object are obtained by grouping to obtain several target groups.
[0023] Furthermore, the step of assembling the target group according to the associated objects to obtain the target data includes:
[0024] Determine the hierarchical relationship between target groups based on the associated objects;
[0025] Cancel the lower boundary of the parent target group and move the object names in the subordinate target group to align with the field names in the parent target group;
[0026] Add a lower boundary that matches the upper boundary of the parent's target group.
[0027] Furthermore, the service call strategy includes one-time tasks, cyclical tasks and scheduled tasks, wherein the one-time task is to manually execute the service once and then stop executing, the cyclical task is to set the service call interval, the number of service cycles, and continuously call the service until the service requirements are met, and the scheduled task is to set several execution time points for the service execution, and when the execution time point is reached, the service starts to execute the call.
[0028] A second aspect of an embodiment of the present invention provides a service interface self-test system, which is used to implement the service interface self-test method according to the first aspect, and the system includes:
[0029] A registration module is used to register a service in a service pool, wherein the service includes a service address, a service name and a parameter prototype. The service pool is a storage area running in memory;
[0030] A target interface address determination module, used to determine the target interface address and query the corresponding service according to the target interface address;
[0031] An assembling module is used to obtain the parameter prototype in the service obtained by querying in the target interface address determination module, assemble the preset parameters in the parameter prototype, and replace the test data to obtain the test request data, wherein the preset parameters include a name, a category, a type, a belonging object and an associated object, the name is the name of an object or a field, and the category includes an object and a field;
[0032] A service request module, used to make a service request according to the test request data and the service call strategy, and obtain a service request return value;
[0033] The service robustness judgment module is used to judge the service robustness according to the service request return value;
[0034] The loop module is used to loop the assembly module, the service request module and the service robustness judgment module.
[0035] A third aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the service interface self-test method provided in the first aspect.
[0036] A fourth aspect of an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the service interface self-test method provided in the first aspect when executing the program.
[0037] A service interface self-test method, system, readable storage medium and device provided in an embodiment of the present invention register a service in a service pool, wherein the service includes a service address, a service name and a parameter prototype, and the service pool is a storage area running in a memory; a target interface address is determined, and a corresponding service is queried according to the target interface address; a parameter prototype in the queried service is obtained, preset parameters in the parameter prototype are assembled, and test data is replaced to obtain test request data, wherein the preset parameters include a name, a category, a type, an object to which it belongs and an associated object, the name is the name of an object or a field, and the category includes an object and a field; a service request is made according to the test request data and a service call strategy to obtain a service request return value; a service robustness judgment is made according to the service request return value; and the steps of assembly, service request and service robustness judgment are executed in a loop to complete the self-test. Specifically, the above method can not only detect whether the service interface itself is correct, but also output the input and output parameters after the self-test for use by the service interface caller, thereby speeding up the development speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A structural block diagram of a service interface self-test system provided in Embodiment 2 of the present invention;
[0039] Figure 2 This is a structural block diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0040] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0041] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0043] Embodiment 1
[0044] A service interface self-test method provided in a first embodiment of the present invention specifically includes steps one to six.
[0045] Step 1: register the service in the service pool, wherein the service includes a service address, a service name and a parameter prototype, and the service pool is a storage area running in the memory.
[0046] Specifically, all the written services will be registered in the service pool when the service is released. The service pool is an independently developed storage area running in the memory. When other service vendors develop servers, they need to call a fixed memory registration interface, such as: http: / / 127.0.0.1:8990 / registerServ. The service needs to register the service address, service name and parameter prototype in the service pool. It should be noted that the service in the service pool is stateless, free and flat.
[0047] Step 2: determine the target interface address, and query the corresponding service according to the target interface address.
[0048] Specifically, it is necessary to use a fixed interface for obtaining the memory registration interface, such as: http: / / 127.0.0.1:8990 / queryServ. Through this interface, the relevant information of all interfaces registered in the memory can be queried, such as: service address, service name and parameter prototype. In addition, the interface can be screened and filtered according to the same service address, service name keyword, parameter prototype keyword and other conditions, and the obtained service address and service name are spliced into a complete service request path according to the regulations. In this embodiment, the service request path of the target interface address is spliced by the service address and service name according to the regulations, wherein the service name is placed after the service address, and " / " is added between them to obtain the target interface address. For example, the service address is http: / / 127.0.0.1:4567, the service name is common / addUser, and the spliced request path is: http: / / 127.0.0.1:4567 / common / addUser.
[0049] Step three, obtain the parameter prototype in the service obtained by querying in step two, assemble the preset parameters in the parameter prototype, and replace the test data to obtain the test request data.
[0050] The preset parameters include name, category, type, belonging object and associated object. Name refers to the name of the object or field. Category includes object and field. For details, please refer to the following table:
[0051]
[0052] Common data types include: strings, numbers, decimals, dates, etc.; Belonging objects: the subordinate relationship between objects and fields, such as above: the student object has three fields: name, birthday and age; Associated objects: the subordinate relationship between objects, such as above: the student object contains class object data.
[0053] The operations of step three specifically include:
[0054] Get the names of all objects according to the category, such as student objects, class objects, etc.;
[0055] Loop through each object, match and group the object name with the data of the object to which it belongs, and obtain all the fields of each object in groups to obtain several target groups. For example, through the object student, all its fields can be queried as: name, birthday and age, and through the object class, all its fields can be queried as: code and name, where the data type of the field to be replaced in each target group uses the existing type name as data placeholder. Specifically, first loop through each object, and determine the number of target groups according to the number of objects; according to the number of target groups, generate blank groups arranged in sequence belonging to the corresponding objects; match the object name with the data of the object to which it belongs, and list them in the corresponding blank group; obtain all the fields of each object in groups to obtain several target groups; assemble the target groups according to the associated objects to obtain the target data; replace the target data according to the type to obtain the test request data, where the default value corresponding to each type is used for replacement.
[0056] Exemplarily, all fields of each object are obtained by grouping, and the preliminary request parameter format of several target groups is as follows:
[0057] "student": [{
[0058] "name": "string",
[0059] "age": "number",
[0060] "Birthday": "Date"
[0061] } ]
[0063] "class": [{
[0064] "name": "string",
[0065] "Encoding": "Digital"
[0066] } ]
[0068] Understandably, the data type of the field has not yet been replaced by test data, and the existing type name is temporarily used as a data placeholder, that is, "string", "number", "date", etc. are used as data placeholders.
[0069] More specifically, the step of assembling the target group according to the associated objects to obtain the target data includes:
[0070] Determine the superior-subordinate relationship between target groups based on the associated objects; cancel the lower boundary of the superior target group, and move the object names in the subordinate target group to align with the field names in the superior target group; add a lower boundary that matches the upper boundary of the superior target group.
[0071] Exemplarily, the target group is assembled according to the associated object, and the data format of the target data obtained may be:
[0072] "student": [{
[0073] "name": "string",
[0074] "age": "number",
[0075] "Birthday": "Date"
[0076] "class": [{
[0077] "name": "string",
[0078] "Encoding": "Digital"
[0079] } ]
[0081] } ]
[0083] It can be understood that the student target group is the superior of the class target group, and the boundaries refer to "}" and "]". After canceling the lower boundary of the student target group, the object named "class" in the class target group is moved to align with the field name "birthday" in the student target group. At the same time, the data in the object class is attached.
[0084] Exemplarily, in the operation of replacing the target data according to the type to obtain the test request data, the basic principle of replacement can refer to the following table:
[0085]
[0086] It can be understood that after replacing the above target data, we can get:
[0087] "student": [{
[0088] "Name": "Zhang San",
[0089] "Age": "12",
[0090] "Birthday": "2023-11-25"
[0091] "class": [{
[0092] "Name": "Class 2",
[0093] "Encoding": "34"
[0094] } ]
[0096] } ]
[0098] Subsequent service call operations can then be performed.
[0099] Step 4: Perform a service request based on the test request data and the service call strategy to obtain a service request return value.
[0100] In this embodiment, the service call strategy includes a one-time task, a cyclical task and a scheduled task, wherein the one-time task is to stop executing the service after manually executing it once, the cyclical task is to set the service call interval, the number of service cycles, and continuously call the service until the service requirements are met, and the scheduled task is to set several execution time points for the service execution. When the execution time point is reached, the service starts to execute the call. Specifically, the service call strategy can be encoded to obtain the corresponding policy code. By inputting the policy code, the corresponding strategy is called. For example, the policy code of the one-time task is T-01, the policy code of the cyclical task is T-02, and the policy code of the scheduled task is T-03.
[0101] Step 5: Determine the robustness of the service based on the return value of the service request.
[0102] Specifically, when the service request succeeds, it can be determined whether the service request is correct based on the service request return value, that is, the service robustness can be determined based on the status code returned by the service request. For example:
[0103]
[0104] Step 6: Repeat steps 3 to 5.
[0105] In summary, the service interface self-test method in the above embodiment of the present invention is as follows: the method registers a service in a service pool, wherein the service includes a service address, a service name and a parameter prototype, and the service pool is a storage area running in the memory; determines the target interface address, and queries the corresponding service according to the target interface address; obtains the parameter prototype in the queried service, assembles the preset parameters in the parameter prototype, and replaces the test data to obtain the test request data, wherein the preset parameters include a name, a category, a type, an object to which the object belongs and an associated object, and the name is the name of an object or a field, and the category includes an object and a field; performs a service request according to the test request data and the service call strategy, and obtains a service request return value; performs a service robustness judgment according to the service request return value; loops through the steps of assembly, service request and service robustness judgment to complete the self-test. Specifically, the above method can not only detect whether the service interface itself is correct, but also output the input and output parameters after the self-test for use by the service interface caller, thereby speeding up the development.
[0106] Embodiment 2
[0107] See also Figure 1 , Figure 1 1 is a structural block diagram of a service interface self-test system 200 provided in Embodiment 2 of the present invention. The service interface self-test system 200 comprises: a registration module 21, a target interface address determination module 22, an assembly module 23, a service request module 24, a service robustness determination module 25 and a circulation module 26, wherein:
[0108] A registration module 21 is used to register a service in a service pool, wherein the service includes a service address, a service name and a parameter prototype, and the service pool is a storage area running in the memory;
[0109] The target interface address determination module 22 is used to determine the target interface address and query the corresponding service according to the target interface address, wherein the service request path of the target interface address is formed by splicing the service address and the service name according to the regulations, wherein the service name is placed after the service address and a preset symbol is added between them to obtain the target interface address;
[0110] The assembly module 23 is used to obtain the parameter prototype in the service obtained by querying in the target interface address determination module, assemble the preset parameters in the parameter prototype, and replace the test data to obtain the test request data, wherein the preset parameters include a name, a category, a type, a belonging object and an associated object, the name is the name of an object or a field, and the category includes an object and a field;
[0111] A service request module 24, configured to make a service request according to the test request data and the service call strategy, and obtain a service request return value;
[0112] A service robustness judgment module 25 is used to judge the service robustness according to the service request return value;
[0113] The loop module 26 is used to loop the assembly module, the service request module and the service robustness judgment module, wherein the service call strategy includes a one-time task, a loop task and a scheduled task, wherein the one-time task is to manually execute the service once and then stop executing, the loop task is to set the service call interval, the number of service cycles, and continuously call the service until the service requirements are met, and the scheduled task is to set several execution time points for the service execution, and when the execution time point is reached, the service starts to execute the call.
[0114] Further, in some optional embodiments of the present invention, the assembling module 23 includes:
[0115] The acquisition unit is used to obtain the names of all objects according to the category;
[0116] The traversal unit is used to loop through each object, match and group the object name with the data of the object to which it belongs, and obtain all the fields of each object in groups to obtain several target groups. The data type of the field to be replaced in each target group uses the existing type name as a data placeholder;
[0117] An assembling unit, used for assembling the target group according to the associated objects to obtain target data;
[0118] The replacement unit is used to replace the target data according to the type to obtain test request data, wherein the replacement is performed using a default value corresponding to each type.
[0119] Further, in some optional embodiments of the present invention, the traversal unit includes:
[0120] A traversal subunit is used to loop through each object and determine the number of target groups according to the number of objects;
[0121] A generating subunit, for generating, according to the number of target groups, blank groups arranged in sequence belonging to corresponding objects;
[0122] The matching subunit is used to match the object name with the data of the object to which it belongs, and is listed in the corresponding blank group;
[0123] The target group acquisition subunit is used to obtain all fields of each object in groups to obtain a number of target groups.
[0124] Further, in some optional embodiments of the present invention, the assembly unit includes:
[0125] A superior-subordinate relationship determination subunit is used to determine the superior-subordinate relationship between target groups based on the associated objects;
[0126] The moving subunit is used to cancel the lower boundary of the target group of the upper level and move the object name in the target group of the lower level to align with the field name in the target group of the upper level;
[0127] Add a child unit to add a lower boundary that matches the upper boundary of the parent's target group.
[0128] Embodiment 3
[0129] Another aspect of the present invention provides an electronic device, see Figure 2 , shown is an electronic device in Embodiment 3 of the present invention, including a memory 20, a processor 10, and a computer program 30 stored in the memory and executable on the processor, wherein the processor 10 implements the service interface self-test method as described above when executing the computer program 30.
[0130] In some embodiments, the processor 10 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 20, such as executing access restriction programs.
[0131] Among them, the memory 20 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 20 can be an internal storage unit of an electronic device, such as a hard disk of the electronic device. In other embodiments, the memory 20 can also be an external storage device of an electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Further, the memory 20 can also include both an internal storage unit of the electronic device and an external storage device. The memory 20 can not only be used to store application software and various types of data of the electronic device, but also can be used to temporarily store data that has been output or is to be output.
[0132] It should be pointed out that Figure 2 The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than those shown in the figure, or combine certain components, or arrange the components differently.
[0133] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the service interface self-test method as described above is implemented.
[0134] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0135] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0136] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0137] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0138] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.
Claims
1. A service interface self-test method, characterized in that: The method comprises: Step 1: Register the service in the service pool, where the service includes the service address, service name and parameter prototype. The service pool is a storage area running in the memory. Step 2: determine the target interface address, and query the corresponding service according to the target interface address. Specifically, the service request path of the target interface address is formed by splicing the service address and the service name according to regulations, wherein the service name is placed after the service address, and a preset symbol is added between them to obtain the target interface address; Step 3: Obtain the parameter prototype in the service obtained by querying in step 2, assemble the preset parameters in the parameter prototype, and replace the test data to obtain the test request data, wherein the preset parameters include name, category, type, belonging object and associated object, the name is the name of the object or field, the category includes objects and fields, specifically including: Get the names of all objects according to their category; Loop through each object, match and group the object name with the data of the object to which it belongs, and obtain all the fields of each object in groups to obtain several target groups. The data type of the field to be replaced in each target group uses the existing type name as a data placeholder, including: Loop through each object and determine the number of target groups based on the number of objects; According to the number of target groups, generate blank groups that are arranged in order of the corresponding objects; Match the object name with the data of the object to which it belongs, and list them in the corresponding blank group; All fields of each object are obtained by grouping to obtain several target groups; Assembling the target group according to the associated objects to obtain target data; According to the type, the target data is replaced to obtain test request data, wherein the target data is replaced with a default value corresponding to each type; Step 4: Perform a service request according to the test request data and the service call strategy, and obtain a service request return value; Step 5: Determine the robustness of the service based on the return value of the service request; Step 6: Repeat steps 3 to 5.
2. The service interface self-test method according to claim 1, characterized in that: The step of assembling the target group according to the associated objects to obtain the target data comprises: Determine the hierarchical relationship between target groups based on the associated objects; Cancel the lower boundary of the parent target group and move the object names in the subordinate target group to align with the field names in the parent target group; Add a lower boundary that matches the upper boundary of the parent's target group.
3. The service interface self-test method according to claim 1, characterized in that: The service call strategy includes one-time tasks, cyclical tasks and scheduled tasks. Among them, the one-time task is to stop executing the service after manually executing it once, the cyclical task is to set the service call interval, the number of service cycles, and continuously call the service until the service requirements are met, and the scheduled task is to set several execution time points for the service execution. When the execution time point is reached, the service starts to execute the call.
4. A service interface self-test system, characterized in that: Used to implement the service interface self-test method according to any one of claims 1 to 3, the system comprises: A registration module is used to register a service in a service pool, wherein the service includes a service address, a service name and a parameter prototype. The service pool is a storage area running in memory; The target interface address determination module is used to determine the target interface address and query the corresponding service according to the target interface address. Specifically, the service request path of the target interface address is formed by splicing the service address and the service name according to the regulations, wherein the service name is placed after the service address and a preset symbol is added between them to obtain the target interface address; An assembling module is used to obtain the parameter prototype in the service obtained by querying in the target interface address determination module, assemble the preset parameters in the parameter prototype, and replace the test data to obtain the test request data, wherein the preset parameters include a name, a category, a type, a belonging object and an associated object, the name is the name of an object or a field, and the category includes an object and a field; A service request module, used to make a service request according to the test request data and the service call strategy, and obtain a service request return value; The service robustness judgment module is used to judge the service robustness according to the service request return value; A loop module, used for looping the execution of the assembly module, the service request module and the service robustness judgment module; The assembly module comprises: The acquisition unit is used to obtain the names of all objects according to the category; A traversal unit is used to loop through each object, match and group the object name with the data of the object to which it belongs, and obtain all the fields of each object in groups to obtain a number of target groups, wherein the data type of the field to be replaced in each target group uses the existing type name as a data placeholder; An assembling unit, used for assembling the target group according to the associated objects to obtain target data; A replacement unit, used to replace the target data according to the type to obtain test request data, wherein the replacement is performed using a default value corresponding to each type; The traversal unit comprises: A traversal subunit is used to loop through each object and determine the number of target groups according to the number of objects; A generating subunit, for generating, according to the number of target groups, blank groups arranged in sequence belonging to corresponding objects; The matching subunit is used to match the object name with the data of the object to which it belongs, and is listed in the corresponding blank group; The target group acquisition subunit is used to obtain all fields of each object in groups to obtain a number of target groups.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the service interface self-test method as described in any one of claims 1 to 3 is implemented.
6. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the service interface self-test method according to any one of claims 1 to 3 is implemented.
