CN108134708A - The method and apparatus for monitoring third party's interface - Google Patents

The method and apparatus for monitoring third party's interface Download PDF

Info

Publication number
CN108134708A
CN108134708A CN201611094353.8A CN201611094353A CN108134708A CN 108134708 A CN108134708 A CN 108134708A CN 201611094353 A CN201611094353 A CN 201611094353A CN 108134708 A CN108134708 A CN 108134708A
Authority
CN
China
Prior art keywords
party
state
interface
transfer protocol
hypertext transfer
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.)
Granted
Application number
CN201611094353.8A
Other languages
Chinese (zh)
Other versions
CN108134708B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201611094353.8A priority Critical patent/CN108134708B/en
Publication of CN108134708A publication Critical patent/CN108134708A/en
Application granted granted Critical
Publication of CN108134708B publication Critical patent/CN108134708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present invention relates to a kind of method and apparatus for monitoring third party's interface.The method includes:It simulates hypertext transfer protocol and sends access request to third party's network address;Reception responds the access request returned hypertext transfer protocol conditional code;Judge whether the hypertext transfer protocol conditional code is preset state code;If it is not preset state code to judge the hypertext transfer protocol conditional code, then it represents that third party's interface malloc failure malloc then sends alarm information.The method and apparatus of above-mentioned monitoring third party interface, by simulating hypertext transfer protocol access request is sent to third party's network address, judge to respond whether returned hypertext transfer protocol conditional code is preset state code to access request, if not preset state code, it then represents to call the failure of third party's interface, the problem of sending alarm information, can finding third party's interface malloc failure malloc in time, improves monitoring efficiency.

Description

