CN111737129A - Service control method, service control device, computer readable medium and electronic equipment - Google Patents

Service control method, service control device, computer readable medium and electronic equipment Download PDF

Info

Publication number
CN111737129A
CN111737129A CN202010568373.4A CN202010568373A CN111737129A CN 111737129 A CN111737129 A CN 111737129A CN 202010568373 A CN202010568373 A CN 202010568373A CN 111737129 A CN111737129 A CN 111737129A
Authority
CN
China
Prior art keywords
service
interface
target
response information
service control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010568373.4A
Other languages
Chinese (zh)
Inventor
薛宁芬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Tongbang Zhuoyi Technology Co ltd
Original Assignee
Beijing Tongbang Zhuoyi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Tongbang Zhuoyi Technology Co ltd filed Critical Beijing Tongbang Zhuoyi Technology Co ltd
Priority to CN202010568373.4A priority Critical patent/CN111737129A/en
Publication of CN111737129A publication Critical patent/CN111737129A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a service control method, a service control device, a computer readable medium and an electronic device; relates to the technical field of interface testing. The service control method comprises the following steps: calling an interface of a target service to test the target service; acquiring interface response information when the target service calling is abnormal, and acquiring a corresponding service control instruction according to the interface response information; and acquiring a service address of the target service, and sending the service control instruction to the target service according to the service address so as to control the interface call of the target service. The service control method can overcome the problem of high labor cost required by system test to a certain extent, and further improves the test efficiency.

Description