The method and apparatus for monitoring third party's interface
Technical field
The present invention relates to computer application field, more particularly to a kind of method and apparatus for monitoring third party's interface.
Background technology
It is more and more with the third party partner of addition on service platform, it needs to monitor third party's interface (i.e. third Square partner's interface) stability.Once because of third party's interface malloc failure malloc, it will cause user that can not use service.
In order to monitor the stability of third party's interface, traditional mode is to add in data in code level to bury a little, is supervised in real time User's request is controlled, when user's request failure or occurs taking the situation more than given threshold value, then accesses failure, then will access The situation of failure is sent to developer and is analyzed, which interface malloc failure malloc is checked by manual analysis, when needing to expend a large amount of Between, monitoring efficiency is low.
Invention content
Based on this, it is necessary to for traditional monitoring third party's interface stability monitoring efficiency it is low the problem of, provide one The method and apparatus of kind monitoring third party's interface, can improve monitoring efficiency.
A kind of method for monitoring third party's interface, including:
It simulates hypertext transfer protocol and sends access request to third party's network address;
Reception responds the access request returned hypertext transfer protocol conditional code;
Judge whether the hypertext transfer protocol conditional code is preset state code;
If it is not preset state code to judge the hypertext transfer protocol conditional code, then it represents that third party's interface, which calls, to be lost It loses, then sends alarm information;
If judging, the hypertext transfer protocol conditional code for preset state code, judges third party's network address Whether corresponding third party is in down status or hidden state, if third party is in down status or hidden state, to institute It states third party and carries out operation of reaching the standard grade.
A kind of device for monitoring third party's interface, including:
Request sending module sends access request for simulating hypertext transfer protocol to third party's network address;
Receiving module responds the access request returned hypertext transfer protocol conditional code for receiving;
Conditional code detection module, for judging whether the hypertext transfer protocol conditional code is preset state code;
Sending module is alerted, if for judging that the hypertext transfer protocol conditional code is not preset state code, table Show third party's interface malloc failure malloc, then send alarm information;
Condition judgment module, if for judging that the hypertext transfer protocol conditional code for preset state code, judges Whether the corresponding third party of third party's network address is in down status;
If being in down status for third party, operation of reaching the standard grade is carried out to the third party for Status Change module.
The method and apparatus of above-mentioned monitoring third party interface, by simulating hypertext transfer protocol to third party's network address Access request is sent, judges to respond whether returned hypertext transfer protocol conditional code is preset state code to access request, If not preset state code, then it represents that call the failure of third party's interface, send alarm information, can find third party's interface tune in time The problem of with failure, monitoring efficiency is improved, when for preset state code, and when third party is in down status or hidden state, Operation of reaching the standard grade is carried out to third party.
Description of the drawings
Fig. 1 is the application environment schematic diagram of the method for monitoring third party's interface in one embodiment;
Fig. 2 is the internal structure schematic diagram of electronic equipment in one embodiment;
Fig. 3 is the flow chart of the method for monitoring third party's interface in one embodiment;
Fig. 4 is the flow chart of the method for monitoring third party's interface in another embodiment;
Fig. 5 is to carry out offline operation in one embodiment to the corresponding third party of third party's network address or hide behaviour The particular flow sheet of work;
Fig. 6 is third party reach the standard grade in one embodiment the particular flow sheet of operation;
Fig. 7 is the schematic diagram of test frame in one embodiment;
Fig. 8 is the structure diagram of the device of monitoring third party's interface in one embodiment;
Fig. 9 is the structure diagram of the device of monitoring third party's interface in another embodiment;
Figure 10 is the structure diagram of the device of monitoring third party's interface in another embodiment.
Specific embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, it is right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
It is appreciated that term " first " used in the present invention, " second " etc. can be used to describe various elements herein, But these elements should not be limited by these terms.These terms are only used to distinguish first element and another element.Citing comes It says, without departing from the scope of the invention, the first alteration command can be known as the second alteration command, and similarly, Second alteration command can be known as the first alteration command.First alteration command and the second alteration command both alteration command, But it is not same alteration command.
Fig. 1 is the application environment schematic diagram of the method for monitoring third party's interface in one embodiment.As shown in Figure 1, it should answer Include test lead 110 and accessed end 120 with environment.Test lead 110 can simulate HTTP (Hyper Text Transfer Protocol, hypertext transfer protocol) to the transmission of accessed end 120 HTTP access requests, and receive and access request is rung Returned HTTP conditional codes are answered, judge whether HTTP conditional codes are preset state code, if not preset state code, then it represents that the Tripartite's interface malloc failure malloc sends alarm information.Test lead 110 can be the electronic equipment where test code.Accessed end 120 Server that can be where third party's network address etc..Electronic equipment can be mobile terminal, tablet computer, personal computer etc..
Fig. 2 is the internal structure schematic diagram of electronic equipment in one embodiment.As shown in Fig. 2, the electronic equipment includes leading to Cross processor, non-volatile memory medium, built-in storage and the network interface of system bus connection.Wherein, electronic equipment is non- Volatile storage medium is stored with operating system, further includes a kind of device for monitoring third party's interface, monitoring third party's interface Device be used to implement it is a kind of monitor third party's interface method.For the processor for providing calculating and control ability, support is whole The operation of a electronic equipment.Dress of the built-in storage for monitoring third party's interface in non-volatile memory medium in electronic equipment The operation put provides environment, can store computer-readable instruction in the built-in storage, the computer-readable instruction is by the place When managing device execution, it may be such that the processor performs a kind of method for monitoring third party's interface.Network interface is used for and server Network communication is carried out, access request is such as sent to server, receives conditional code that server returns etc..The electronic equipment can be Mobile phone, tablet computer or personal digital assistant or Wearable etc..It will be understood by those skilled in the art that it is shown in Fig. 2 Structure, only with the block diagram of the relevant part-structure of application scheme, do not form and it be applied to application scheme On electronic equipment restriction, specific electronic equipment can include than components more or fewer shown in figure or combination Certain components are arranged with different components.
Fig. 3 is the flow chart of the method for monitoring third party's interface in one embodiment.As shown in figure 3, a kind of monitoring third The method of square interface is run on the electronic equipment in Fig. 1, including step 302 to step 308.Wherein:
Step 302, simulation hypertext transfer protocol sends access request to third party's network address.
In the present embodiment, test lead sends access request by simulating hypertext transfer protocol to third party's network address. Third party's network address refers to the network address of the third party partner of access service platform.Service platform refers to provide certain spies Determine the server of function, such as medical treatment is registered platform, the vehicle number of shaking platform, driving license test registration platform etc..Third party's network Location can be Tongji University's hospital network address, BJ Univ Hospital's network address, Shenzhen driving license test registration network address, Beijing driving license test Network address of registering etc..
In the present embodiment, it can be sent out according to preset interval time timing simulation hypertext transfer protocol to third party's network address Send access request.Preset interval time can be set as needed, and send within such as 5 minutes primary.
Step 304, it receives and returned hypertext transfer protocol conditional code is responded to the access request.
In the present embodiment, test lead receives the hypertext transfer protocol shape that accessed end carries out access request response return State code.Hypertext transfer protocol conditional code is the digital generation for the hypertext transfer protocol responsive state for representing web page server Code.
Step 308, judge whether the hypertext transfer protocol conditional code is preset state code.
In the present embodiment, preset state code is to represent that third party's interface calls successful conditional code, such as 200,201.It surveys Examination end the hypertext transfer protocol conditional code of return is compared with preset state code, judge whether it is identical, if identical, table Show that third party's interface calls successfully, if differing, then it represents that third party's interface malloc failure malloc.
Step 310, if judging, the hypertext transfer protocol conditional code is not preset state code, then it represents that third party connects Mouth malloc failure malloc, then send alarm information.
In the present embodiment, alarm information may include alarm time, warning content and alarm grade.Alarm time refers to send The time of alarm.Warning content refers to the concrete condition of calling interface failure.Alarm level refers to the serious of calling interface failure Rank.
Third party's interface is a kind of routine interface, is one of the two class interfaces that operating system provides to the user, programming personnel Operating system is asked to provide service by routine interface in a program.
Step 312, if judging, the hypertext transfer protocol conditional code for preset state code, judges the third party Whether the corresponding third party of network address is in down status or hidden state, if third party is in down status or hiding shape State then performs step 314.
In the present embodiment, down status refers to that third party is in the state for interrupting access service platform, can not in user terminal View third party's information.Third party's information may include third party's mark, third party's network address etc..Third party's mark is to be used for Character string of unique mark third party's identity etc..The character string may include one or more in number, letter and character.
In the present embodiment, when judging the hypertext transfer protocol conditional code for preset state code, and judge third When the corresponding third party of square network address is in down status, operation of reaching the standard grade is carried out to third party.Operation of reaching the standard grade refers to third Square access service platform so that third party is in state of reaching the standard grade.The state of reaching the standard grade refers to that third party is in the shape of access service platform State can view third party's information in user terminal.
Step 314, operation of reaching the standard grade is carried out to the third party.
The method of above-mentioned monitoring third party interface sends visit by simulating hypertext transfer protocol to third party's network address It asks request, judges to respond whether returned hypertext transfer protocol conditional code is preset state code to access request, if not Preset state code, then it represents that call the failure of third party's interface, send alarm information, can find third party's interface malloc failure malloc in time The problem of, monitoring efficiency is improved, when for preset state code, and when third party is in down status or hidden state, to third Fang Jinhang reaches the standard grade operation.
Fig. 4 is the flow chart of the method for monitoring third party's interface in another embodiment.As shown in figure 4, a kind of monitoring the The method of tripartite's interface is run on the electronic equipment in Fig. 1, including step 402 to step 4.Wherein:
Step 402, simulation hypertext transfer protocol sends access request to third party's network address.
In the present embodiment, test lead sends access request by simulating hypertext transfer protocol to third party's network address. Third party's network address refers to the network address of the third party partner of access service platform.Service platform refers to provide certain spies Determine the server of function, such as medical treatment is registered platform, the vehicle number of shaking platform, driving license test registration platform etc..Third party's network Location can be Tongji University's hospital network address, BJ Univ Hospital's network address, Shenzhen driving license test registration network address, Beijing driving license test Network address of registering etc..
In the present embodiment, it can be sent out according to preset interval time timing simulation hypertext transfer protocol to third party's network address Send access request.Preset interval time can be set as needed, and send within such as 5 minutes primary.
Step 404, it receives and returned hypertext transfer protocol conditional code is responded to the access request.
In the present embodiment, test lead receives the hypertext transfer protocol shape that accessed end carries out access request response return State code.Hypertext transfer protocol conditional code is the digital generation for the hypertext transfer protocol responsive state for representing web page server Code.
Step 406, judge whether the hypertext transfer protocol conditional code is preset state code.
In the present embodiment, preset state code is to represent that third party's interface calls successful conditional code, such as 200,201.It surveys Examination end the hypertext transfer protocol conditional code of return is compared with preset state code, judge whether it is identical, if identical, table Show that third party's interface calls successfully, if differing, then it represents that third party's interface malloc failure malloc.
Step 408, if judging, the hypertext transfer protocol conditional code is not preset state code, then it represents that third party connects Mouth malloc failure malloc, then send alarm information, then perform step 414.
In the present embodiment, alarm information may include alarm time, warning content and alarm grade.Alarm time refers to send The time of alarm.Warning content refers to the concrete condition of calling interface failure.Alarm level refers to the serious of calling interface failure Rank.
Step 410, if judging, the hypertext transfer protocol conditional code for preset state code, judges the third party Whether the corresponding third party of network address is in down status, if so, step 412 is performed, if it is not, then terminating.
In the present embodiment, down status refers to that third party is in the state for interrupting access service platform, can not in user terminal View third party's information.Third party's information may include third party's mark, third party's network address etc..Third party's mark is to be used for Character string of unique mark third party's identity etc..The character string may include one or more in number, letter and character.
In the present embodiment, when judging the hypertext transfer protocol conditional code for preset state code, and judge third When the corresponding third party of square network address is in down status, operation of reaching the standard grade is carried out to third party.Operation of reaching the standard grade refers to third Square access service platform so that third party is in state of reaching the standard grade.The state of reaching the standard grade refers to that third party is in the shape of access service platform State can view third party's information in user terminal.
Step 412, operation of reaching the standard grade is carried out to the third party.
In the present embodiment, the operation that third party reach the standard grade can be by changing expression third party's state in third party's tables of data Field value realize so that third party is in the state of reaching the standard grade.
Step 414, third party's interface malloc failure malloc number in preset time is counted, then performs step 416.
In the present embodiment, third party's interface malloc failure malloc is primary, then statistics is primary, obtains the statistics time in preset time Number.Preset time can be set as needed.
Step 416, judge whether the number of statistics is more than frequency threshold value, if so, step 418 is performed, if it is not, then terminating.
In the present embodiment, frequency threshold value can be previously according to needing to configure, and such as 10 is inferior.
Step 418, offline operation is carried out to the corresponding third party of third party's network address or hides operation.
In the present embodiment, offline operation refers to third party interrupting access service platform so that third party is in lower threadiness State.Hiding operation refers to hide third party in service platform so that third party is in hidden state, can not be checked in user terminal Third party's information.
The method of monitoring third party's interface in the present embodiment, by simulating hypertext transfer protocol to third party's network Location sends access request, judges to respond whether returned hypertext transfer protocol conditional code is preset state to access request Code, if not preset state code, then it represents that call the failure of third party's interface, send alarm information, can find that third party connects in time The problem of mouth malloc failure malloc, improve monitoring efficiency;The number of third party's interface malloc failure malloc in preset time is counted, if calling The number of failure is more than frequency threshold value, then the third party is carried out offline operation or hide operation, avoid subsequently continuing this Third party's interface malloc failure malloc;For offline third party, if it is normal to monitor third party's calling interface, by third party into Capable operation of reaching the standard grade, facilitates user that can enjoy the service that the third party is provided.
In other embodiments, a kind of method for monitoring third party's interface may include step 402 to 408, step 414 to step Rapid 418.
In one embodiment, the method for above-mentioned monitoring third party interface further includes:If the number of statistics is more than number threshold Value, then generation carry out the corresponding third party of third party's network address offline operation or hide the offline message of operation, and By the offline news release to message subject, and the offline message is obtained from the message subject, according to described offline Message carries out the third party offline operation or hides operation.
In the present embodiment, model is subscribed to by news release and carries out offline operation to third party or hide to operate.Message is sent out Cloth subscribes to model and includes the message producer (Producer), the consumer (Consumer) of message and message subject (Topic). The message producer is operated by issuing, and by under news release to Topic, and Consumer obtains Topic by subscription operation Under message.The number that test lead monitors statistics is more than frequency threshold value, then generates corresponding to third party's network address Third party carries out offline operation or hides the offline message of operation, and by the offline news release to message subject.From message After theme reads offline message, offline operation is carried out to the third party according to the offline message or hides operation.
In one embodiment, offline operation is carried out to the third party or hides operation, including:By control switch from First state switches into the second state, and offline operation is carried out to the corresponding third party of third party's network address or hides behaviour Make, the first state represents that third party is in state of reaching the standard grade, and second state represents that third party is in down status or hidden Tibetan state.
In the present embodiment, third party is controlled to be in reach the standard grade still down status, control mode by switch simple.
In one embodiment, as shown in figure 5, carrying out offline operation to the corresponding third party of third party's network address Or the step of hiding operation, includes:
Step 502, the first state alteration command for including third party's mark is obtained.
In the present embodiment, third party's mark is the character string for uniquely representing third party's identity.First state change refers to Enable the instruction referred to for changing state.
Step 504, third party's identifier lookup in the first state alteration command is to corresponding third party's data Table.
In the present embodiment, record has the correspondence of third party's mark and third party's tables of data in test lead.According to Third party's mark in one Status Change instruction finds corresponding from third party's mark with the correspondence of third party's tables of data Third party's tables of data.
Step 506, it changes default for first for indicating the value of the field of third party's state in third party's tables of data Value, so that third party is in down status or hidden state.
It is pre- for indicating the value first of the field of third party's state in third party's tables of data by changing in the present embodiment If value, may be such that third party is in down status or hidden state.First preset value can be set as needed, for representing third Side is in down status or hidden state.
In the present embodiment, mark third party state in third party's tables of data of directly being changed by program realizes that third party is offline Operation instead of artificial offline operation, realizes the automation of process, saves man power and material.
In one embodiment, the step of transmission alarm information includes:Instant messaging application interface is called to send to accuse Alert message.
In the present embodiment, instant messaging application interface refers to the interface for being used for transmission alarm information that test lead is accessed. By the way that instant messaging interface is called to send alarm information, alarm information can be transmitted in time.
In one embodiment, the step of transmission alarm information includes:Alarm information is sent with E-mail mode.
In the present embodiment, the email address of alarm information recipient can be pre-set, by alarm information with Email side Formula is sent to the email address of recipient.
In one embodiment, the step of transmission alarm information includes:Alarm information is sent with short message mode.
In the present embodiment, the mobile communication number of alarm information recipient can be pre-set, will be alerted by short message mode Message is sent to the mobile communication number of recipient.
In one embodiment, as shown in fig. 6, it is described the third party reach the standard grade operation the step of include:
Step 602, the second Status Change instruction comprising third party's mark is obtained.
In the present embodiment, third party's mark is the character string for uniquely representing third party's identity.Second Status Change refers to Enable the instruction referred to for changing state.
Step 604, third party's identifier lookup in being instructed according to second Status Change is to corresponding third party's data Table.
In the present embodiment, record has the correspondence of third party's mark and third party's tables of data in test lead.According to Third party's mark in two-state alteration command finds corresponding from third party's mark with the correspondence of third party's tables of data Third party's tables of data.
Step 606, it changes default for second for indicating the value of the field of third party's state in third party's tables of data Value, so that third party is in state of reaching the standard grade.
It is pre- for indicating the value second of the field of third party's state in third party's tables of data by changing in the present embodiment If value, it may be such that third party is in state of reaching the standard grade.Second preset value can be set as needed, and reach the standard grade for representing that third party is in State.
In the present embodiment, mark third party state in third party's tables of data of directly being changed by program realizes that third party reaches the standard grade Operation, instead of operation of manually reaching the standard grade, realizes the automation of process, saves man power and material.
In one embodiment, operation of reaching the standard grade is carried out to third party, including:By the way that switch is controlled to be switched into from the second state Enter first state, operation of reaching the standard grade is carried out to the corresponding third party of third party's network address, the first state represents third In state of reaching the standard grade, second state represents that third party is in down status or hidden state for side.
In order to realize that the test frame of the method institute framework of monitoring third party's interface is as shown in Figure 7.The test frame includes Key-course, logical layer and interface layer.Wherein, key-course is mainly the control of third party's switch.It can pass through modification the in key-course The status fields of tripartite's tables of data carry out reach the standard grade operation or offline operation.Logical layer is for monitoring multiple third party's interfaces. Logical layer mainly simulates and sends HTTP request, judges to call third party's interface success or failure according to HTTP return codes.It connects Mouth layer is mainly that instant messaging application interface or other application interface is called to send the interface of alarm information.It can be set in interface layer The alarm account of instant messaging application and alarm IP (Internet Protocol, Internet protocol) address, can change Instant Messenger Believe application interface and instant messaging application interface is packaged.
Test frame may also include dependence packet.The jar packets that packet refers to program, such as junit4.1.jar are relied on, Jython.jar etc..For junit for asserting, jython is for calling python programs when being write using java language It is used.
Further, code is put into SVN (Subversion), and the setting monitoring number in Jekins continuous integratings (the primary monitoring of preset interval time operation).Jekins is an open source software project, it is desirable to provide an opening is easy-to-use soft Part platform makes the continuous integrating of software become possible.Continuous integrating is a kind of practice of software, i.e., team's exploitation member is frequent Their work is integrated, it is at least integrated primary daily by each member.Collect Chengdu every time by the structure of automation (including compiling Translate, issue, automatic test) it verifies, so as to find integrated mistake as soon as possible.SVN is the version control of an open source code System processed.It simultaneously can be by Maven item objects model come the structure of management project, report and the software project management of document.
The parameter information of third party's interface is described with reference to specific application scenarios.As service platform for medical treatment register it is flat Platform, third party are medical treatment 160.
The information interface parameter of arranging an order according to class and grade of medical treatment 160 is as shown in table 1.
Table 1
Wherein, channel number is intended to indicate that the unique character string of channel.
Third party is micro- doctor, and the systematic parameter for information interface of arranging an order according to class and grade is as shown in table 2, and required parameter is as shown in table 3.
Table 2
Wherein, API (Application Programming Interface, application programming interfaces) interface name is Tripartite arranges an order according to class and grade interface name.Appkey refers to the unique key of application program.
Table 3
Title Type It is whether necessary Length Description
hospDeptId String It is Hospital department UUID
date String It is no 8 It arranges an order according to class and grade the date, form 20151111
The interface IP address that third party is C is http://jkxapi.91jkj.com:8082/jkxopenapi/ Wechatcity, required parameter are as shown in table 4.
Table 4
By third-party interface by simulate HTTP send request, be passed in a manner of post, fill in it is relevant enter ginseng and ginseng If there is information header, the parameter of information header and parameter value are inserted for numerical value.
It is not 200 when getting HTTP conditional codes, then it represents that third party's interface malloc failure malloc then sends alarm information to pre- The recipient first set.Alarm information can alarm time, warning content and alarm grade.Alarm time refer to send alarm when Between.For example, alarm time 10 divides 10 seconds when being 20 days 10 October in 2016.Warning content can be that third party is medical treatment 160, obtain Doctor arranges an order according to class and grade information interface malloc failure malloc.Grade (severity level) is alerted as height.
For offline operation, can database be connected by program code, by operating third party's tables of data, third is such as set Square tables of data t_platform_hospital.status=0 (0 represent offline) whereplatform_name=" sees a doctor 160 " to realize to 160 offline operations of seeing a doctor.
For operation of reaching the standard grade, database is connected by program code, by operating third party's tables of data, third party is such as set Tables of data t_platform_hospital.status=1 (1 representative is reached the standard grade) where platform_name=" medical treatments 160 " to realize operation of reaching the standard grade to medical treatment 160.
Fig. 8 is the structure diagram of the device of monitoring third party's interface in one embodiment.As shown in figure 8, a kind of monitoring the The device 800 of tripartite's interface is sent including request sending module 802, receiving module 804, conditional code detection module 806, alarm Module 808, condition judgment module 810 and Status Change module 812.Wherein:
Request sending module 802 sends access request for simulating hypertext transfer protocol to third party's network address.
In the present embodiment, test lead sends access request by simulating hypertext transfer protocol to third party's network address. Third party's network address refers to the network address of the third party partner of access service platform.Service platform refers to provide certain spies Determine the server of function, such as medical treatment is registered platform, the vehicle number of shaking platform, driving license test registration platform etc..Third party's network Location can be Tongji University's hospital network address, BJ Univ Hospital's network address, Shenzhen driving license test registration network address, Beijing driving license test Network address of registering etc..
In the present embodiment, it can be sent out according to preset interval time timing simulation hypertext transfer protocol to third party's network address Send access request.Preset interval time can be set as needed, and send within such as 5 minutes primary.
Receiving module 804 responds the access request returned hypertext transfer protocol state for receiving Code.
In the present embodiment, the reception accessed end of receiving module 804 of test lead carries out access request response return and surpasses Text transfer protocol conditional code.Hypertext transfer protocol conditional code is to represent that the hypertext transfer protocol of web page server is rung Answer the digital code of state.
Conditional code detection module 806 is used to judge whether the hypertext transfer protocol conditional code is preset state code.
In the present embodiment, preset state code is to represent that third party's interface calls successful conditional code, such as 200,201.It surveys The hypertext transfer protocol conditional code of return is compared by the conditional code detection module 806 at examination end with preset state code, is judged It is whether identical, if identical, then it represents that third party's interface calls successfully, if differing, then it represents that third party's interface malloc failure malloc.
If alarm sending module 808 is used to judge that the hypertext transfer protocol conditional code is not preset state code, It represents third party's interface malloc failure malloc, then sends alarm information.
In the present embodiment, alarm information may include alarm time, warning content and alarm grade.Alarm time refers to send The time of alarm.Warning content refers to the concrete condition of calling interface failure.Alarm level refers to the serious of calling interface failure Rank.
If condition judgment module 810 is sentenced for judging that the hypertext transfer protocol conditional code is preset state code Whether the corresponding third party of third party's network address of breaking is in down status;
If Status Change module 812 is in down status for third party, operation of reaching the standard grade is carried out to the third party.
In the present embodiment, when judging the hypertext transfer protocol conditional code for preset state code, and judge third When the corresponding third party of square network address is in down status, operation of reaching the standard grade is carried out to third party.Operation of reaching the standard grade refers to third Square access service platform so that third party is in state of reaching the standard grade.The state of reaching the standard grade refers to that third party is in the shape of access service platform State can view third party's information in user terminal.
For offline third party, if it is normal to monitor third party's calling interface, third party is subjected to operation of reaching the standard grade, Facilitate user that can enjoy the service that the third party is provided.
The device of above-mentioned monitoring third party interface sends visit by simulating hypertext transfer protocol to third party's network address It asks request, judges to respond whether returned hypertext transfer protocol conditional code is preset state code to access request, if not Preset state code, then it represents that call the failure of third party's interface, send alarm information, can find third party's interface malloc failure malloc in time The problem of, monitoring efficiency is improved, when for preset state code, and when third party is in down status or hidden state, to third Fang Jinhang reaches the standard grade operation.
Fig. 9 is the structure diagram of the device of monitoring third party's interface in another embodiment.As shown in figure 9, a kind of monitoring The device 800 of third party's interface, in addition to including request sending module 802, receiving module 804, conditional code detection module 806, accusing Alert sending module 808, condition judgment module 810 and Status Change module 812, further include statistical module 814, number judgment module 816.Wherein:
Statistical module 814 is used to count third party's interface malloc failure malloc number in preset time.
In the present embodiment, third party's interface malloc failure malloc is primary, then statistics is primary, obtains the statistics time in preset time Number.Preset time can be set as needed.
Number judgment module 816 is used to judge whether the number of statistics to be more than frequency threshold value.
If Status Change module 812 is more than frequency threshold value for the number of statistics, to third party's network address pair The third party answered carries out offline operation or hides operation.
In the present embodiment, offline operation refers to third party interrupting access service platform so that third party is in lower threadiness State.Hiding operation refers to hide third party in service platform so that third party is in hidden state, can not be checked in user terminal Third party's information.
The device of monitoring third party's interface in the present embodiment, by simulating hypertext transfer protocol to third party's network Location sends access request, judges to respond whether returned hypertext transfer protocol conditional code is preset state to access request Code, if not preset state code, then it represents that call the failure of third party's interface, send alarm information, can find that third party connects in time The problem of mouth malloc failure malloc, improve monitoring efficiency;The number of third party's interface malloc failure malloc in preset time is counted, if calling The number of failure is more than frequency threshold value, then the third party is carried out offline operation or hide operation, avoid subsequently continuing this Third party's interface malloc failure malloc.
Status Change module 812 is additionally operable to obtain the first state for including third party's mark in one of the embodiments, Alteration command;Third party's identifier lookup in the first state alteration command is to corresponding third party's tables of data;And It is the first preset value to change the value for being used to indicate the field of third party's state in third party's tables of data, so that third party is in Down status or hidden state.
It is pre- for indicating the value first of the field of third party's state in third party's tables of data by changing in the present embodiment If value, may be such that third party is in down status or hidden state.First preset value can be set as needed, for representing third Side is in down status or hidden state.
Alarm sending module 808 is additionally operable to that instant messaging application interface is called to send alarm in one of the embodiments, Message;Alternatively, alarm information is sent with E-mail mode or short message mode.
Figure 10 is the structure diagram of the device of monitoring third party's interface in another embodiment.As shown in Figure 10, Yi Zhongjian Control third party's interface device 800, in addition to include request sending module 802, receiving module 804, conditional code detection module 806, Sending module 808, condition judgment module 810 and Status Change module 812 are alerted, further includes statistical module 814, number judges mould Block 816 further includes message generation and release module 818.Wherein:
If message generates and release module 818 is more than frequency threshold value for the number of statistics, generate to the third party The corresponding third party of network address carries out offline operation or hides the offline message of operation, and the offline news release is disappeared Cease theme.
Status Change module 812 is additionally operable to obtain the offline message from the message subject, offline is disappeared according to described Breath carries out the third party offline operation or hides operation.
In one embodiment, Status Change module 812 is additionally operable to by the way that switch is controlled to switch into the from first state Two-state carries out the corresponding third party of third party's network address offline operation or hides operation, the first state table Show that third party is in state of reaching the standard grade, second state represents that third party is in down status or hidden state.
Status Change module 812 is additionally operable to obtain the second state for including third party's mark in one of the embodiments, Alteration command;Third party's identifier lookup in being instructed according to second Status Change is to corresponding third party's tables of data;And It is the second preset value to change the value for being used to indicate the field of third party's state in third party's tables of data, so that third party is in It reaches the standard grade state.
It is pre- for indicating the value second of the field of third party's state in third party's tables of data by changing in the present embodiment If value, it may be such that third party is in state of reaching the standard grade.Second preset value can be set as needed, and reach the standard grade for representing that third party is in State.
In one embodiment, Status Change module 812 is additionally operable to by the way that switch is controlled to switch into the from the second state One state, carries out the corresponding third party of third party's network address operation of reaching the standard grade, and the first state is represented at third party In the state of reaching the standard grade, second state represents that third party is in down status or hidden state.
In other embodiments, a kind of device 800 for monitoring third party's interface, it may include request sending module 802 receives Module 804, conditional code detection module 806, alarm sending module 808, condition judgment module 810 and Status Change module 812, also Including statistical module 814, number judgment module 816, message generation and the arbitrary possible combination of release module 818 are further included.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read In storage medium, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage is situated between Matter can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) etc..
Embodiment described above only expresses the several embodiments of the present invention, and description is more specific and detailed, but simultaneously Cannot the limitation to the scope of the claims of the present invention therefore be interpreted as.It should be pointed out that for those of ordinary skill in the art For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the guarantor of the present invention Protect range.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (14)

1. a kind of method for monitoring third party's interface, including:
It simulates hypertext transfer protocol and sends access request to third party's network address;
Reception responds the access request returned hypertext transfer protocol conditional code;
Judge whether the hypertext transfer protocol conditional code is preset state code;
If it is not preset state code to judge the hypertext transfer protocol conditional code, then it represents that third party's interface malloc failure malloc, Then send alarm information;
If judging the hypertext transfer protocol conditional code for preset state code, judge that third party's network address corresponds to Third party whether in down status or hidden state, if third party is in down status or hidden state, to described the Tripartite carries out operation of reaching the standard grade.
2. according to the method described in claim 1, it is characterized in that, the method further includes:
Count third party's interface malloc failure malloc number in preset time;
Judge whether the number of statistics is more than frequency threshold value;
If statistics number be more than frequency threshold value, to the corresponding third party of third party's network address carry out it is offline operation or Hide operation.
3. according to the method described in claim 2, it is characterized in that, the method further includes:
If the number of statistics is more than frequency threshold value, generation carries out offline behaviour to the corresponding third party of third party's network address Make or hide the offline message of operation, and by the offline news release to message subject, and obtained from the message subject The offline message carries out the third party according to the offline message offline operation or hides operation.
4. according to the method in claim 2 or 3, which is characterized in that third party corresponding to third party's network address It carries out offline operation or includes the step of hiding operation:
Obtain the first state alteration command for including third party's mark;
Third party's identifier lookup in the first state alteration command is to corresponding third party's tables of data;
It is the first preset value to change the value for being used to indicate the field of third party's state in third party's tables of data, so that third party In down status or hidden state.
5. according to the method in claim 2 or 3, which is characterized in that described corresponding to third party's network address Tripartite carries out offline operation or includes the step of hiding operation:
By the way that switch is controlled from first state to switch into the second state, to the corresponding third party of third party's network address into Operation is hidden in the offline operation of row, and the first state represents that third party is in state of reaching the standard grade, and second state represents third Side is in down status or hidden state.
6. according to the method described in claim 1, it is characterized in that, described simulate hypertext transfer protocol to third party's network The step of location transmission access request, includes:
According to preset interval time timing simulation hypertext transfer protocol access request is sent to third party's network address;
The step of transmission alarm information, includes:
Instant messaging application interface is called to send alarm information;
Alternatively, alarm information is sent with E-mail mode or short message mode.
7. according to the method described in claim 4, it is characterized in that, it is described the third party reach the standard grade operation the step of wrap It includes:
Obtain the second Status Change instruction comprising third party's mark;
Third party's identifier lookup in being instructed according to second Status Change is to corresponding third party's tables of data;
It is the second preset value to change the value for being used to indicate the field of third party's state in third party's tables of data, so that third party In the state of reaching the standard grade.
8. a kind of device for monitoring third party's interface, which is characterized in that including:
Request sending module sends access request for simulating hypertext transfer protocol to third party's network address;
Receiving module responds the access request returned hypertext transfer protocol conditional code for receiving;
Conditional code detection module, for judging whether the hypertext transfer protocol conditional code is preset state code;
Sending module is alerted, if for judging that the hypertext transfer protocol conditional code is not preset state code, then it represents that the Tripartite's interface malloc failure malloc, then send alarm information;
Condition judgment module, if for judging the hypertext transfer protocol conditional code for preset state code, described in judgement Whether the corresponding third party of third party's network address is in down status;
If being in down status for third party, operation of reaching the standard grade is carried out to the third party for Status Change module.
9. device according to claim 8, which is characterized in that described device further includes:
Statistical module, for counting third party's interface malloc failure malloc number in preset time;
Number judgment module, for judging whether the number of statistics is more than frequency threshold value;
If the number that the Status Change module is additionally operable to statistics is more than frequency threshold value, third party's network address is corresponded to Third party carry out it is offline operation or hide operation.
10. device according to claim 9, which is characterized in that described device further includes:
Message generates and release module, if the number for statistics is more than frequency threshold value, generation is to third party's network The corresponding third party in location carries out offline operation or hides the offline message of operation, and give the offline news release to message master Topic;
The Status Change module is additionally operable to obtain the offline message from the message subject, according to the offline message pair The third party carries out offline operation or hides operation.
11. device according to claim 9 or 10, which is characterized in that the Status Change module is additionally operable to obtain and include The first state alteration command of third party's mark;Third party's identifier lookup in the first state alteration command is to corresponding to Third party's tables of data;It is and pre- for first for indicating the value of the field of third party's state in modification third party's tables of data If value, so that third party is in down status or hidden state.
12. device according to claim 9 or 10, which is characterized in that the Status Change module is additionally operable to pass through control Switch from first state switches into the second state, the corresponding third party of third party's network address is carried out offline operation or Operation is hidden, the first state represents that third party is in state of reaching the standard grade, and second state represents that third party is in lower threadiness State or hidden state.
13. device according to claim 8, which is characterized in that the request sending module is additionally operable to according to predetermined interval Time timing simulation hypertext transfer protocol sends access request to third party's network address;
The alarm sending module is additionally operable to that instant messaging application interface is called to send alarm information;Alternatively, with Email side Formula or short message mode send alarm information.
14. according to the devices described in claim 11, which is characterized in that the second Status Change module is additionally operable to obtain and include The second Status Change instruction of third party's mark;According to second Status Change instruct in third party's identifier lookup to correspondence Third party's tables of data;It is and pre- for second for indicating the value of the field of third party's state in modification third party's tables of data If value, so that third party is in state of reaching the standard grade.
CN201611094353.8A 2016-12-01 2016-12-01 Method and device for monitoring third-party interface Active CN108134708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611094353.8A CN108134708B (en) 2016-12-01 2016-12-01 Method and device for monitoring third-party interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611094353.8A CN108134708B (en) 2016-12-01 2016-12-01 Method and device for monitoring third-party interface