Service control method, service control device, computer readable medium and electronic equipment
Technical Field
The invention relates to the technical field of interface testing, in particular to a service control method, a service control device, a computer readable medium and electronic equipment.
Background
The interface test is to compile test cases through interface documents, and check whether the interface can return expected results under different parameter requests by executing the test cases. The interface test can realize the test of the system service logic, and the test process is simple and the difficulty is small, so that the interface test mode is mostly adopted when the application system is tested. In the testing process, if the service of the application system fails, the interface can return an error message, and then a tester needs to manually judge the reason of the error, so as to manually solve the problem. This approach is relatively complex to operate and inefficient; and different solutions are manually executed according to different errors, so that the requirement on testing personnel is high.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
The invention aims to provide a service control method, a service control device, a computer readable medium and electronic equipment, which can overcome the problem of abnormal service interface calling to a certain extent and improve the testing efficiency.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to a first aspect of the present invention, there is provided a service control method comprising:
calling an interface of a target service to acquire interface response information of the target service; if the interface response information is determined to be abnormal response information, acquiring a corresponding service control instruction according to the abnormal response information; and acquiring a service address of the target service, and sending the service control instruction to the target service according to the service address so as to control the normal calling of an interface of the target service.
In an exemplary embodiment of the present invention, the obtaining a service control instruction according to the abnormal response information includes:
and if the abnormal response information contains a target error code, acquiring a service control instruction corresponding to the target error code.
In an exemplary embodiment of the present invention, the obtaining a service control instruction corresponding to the target error code includes:
acquiring a control authority for the target service to determine an authority level of the control authority; and acquiring a service control instruction corresponding to the target error code according to the permission level.
In an exemplary embodiment of the present invention, the obtaining, according to the permission level, a service control instruction corresponding to the target error code includes:
if the permission level is a first level, acquiring a service restart instruction corresponding to the target error code; and if the permission level is a second level, acquiring a service self-checking instruction corresponding to the target error code.
In an exemplary embodiment of the present invention, after obtaining the interface response information when the target service call is abnormal, the method further includes:
repeatedly calling the interface of the target service to acquire a plurality of interface response messages; and if the occurrence frequency of the abnormal response information in the plurality of interface response information is determined to meet a preset value, acquiring the service control instruction according to the abnormal response information.
In an exemplary embodiment of the present invention, after sending the service control instruction to the target service according to the service address, the method further includes:
generating an abnormal recording message according to the abnormal response information and the service control instruction; and sending the abnormal record message to a management end corresponding to the target service to remind the management end that the target service responds wrongly.
In an exemplary embodiment of the present invention, after sending the service control instruction to the target service according to the service address, the method further includes:
calling the interface of the target service again to acquire the feedback information of the interface; and judging whether the interface of the target service is normally called or not according to the feedback information.
According to a second aspect of the present invention, there is provided a service control apparatus, comprising an anomaly capture module, an instruction determination module, and a service control module, wherein:
and the exception capturing module is used for calling an interface of the target service to acquire interface response information of the target service.
And the instruction determining module is used for acquiring a service control instruction according to the abnormal response information if the interface response information is determined to be the abnormal response information.
And the service control module is used for acquiring the service address of the target service and sending the service control instruction to the target service according to the service address so as to control the normal calling of the interface of the target service.
The instruction determining module may specifically include an error code determining unit, configured to obtain a service control instruction corresponding to a target error code if the abnormal response information includes the target error code.
In an exemplary embodiment of the present invention, the error code determining unit may specifically include an authority determining unit and an instruction obtaining unit, where:
and the permission determining unit is used for acquiring the control permission of the target service so as to determine the permission level of the control permission.
And the instruction acquisition unit is used for acquiring the service control instruction corresponding to the target error code according to the authority level.
In an exemplary embodiment of the invention, the instruction fetch unit may be configured to: if the permission level is a first level, acquiring a service restart instruction corresponding to the target error code; and if the permission level is a second level, acquiring a service self-checking instruction corresponding to the target error code.
In an exemplary embodiment of the present invention, the service control apparatus further includes a repeat calling module, and a response determination module, wherein:
and the repeated calling module is used for repeatedly calling the interface of the target service to acquire a plurality of interface response messages.
And the response determining module is used for acquiring the service control instruction according to the abnormal response information if the occurrence frequency of the abnormal response information in the plurality of interface response information is determined to meet a preset value.
In an exemplary embodiment of the present invention, the service control apparatus further includes an exception recording module and an exception reminding module, wherein:
and the exception recording module is used for generating exception recording information according to the exception response information and the service control instruction.
And the abnormity reminding module is used for sending the abnormity recording message to a management end corresponding to the target service so as to remind the management end that the target service responds wrongly.
In an exemplary embodiment of the present invention, the service control apparatus further includes a feedback acquisition module, and a feedback verification module, wherein:
and the feedback acquisition module is used for calling the interface of the target service again to acquire the feedback information of the interface.
And the feedback verification module is used for judging whether the interface of the target service is normally called or not through the feedback information.
According to a third aspect of the present invention, there is provided an electronic apparatus comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any one of the above via execution of the executable instructions.
According to a fourth aspect of the invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of the above.
Exemplary embodiments of the present invention may have some or all of the following benefits:
in the service control method provided by the invention, on one hand, when the service interface calls abnormally, the corresponding service control instruction can be automatically obtained through the abnormal response information, the reason for the error does not need to be manually judged, and the correctness of the instruction can be improved; moreover, the link of manually writing control instructions to solve problems can be saved, the operation is simpler, the cost can be reduced, and the efficiency can be improved; on the other hand, the service control instruction is sent to the target service, the problem of call abnormity can be solved through the service control instruction, the problem of interface call abnormity can be solved automatically, and the automation degree of testing can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 schematically illustrates a system architecture diagram for implementing a service control method according to one embodiment of the invention;
FIG. 2 schematically shows a flow diagram of a service control method according to one embodiment of the invention;
FIG. 3 schematically shows a flow chart of a service control method according to another embodiment of the invention;
FIG. 4 schematically shows a block diagram of a service control apparatus according to an embodiment of the invention;
FIG. 5 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the invention.
Furthermore, the drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The technical scheme of the embodiment of the invention is explained in detail as follows:
first, a system architecture for implementing the service control method is provided in an exemplary embodiment of the present invention. Referring to fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send request instructions or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a shopping application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for shopping-like websites browsed by users using the terminal devices 101, 102, 103. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
The service control method provided in the embodiment of the present invention is generally executed by the server 105, and accordingly, the service control apparatus is generally provided in the server 105. However, it can be understood by those skilled in the art that the service control method of the present invention may be executed by the terminal device 101, and accordingly, the service control apparatus may be provided in the terminal device 101, which is not particularly limited in this embodiment.
Based on the above system architecture, the present exemplary embodiment provides a service control method. Referring to fig. 2, the service control method may include steps S210, S220, and S230, in which:
step S210: and calling an interface of the target service to acquire interface response information of the target service.
Step S220: and if the interface response information is determined to be abnormal response information, acquiring a corresponding service control instruction according to the abnormal response information.
Step S230: and acquiring a service address of the target service, and sending the service control instruction to the target service according to the service address so as to control the interface call of the target service.
In the service control method provided by an exemplary embodiment of the present invention, on one hand, when a service interface calls an exception, a corresponding service control instruction can be automatically obtained through exception response information, and the correctness of the instruction can be improved without manually determining the cause of the error; moreover, the link of manually writing control instructions to solve problems can be saved, the operation is simpler, the cost can be reduced, and the efficiency can be improved; on the other hand, the service control instruction is sent to the target service, the problem of call abnormity can be solved through the service control instruction, the problem of interface call abnormity can be solved automatically, and the automation degree of testing can be improved.
The above steps of the present exemplary embodiment will be described in more detail below.
In step S210, an interface of a target service is called to obtain interface response information of the target service.
In this embodiment, the target service may include various applications required by the test environment, and the applications may be deployed on the server and provide services to the outside through the interface. The target service may be tested by calling an interface of the target service, where the interface may include an address for accessing the target service, such as an IP address and a port number of the server, and may also include other identification information of the service, such as a service name, and the like, and the embodiment is not limited thereto.
In step S220, if it is determined that the interface response information is abnormal response information, a corresponding service control instruction is obtained according to the abnormal response information.
The interface response information is an execution result returned by the target service, and the request parameter is input into the interface to obtain the execution result of the target service based on the request parameter. The request parameters can be set according to the test requirements, corresponding interface response information can be determined in advance according to the request parameters, and if the interface response information returned by the interface is the information corresponding to the request parameters, the interface can be determined to be called correctly. In addition, an exception also occurs when the interface is called, each type of exception can be encoded in advance to generate a corresponding error code, and then when the exception occurs, the target service can return the code corresponding to the exception type through the interface. Therefore, if the interface response information is the error code agreed in advance, it can be determined that the interface response information is the abnormal response information, that is, the target service call is abnormal, and the abnormal response information when the target service call is abnormal is recorded and stored.
For example, the exceptions may be encoded in advance, such as: the "no specified processing found" corresponding error code may be 404; "service cannot be requested" may correspond to an error code of 500; the "request-not-for" corresponding error code may be 405; the "received parameter type error" may correspond to an error code of 400; the error code corresponding to "the requested format is not supported by the requested page" may be 415; the "response timeout" may correspond to error codes 504 and so on, and it may be determined whether the interface response information is abnormal or not according to the error codes included in the interface response information, and abnormal response information for each confirmation may be recorded.
In other embodiments of the present invention, it may also be determined whether the interface response information is abnormal response information, such as A, B, C, for example, No provider, etc., by whether specific characters are included in the interface response information, and if these specific characters are included in the interface response information, it may be determined as abnormal response information, which also belongs to the protection scope of the present invention.
And acquiring recorded abnormal response information when abnormal calling occurs, determining the abnormal type through the abnormal response information, and further acquiring a corresponding service control instruction. The service control instructions may be various executable files, such as scripts, description files, and the like. For example, when the abnormal response information is No provider (No provider) or is not responded after time out, it may be determined that the service corresponding to the interface has a fault, and if the abnormal response information includes a specific character "No provider", a control instruction for restarting the target service may be obtained.
Optionally, if the abnormal response information includes a target error code, a service control instruction corresponding to the target error code is obtained.
The target error code is a code corresponding to a specific exception type, and may predetermine a service control instruction corresponding to the specific exception type, for example, a service restart instruction corresponding to "response timeout", an interface re-call instruction corresponding to "request error", and the like, then query all interface response information, extract exception response information including the specific exception type, and further obtain a corresponding service control instruction. In the embodiment, different service control instructions can be acquired according to different exception types, and various exceptions can be solved in a targeted manner. Because the problem that the service is unavailable for a long time is caused when the server where the target service is located is down, optionally, the target error code may be a code corresponding to the server down, that is, when an abnormality that the server where the target service is located is down occurs when the interface is called, the abnormal response information may include the target error code, and then the problem that the server is down is solved by using the abnormal response information, so that the availability of the service may be enhanced.
In an optional embodiment, the service control instruction can be controlled through the authority management, so that the safety risk can be avoided. Therefore, the method can determine the authority level of the control authority by acquiring the control authority of the target service; and further, acquiring a service control instruction corresponding to the target error code according to the authority level.
The control authority for the target service can be obtained by sending a request to the server, for example, identity information of a management terminal is sent to the server, and the control authority is obtained by verifying the identity information; or, the authority level of each management terminal may be predetermined, and the authority level is configured in a specific file, so as to query the corresponding control authority through the file. The authority level of the control authority may be set according to actual requirements, for example, a level a, a level B, a level C, and the like, where the control authority of each level may include an authority to execute a specific instruction, for example, the level a may include an authority to execute server restart, the level B may include an authority to modify server data, the level C may include an authority to copy server data, and the like, and this embodiment is not particularly limited thereto.
One or more service control instructions may be determined for each privilege level, and the service control instructions corresponding to different privilege levels may be different. In other words, the target error code may correspond to a plurality of service control instructions, and the permission level corresponding to each service control instruction may be different, and after determining the control permission for the target service, the service control instruction corresponding to the target error code may be obtained according to the permission level. Optionally, if the permission level is a first level, obtaining a service restart instruction corresponding to the target error code; and if the permission level is a second level, acquiring a service self-checking instruction corresponding to the target error code. For example, the service control instruction with the authority level a corresponding to the target error code is "restart service", and the service control instruction with the authority level B corresponding to the target error code may be "service self-check", and the like.
In addition, in order to improve the correctness of the instruction, the method can include repeatedly calling the interface of the target service after the exception is called so as to obtain a plurality of interface response messages; and then, determining abnormal response information with the frequency meeting a preset value in the plurality of interface response information, and acquiring the service control instruction according to the abnormal response information.
The preset value may be determined according to actual requirements, for example, the preset value may include 5 times, 8 times, 10 times, and the like, and may also include other values, for example, 3 times, 4 times, and the like, which is not particularly limited in this embodiment. If the interface response information returned by the interface of the target service is abnormal in calling, the interface is repeatedly called for many times within a certain time length, so that a plurality of interface response information are obtained. And detecting the response information of each interface, and respectively determining whether the response information of each interface is abnormal response information, thereby extracting the abnormal response information of which the occurrence times meet a preset value, and further processing the abnormal response information which repeatedly occurs. For example, if the interface call is abnormal, the interface of the target service may be called 5 times within a certain time duration by the timing task, the interface response information returned by the interface may be acquired by each call, and if 4 pieces of interface response information are all "no response over time" in the 5 pieces of acquired interface response information, it may be determined that the abnormal response information is "no response over time". After the abnormal response information is determined, only the service control instruction corresponding to the abnormal response information needs to be obtained, each piece of abnormal response information does not need to be processed, the efficiency can be improved, and the accuracy of abnormal judgment is ensured.
Continuing to refer to fig. 2, in step S230, a service address of the target service is obtained, and the service control instruction is sent to the target service according to the service address to control the interface of the target service to be normally invoked.
The server where the target service is located and the specific port of the server can be determined by the service address of the target service. The service address may include an IP address and a port number, and the service address is usually recorded in the interface platform, so that the IP address and the port number corresponding to the target service can be obtained through the interface platform, for example, the IP address and the port number of the target service can be obtained through the JSF interface platform. After the service address is obtained, the service control instruction may be sent to the service address to control the target service to execute the instruction, for example, the restart service instruction is sent to the service address, which may control the server corresponding to the target service to restart; and sending the self-checking instruction to the address, so that the thread corresponding to the target service can be controlled to run a self-checking program and the like, and the reason of the abnormal calling of the interface is automatically positioned. Therefore, sending the service control instruction to the target service can enable the target service to solve the problem of call exception by executing the instruction, thereby ensuring the availability of the service.
In other embodiments of the present invention, the steps may be executed in other sequences, for example, the service control instruction may be obtained first, and then it is determined whether there is a control authority for the control instruction, and if there is an authority, the service control instruction is sent to the target service, which also belongs to the protection scope of the present invention.
Optionally, when the target service is controlled by the service control instruction, the processing procedure may be notified to the manager, so that the manager can monitor the abnormal condition in time. Therefore, before the service control instruction is sent to the target service, an exception record message can be generated according to the exception response information when the target service calls exception and the service control instruction; and further, sending the abnormal record message to a management end corresponding to the target service to remind the management end that the target service responds wrongly.
The exception record message may include attribute information of the target service, such as a service address, a service name, a service function, and the like, and may also include an exception type of the exception response, such as an error code, a specific character, and the like; in addition, other information may be included, for example, time when an exception is called, request parameters of an interface when an exception is called, and the like, and this embodiment is not particularly limited to this. And packaging the abnormal response information when the target service calling is abnormal and the service control instruction to generate an abnormal record message. In addition, the abnormal recording message can be sent to a management terminal in various modes, such as mails, short messages, page popup windows and the like, so that a user is reminded of calling errors of the interface, the user can know the test condition of the interface in time conveniently, and the decision can be made more quickly.
After the service control instruction is sent to the target service, the instruction can be executed, and then the problem of abnormal interface call of the target service can be solved. In order to clearly know whether the problem of abnormal interface calling is solved, the embodiment can obtain the feedback information of the interface by calling the interface of the target service again after the service control instruction is sent to the target service; and then, judging whether the interface of the target service is normally called or not according to the feedback information.
For example, if the interface of the target service is called again, and the feedback information of the interface does not include any abnormal type, it may be determined that the interface of the target service calls normally; if the feedback information of the interface still contains an abnormal type, for example, the error code 400, etc., it may be determined that the interface of the target service calls abnormally, in this case, the service control instruction may be continuously re-acquired according to the feedback information of the interface, and the abnormal problem may be automatically solved again, and if the failure still occurs, the failure information may be recorded and fed back to the management end, so as to be solved manually. In the embodiment, the service control instruction can be automatically acquired through the interface response information, so that the problem of abnormal interface calling of the target service can be automatically decided and solved, the service can be quickly recovered to be normal, the service availability is improved, and the test efficiency is improved.
In an exemplary embodiment, the method may include steps S301 to S308, as shown in fig. 3.
In step S301, an interface of the target service is called. In step S302, it is determined whether the interface call is normal; if the interface call is abnormal, step S303 is executed to obtain abnormal response information. In step S304, the interface is called for a plurality of times, and abnormal response information whose occurrence times satisfy a preset value is recorded; the multiple-call interface may obtain multiple interface response messages, so that the multiple interface response messages may confirm the repeated abnormal response messages, that is, if the same abnormal response message is returned every time the interface is called, or most of the abnormal response messages are the same, the repeated abnormal response messages may be recorded, for example, the abnormal response message a is recorded after the same abnormal response message a appears 6 times after the interface is called 8 times. In step S305, an IP and a port number corresponding to the interface are acquired. In step S306, it is determined whether there is a control authority for the target service; if yes, executing step S307 to obtain a restart script; if not, step S309 is performed directly. In step S308, the restart script is sent to the server corresponding to the target service according to the IP and the port number; the server can be controlled to restart through the restart script, so that the problem of abnormal interface calling is solved. In step S309, the abnormal recording information is sent to the management side; and packaging the abnormal response information, the IP address and the port number corresponding to the interface, the restart script and other information to generate abnormal record information, and sending the abnormal record information to the management terminal so that the management terminal can timely monitor abnormal conditions.
It should be noted that, steps S301 to S308 in fig. 3 are described in the above specific embodiments, and are not described herein again.
Further, in the present exemplary embodiment, a service control apparatus is also provided, which is configured to execute the service control method of the present invention. The service control device can be applied to a server or terminal equipment.
Referring to fig. 4, the service control apparatus 400 may include: an exception capture module 410, an instruction determination module 420, and a service control module 430, wherein:
the exception capture module 410 is configured to invoke an interface of a target service to obtain interface response information of the target service.
And an instruction determining module 420, configured to, if it is determined that the interface response information is abnormal response information, obtain a service control instruction according to the abnormal response information.
And the service control module 430 is configured to obtain a service address of the target service, and send the service control instruction to the target service according to the service address, so as to control an interface of the target service to be normally called.
In an exemplary embodiment of the present invention, the instruction determining module 420 may specifically include an error code determining unit, configured to obtain a service control instruction corresponding to a target error code if the exception response information includes the target error code.
In an exemplary embodiment of the present invention, the error code determining unit may specifically include an authority determining unit and an instruction obtaining unit, where:
and the permission determining unit is used for acquiring the control permission of the target service so as to determine the permission level of the control permission.
And the instruction acquisition unit is used for acquiring the service control instruction corresponding to the target error code according to the authority level.
In an exemplary embodiment of the invention, the instruction fetch unit may be configured to: if the permission level is a first level, acquiring a service restart instruction corresponding to the target error code; and if the permission level is a second level, acquiring a service self-checking instruction corresponding to the target error code.
In an exemplary embodiment of the present invention, the service control apparatus 400 further includes a repeat calling module, and a response determining module, wherein:
and the repeated calling module is used for repeatedly calling the interface of the target service to acquire a plurality of interface response messages.
And the response determining module is used for acquiring the service control instruction according to the abnormal response information if the occurrence frequency of the abnormal response information in the plurality of interface response information is determined to meet a preset value.
In an exemplary embodiment of the present invention, the service control apparatus 400 further includes an exception recording module and an exception reminding module, wherein:
and the exception recording module is used for generating exception recording information according to the exception response information and the service control instruction.
And the abnormity reminding module is used for sending the abnormity recording message to a management end corresponding to the target service so as to remind the management end that the target service responds wrongly.
In an exemplary embodiment of the present invention, the service control apparatus 400 further includes a feedback acquisition module, and a feedback verification module, wherein:
and the feedback acquisition module is used for calling the interface of the target service again to acquire the feedback information of the interface.
And the feedback verification module is used for judging whether the interface of the target service is normally called or not through the feedback information.
For details that are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the above-described embodiments of the service control method of the present invention for the functional modules of the service control apparatus of the exemplary embodiment of the present invention correspond to the steps of the above-described exemplary embodiment of the service control method.
FIG. 5 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
It should be noted that the computer system 500 of the electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiment of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for system operation are also stored. The CPU801, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present invention, the processes described below with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program, when executed by a Central Processing Unit (CPU)501, performs various functions defined in the methods and apparatus of the present application.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the embodiments below. For example, the electronic device may implement the steps shown in fig. 1 and 2, and so on.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A service control method, comprising:
calling an interface of a target service to acquire interface response information of the target service;
if the interface response information is determined to be abnormal response information, acquiring a corresponding service control instruction according to the abnormal response information;
and acquiring a service address of the target service, and sending the service control instruction to the target service according to the service address so as to control the normal calling of an interface of the target service.
2. The method according to claim 1, wherein the obtaining of the service control command according to the abnormal response information comprises:
and if the abnormal response information contains a target error code, acquiring a service control instruction corresponding to the target error code.
3. The method of claim 2, wherein the obtaining the service control instruction corresponding to the target error code comprises:
acquiring a control authority for the target service to determine an authority level of the control authority;
and acquiring a service control instruction corresponding to the target error code according to the permission level.
4. The method according to claim 3, wherein the obtaining the service control command corresponding to the target error code according to the permission level comprises:
if the permission level is a first level, acquiring a service restart instruction corresponding to the target error code;
and if the permission level is a second level, acquiring a service self-checking instruction corresponding to the target error code.
5. The method of claim 1, wherein if it is determined that the interface response message is an abnormal response message, then further comprising:
repeatedly calling the interface of the target service to acquire a plurality of interface response messages;
and if the occurrence frequency of the abnormal response information in the plurality of interface response information is determined to meet a preset value, acquiring the service control instruction according to the abnormal response information.
6. The method of claim 1, wherein after sending the service control instruction to the target service according to the service address, further comprising:
generating an abnormal recording message according to the abnormal response information and the service control instruction;
and sending the abnormal record message to a management end corresponding to the target service to remind the management end that the target service responds wrongly.
7. The method of claim 1, wherein after sending the service control instruction to the target service according to the service address, further comprising:
calling the interface of the target service again to acquire the feedback information of the interface;
and judging whether the interface of the target service is normally called or not according to the feedback information.
8. A service control apparatus, comprising:
the abnormity capturing module is used for calling an interface of a target service to acquire interface response information of the target service;
the instruction determining module is used for acquiring a service control instruction according to the abnormal response information if the interface response information is determined to be the abnormal response information;
and the service control module is used for acquiring the service address of the target service and sending the service control instruction to the target service according to the service address so as to control the normal calling of the interface of the target service.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-7 via execution of the executable instructions.
CN202010568373.4A 2020-06-19 2020-06-19 Service control method, service control device, computer readable medium and electronic equipment Pending CN111737129A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010568373.4A CN111737129A (en) 2020-06-19 2020-06-19 Service control method, service control device, computer readable medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010568373.4A CN111737129A (en) 2020-06-19 2020-06-19 Service control method, service control device, computer readable medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111737129A true CN111737129A (en) 2020-10-02

Family

ID=72651870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010568373.4A Pending CN111737129A (en) 2020-06-19 2020-06-19 Service control method, service control device, computer readable medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111737129A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817850A (en) * 2021-01-28 2021-05-18 北京达佳互联信息技术有限公司 Information processing method, device, system, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106301995A (en) * 2015-06-24 2017-01-04 北京京东尚科信息技术有限公司 The method and apparatus that a kind of automatic detection interface service is abnormal
CN106453519A (en) * 2016-09-21 2017-02-22 合网络技术(北京)有限公司 Interface call method and device
CN107948744A (en) * 2017-12-13 2018-04-20 深圳市雷鸟信息科技有限公司 Interface detection method, interface detection device and computer-readable recording medium
CN110798376A (en) * 2019-10-09 2020-02-14 苏宁云计算有限公司 Interface testing method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106301995A (en) * 2015-06-24 2017-01-04 北京京东尚科信息技术有限公司 The method and apparatus that a kind of automatic detection interface service is abnormal
CN106453519A (en) * 2016-09-21 2017-02-22 合网络技术(北京)有限公司 Interface call method and device
CN107948744A (en) * 2017-12-13 2018-04-20 深圳市雷鸟信息科技有限公司 Interface detection method, interface detection device and computer-readable recording medium
CN110798376A (en) * 2019-10-09 2020-02-14 苏宁云计算有限公司 Interface testing method and device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817850A (en) * 2021-01-28 2021-05-18 北京达佳互联信息技术有限公司 Information processing method, device, system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108073506B (en) Test method and device
CN110221948B (en) Test script generation method, test script generation device, computer device and storage medium
CN109344066B (en) Method, system and terminal for testing browser page
CN113238930A (en) Software system testing method and device, terminal equipment and storage medium
CN111242445B (en) Method, apparatus and readable storage medium for testing products based on configuration production line
CN111737129A (en) Service control method, service control device, computer readable medium and electronic equipment
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
CN114637685A (en) Performance test method, device, equipment and medium of application program in bank system
CN115827122A (en) Operation guiding method and device, electronic equipment and storage medium
CN112395194B (en) Method and device for accessing test platform
CN112631929A (en) Test case generation method and device, storage medium and electronic equipment
CN115190008B (en) Fault processing method, fault processing device, electronic equipment and storage medium
CN113094268B (en) Test method, test device, test equipment and test medium
CN114996119B (en) Fault diagnosis method, fault diagnosis device, electronic device and storage medium
CN113986603B (en) Method and device for determining page loading abnormity reason and storage medium
CN113535568B (en) Verification method, device, equipment and medium for application deployment version
CN111444081B (en) Determination, response and generation methods, client, server, device and medium
CN114064484A (en) Interface testing method and device, electronic equipment and readable storage medium
CN105528298A (en) Safety testing method and device
CN116467209A (en) Performance test method, device, equipment and storage medium
CN117152861A (en) Automatic inspection method, device, electronic equipment and computer readable medium
CN116431499A (en) Automatic test method and device, electronic equipment and storage medium
CN117493207A (en) Page processing method, device, electronic equipment and storage medium
CN116257432A (en) Service system testing method and device
CN115098394A (en) Test method, test device, electronic equipment and computer readable medium

Legal Events

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