Publications (2)

Publication Number Publication Date
CN108134708A true CN108134708A (en) 2018-06-08
CN108134708B CN108134708B (en) 2021-05-25

Family

ID=62388347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611094353.8A Active CN108134708B (en) 2016-12-01 2016-12-01 Method and device for monitoring third-party interface

Country Status (1)

Country Link
CN (1) CN108134708B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108845912A (en) * 2018-06-11 2018-11-20 掌阅科技股份有限公司 Service interface calls the alarm method of failure and calculates equipment
CN110086658A (en) * 2019-04-11 2019-08-02 平安科技(深圳)有限公司 Interface switching method, device and computer readable storage medium
CN110224870A (en) * 2019-06-19 2019-09-10 腾讯云计算(北京)有限责任公司 Interface monitoring method, apparatus calculates equipment and storage medium
CN111861062A (en) * 2019-04-30 2020-10-30 北京嘀嘀无限科技发展有限公司 User index management method, device, server and computer readable storage medium
CN113114490A (en) * 2021-03-30 2021-07-13 海信集团控股股份有限公司 API call abnormity warning method, device, equipment and medium
CN113282460A (en) * 2021-05-27 2021-08-20 中国联合网络通信集团有限公司 Distributed alarm system, method and device
CN113676509A (en) * 2021-07-06 2021-11-19 北京思特奇信息技术股份有限公司 Active detection method and system for health state of HTTP (hyper text transport protocol) interface
CN115941546A (en) * 2022-11-29 2023-04-07 重庆长安汽车股份有限公司 System interface monitoring method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404599A (en) * 2008-11-12 2009-04-08 华为技术有限公司 Network fault detection method, primary device, slave device, control terminal and system
CN103685575A (en) * 2014-01-06 2014-03-26 洪高颖 Website security monitoring method based on cloud architecture
CN104065725A (en) * 2014-06-25 2014-09-24 北京思特奇信息技术股份有限公司 System real-time monitoring method based on hyper text transfer protocol (HTTP) and system
CN104735736A (en) * 2013-12-24 2015-06-24 ***通信集团公司 Network access method and user terminal
WO2015089824A1 (en) * 2013-12-20 2015-06-25 华为技术有限公司 Method and apparatus for switching polling and interruption
CN104767653A (en) * 2015-01-29 2015-07-08 小米科技有限责任公司 Method and device for monitoring network interfaces
CN105872090A (en) * 2016-05-27 2016-08-17 四川长虹电器股份有限公司 HTTP communication method based on extension status codes

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404599A (en) * 2008-11-12 2009-04-08 华为技术有限公司 Network fault detection method, primary device, slave device, control terminal and system
WO2015089824A1 (en) * 2013-12-20 2015-06-25 华为技术有限公司 Method and apparatus for switching polling and interruption
CN104735736A (en) * 2013-12-24 2015-06-24 ***通信集团公司 Network access method and user terminal
CN103685575A (en) * 2014-01-06 2014-03-26 洪高颖 Website security monitoring method based on cloud architecture
CN104065725A (en) * 2014-06-25 2014-09-24 北京思特奇信息技术股份有限公司 System real-time monitoring method based on hyper text transfer protocol (HTTP) and system
CN104767653A (en) * 2015-01-29 2015-07-08 小米科技有限责任公司 Method and device for monitoring network interfaces
CN105872090A (en) * 2016-05-27 2016-08-17 四川长虹电器股份有限公司 HTTP communication method based on extension status codes

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108845912A (en) * 2018-06-11 2018-11-20 掌阅科技股份有限公司 Service interface calls the alarm method of failure and calculates equipment
CN110086658A (en) * 2019-04-11 2019-08-02 平安科技(深圳)有限公司 Interface switching method, device and computer readable storage medium
CN110086658B (en) * 2019-04-11 2022-09-30 平安科技(深圳)有限公司 Interface switching method and device and computer readable storage medium
CN111861062A (en) * 2019-04-30 2020-10-30 北京嘀嘀无限科技发展有限公司 User index management method, device, server and computer readable storage medium
CN111861062B (en) * 2019-04-30 2023-09-26 北京嘀嘀无限科技发展有限公司 User index management method, device, server and computer readable storage medium
CN110224870A (en) * 2019-06-19 2019-09-10 腾讯云计算(北京)有限责任公司 Interface monitoring method, apparatus calculates equipment and storage medium
CN110224870B (en) * 2019-06-19 2023-03-24 腾讯云计算(北京)有限责任公司 Interface monitoring method and device, computing equipment and storage medium
CN113114490A (en) * 2021-03-30 2021-07-13 海信集团控股股份有限公司 API call abnormity warning method, device, equipment and medium
CN113114490B (en) * 2021-03-30 2023-10-27 海信集团控股股份有限公司 API call abnormity warning method, device, equipment and medium
CN113282460A (en) * 2021-05-27 2021-08-20 中国联合网络通信集团有限公司 Distributed alarm system, method and device
CN113676509A (en) * 2021-07-06 2021-11-19 北京思特奇信息技术股份有限公司 Active detection method and system for health state of HTTP (hyper text transport protocol) interface
CN115941546A (en) * 2022-11-29 2023-04-07 重庆长安汽车股份有限公司 System interface monitoring method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN108134708B (en) 2021-05-25

Similar Documents

Publication Publication Date Title
CN108134708A (en) The method and apparatus for monitoring third party's interface
CN106464746B (en) Support the method and non-transitory computer-readable media and system of the failure transfer in event stream processing system
CN103795762B (en) A kind of test method and system of reverse proxy
GB2519621A (en) Business transaction correlation with client request monitoring data
JP2007183890A (en) Living condition monitoring system, apparatus, method, and program
CN107092544A (en) monitoring method and device
CN104834588B (en) The method and apparatus for detecting resident formula cross site scripting loophole
CN110659206A (en) Simulation architecture establishing method, device, medium and electronic equipment based on microservice
CN111857928A (en) Page task access method, device and system, electronic equipment and storage medium
AU2015213307A1 (en) Method for setting heartbeat timer, terminal and server
CN115065652B (en) Message reply method and device, storage medium and computer equipment
US8374320B2 (en) Environment information transmission method, service controlling system, and computer product
CN114598671B (en) Session message processing method, device, storage medium and electronic equipment
CN106845270A (en) A kind of seamless browsing method and device
JP5555584B2 (en) Access history management server, program and method for Web site
CN110619541B (en) Application program management method, device, computer equipment and storage medium
CN114615223B (en) Examination unmanned monitoring instant messaging method, examination unmanned monitoring instant messaging equipment, examination unmanned monitoring instant messaging system and storage medium
CN103678332A (en) System, browser and method for displaying page
CN110048940A (en) Sending method, device, server and the readable storage medium storing program for executing of instant communication message
CN112817816B (en) Embedded point processing method and device, computer equipment and storage medium
WO2016027173A1 (en) Method of and a system for monitoring web site consistency
CN110837454A (en) Interface monitoring processing method and server
CN105930386A (en) Information push control method and device and terminal equipment
JP2006133868A (en) Failure diagnosis and analysis system and method
CN110658969A (en) Picture processing method, device, equipment and storage medium

Legal Events

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