WO2019019394A1 - 客户端异常定位方法、装置、计算机设备和存储介质 - Google Patents

客户端异常定位方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2019019394A1
WO2019019394A1 PCT/CN2017/104846 CN2017104846W WO2019019394A1 WO 2019019394 A1 WO2019019394 A1 WO 2019019394A1 CN 2017104846 W CN2017104846 W CN 2017104846W WO 2019019394 A1 WO2019019394 A1 WO 2019019394A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
request
client
log
return code
Prior art date
Application number
PCT/CN2017/104846
Other languages
English (en)
French (fr)
Inventor
柯星
刘慧众
丁晶晶
Original Assignee
上海壹账通金融科技有限公司
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 上海壹账通金融科技有限公司 filed Critical 上海壹账通金融科技有限公司
Publication of WO2019019394A1 publication Critical patent/WO2019019394A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0709Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a distributed system consisting of a plurality of standalone computer nodes, e.g. clusters, client-server systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a client abnormal positioning method, apparatus, computer device, and storage medium.
  • the packet capture software can be used to capture the response data of the server, but the interface log of the server cannot be captured, and the response data can only be abnormally located. As a result, the positioning time is longer and the efficiency is lower.
  • a client anomaly positioning method is provided.
  • a client exception location method includes:
  • the client running in the terminal sends a request to the server
  • the request is intercepted, and the request identifier corresponding to the request is recorded;
  • the intercepted request is forwarded to the server, so that the server returns a corresponding response according to the request. data;
  • the response data returned by the server is intercepted, and the intercepted response data is recorded to the response file;
  • the log content is captured in the interface log of the server according to the request identifier, and the log file is generated by using the captured log content;
  • the client's exception is located by using the response file and the log file.
  • a client abnormal positioning device comprising:
  • the agent is configured to: when the client running in the terminal sends a request to the server, intercept the request, record the request identifier corresponding to the request; forward the intercepted request to the server, so that the server performs the The request returns the corresponding response data; intercepts the response data returned by the server, records the intercepted response data to the response file; and forwards the intercepted response data to the client;
  • the location service is used to capture the log content in the interface log of the server according to the request identifier, generate a log file by using the captured log content, and use the response file and the log file to perform abnormalities on the client. Positioning.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executable by the processor to cause the one or more processors to execute The following steps:
  • the client running in the terminal sends a request to the server
  • the request is intercepted, and the request identifier corresponding to the request is recorded;
  • the intercepted request is forwarded to the server, so that the server returns a corresponding response according to the request. data;
  • the response data returned by the server is intercepted, and the intercepted response data is recorded to the response file;
  • the log content is captured in the interface log of the server according to the request identifier, and the log file is generated by using the captured log content;
  • the client's exception is located by using the response file and the log file.
  • One or more computer readable non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of:
  • the client running in the terminal sends a request to the server
  • the request is intercepted, and the request identifier corresponding to the request is recorded;
  • the intercepted request is forwarded to the server, so that the server returns a corresponding response according to the request. data;
  • the response data returned by the server is intercepted, and the intercepted response data is recorded to the response file;
  • the log content is captured in the interface log of the server according to the request identifier, and the log file is generated by using the captured log content;
  • the client's exception is located by using the response file and the log file.
  • FIG. 1 is an application scenario diagram of a client abnormal positioning method in an embodiment
  • FIG. 2 is a block diagram of the intermediate server of Figure 1;
  • FIG. 3 is a flowchart of a client abnormal positioning method in an embodiment
  • FIG. 4 is a block diagram of a client anomaly locating device in one embodiment.
  • the client abnormal positioning method provided in the embodiment of the present application can be applied to the method shown in FIG. 1 In the application scenario.
  • the terminal 102 is connected to the intermediate server 104 via a network.
  • the intermediate server 104 is connected to the local server 106 via a network.
  • the intermediate server 104 is connected to the third party server 108 via a network.
  • the client is running on the terminal 102.
  • the local server is running on the local server 106.
  • a third-party server is running on the third-party server.
  • Local servers and third-party servers can be collectively referred to as servers.
  • the intermediate server 104 intercepts the request and logs the request to the request file.
  • the request file includes the request identifier and the request packet corresponding to the request.
  • the intermediate server 104 forwards the request to the local server or the third party server.
  • the local server or the third party server returns corresponding response data according to the request, and the intermediate server 104 intercepts the response data, and records the intercepted response data to the response file.
  • the intermediate server 104 forwards the intercepted response data to the client.
  • the intermediate server 104 captures the log content in the interface log of the server according to the request identifier, and generates a corresponding log file by using the captured log content.
  • the intermediate server 104 uses the response file and the log file to locate an abnormality of the client, thereby effectively improving the abnormal positioning efficiency.
  • the intermediate server includes a processor, memory, and network interface connected by a system bus.
  • the processor of the intermediate server is used to provide computing and control capabilities.
  • the memory of the intermediate server includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium of the intermediate server stores an operating system, a database, and computer readable instructions.
  • the request file, response file, and log file are stored in the database.
  • the internal memory of the intermediate server provides an environment for the operation of the operating system and computer readable instructions in the non-volatile storage medium.
  • the network interface of the intermediate server is used for communication through a network connection with a client, a local server, and a third party server.
  • the computer readable instructions are executed by the processor to implement a client anomaly positioning method.
  • FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied.
  • the specific server may include More or fewer components than shown in the figure, or some components combined, or with different component arrangements.
  • a client anomaly positioning method is provided. It should be understood that although the various steps in the flowchart of FIG. 3 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and may be performed in other sequences. Moreover, at least some of the steps in FIG. 3 may include a plurality of sub-steps or stages, which are not necessarily performed at the same time, but may be executed at different times, and the order of execution thereof is not necessarily This may be performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of the other steps.
  • the method is applied to the intermediate server as an example, and specifically includes the following steps:
  • Step 302 When the client running in the terminal sends a request to the server, intercept the request, and record the request identifier corresponding to the request.
  • the client runs on the terminal, and the client can send a request to the corresponding server, so that the client can provide the corresponding function to the user, for example, obtaining a certain page, or performing a certain query.
  • the agent runs on the intermediate server. When the client sends a request to its corresponding server, the intermediate server intercepts the request sent by the client through the agent, and records the intercepted request into the request file. The request identifier and request packet corresponding to each request are recorded in the request file.
  • Step 304 Forward the intercepted request to the server, so that the server returns corresponding response data according to the request.
  • Step 306 intercepting the response data returned by the server, and recording the intercepted response data to the response file.
  • Step 308 forwarding the intercepted response data to the client.
  • the server corresponding to the client includes a local server and a third party server.
  • the target server is also carried in the request, and the target server may be a local server or a third party server.
  • the agent forwards the request to the local server or the third party server according to the target server carried in the request.
  • the local server may identify whether it is a request for its own response according to the request packet, and if so, the local server returns response data according to the request. Otherwise, the local server forwards the request to the third party server so that the third party server returns response data according to the request.
  • the agent intercepts the response data returned by the local server or the third party server, and records the intercepted response data to the response file. After the record is completed, the agent forwards the intercepted response data to the client. In order to enable the client to obtain response data corresponding to the request, thereby providing the user with the corresponding function.
  • Step 310 When an abnormality occurs on the client, the log content is captured in the interface log of the server according to the request identifier, and the log file is generated by using the captured log content.
  • Step 312 using the response file and the log file to locate the abnormality of the client.
  • the intermediate server starts the location service and uses the location service to capture the log content of the interface log of the server.
  • the location service obtains the interface log of the local server, and the interface log of the third-party server, and according to the request identifier, the corresponding log content is captured in the interface log of the local server and/or the interface log of the third-party server, and the corresponding log content is captured.
  • the log content generates the corresponding log file.
  • the location service uses response files and log files to locate client exceptions.
  • the step of locating the abnormality of the client by using the response file and the log file includes: obtaining a return code in the response file; if the return code is the same as the preset value, the recording exception occurs on the client; If the return code is different from the preset value, the record exception occurs on the server; the server includes the local server and the third server; when the exception occurs on the server, the log file is used to identify whether the exception occurs on the local server, and if so, The record exception occurs on the local server, otherwise the record exception occurs on the third-party server.
  • the return code is carried in the response data.
  • the location service obtains the response file and extracts the return code from the response file.
  • the location service determines whether the return code is a preset value, and if so, the return code is normal.
  • the return code is normal, indicating that there is no abnormality on the side of the server.
  • the location service can determine that the client's exception occurs on the client side.
  • the positioning application can also obtain log files corresponding to multiple requests. Use log files to identify whether an exception occurred on a local server or a third-party server.
  • the module that locates the abnormality can be located through the log file, so that the abnormal part can be accurately located. If an abnormality is found to occur on the third-party server, the location service generates an exception notification, and the exception notification is generated to the third-party server, so that the third party can repair the abnormality in time.
  • the intercepted request can be recorded to the request file in real time by intercepting the request.
  • the intercepted response data can be recorded to the response file in real time through the response data returned by the server.
  • the content of the interface log of the server can be captured by the recorded request identifier, and a corresponding log file is generated, so that the response data and the log file can be used to quickly locate the abnormal part. Therefore, when an abnormality occurs in the client, the abnormal positioning efficiency can be effectively improved.
  • the step of identifying whether the abnormality occurs on the local server by using the log file includes: marking a return code different from the preset value as an abnormal return code; and querying, in the log file, whether the source corresponding to the abnormal return code is Local server; if it is, the logging exception occurs on the local server.
  • the intermediate server captures the corresponding log content in the interface log of the server through the location service, and generates a log file corresponding to the multiple requests by using the captured log content.
  • the log content captured from the interface logs of different servers can generate a log file, and the source of the log content can be marked in the log file.
  • the request identifier, the request packet, and the corresponding response data are recorded in the log file.
  • the response data includes a return code.
  • the location service can mark the return code as an abnormal return code.
  • the location service queries the source of the abnormal return code in the log file. If the corresponding source is the local server, the exception occurs on the local server. If the source of the abnormal return code is a third-party server, the exception occurs on the third-party server.
  • the server where the abnormality is located can be quickly identified.
  • exception return codes there may be multiple exception return codes. If the source of the partial exception return code is the local server, and the source of the other part of the abnormal return code is the third-party server, it indicates that the local server and the third-party server have an exception.
  • the log file includes a local log file and a third-party log file
  • the step of identifying whether the abnormality occurs on the local server by using the log file includes: marking a return code different from the preset value as an abnormal return code; acquiring local Log file, query the local log file for the existence of an abnormal return code; if it exists, the record exception occurs on the local server.
  • the intermediate server captures the corresponding log content in the interface log of the server through the location service, and generates a log file corresponding to the multiple requests by using the captured log content.
  • Different log files can be generated from the log content captured from the interface logs of different servers.
  • the log file generated by using the log content captured from the interface log of the local server may be referred to as a local log file.
  • a log file generated using log content retrieved from an interface log of a third-party server may be referred to as a third-party log file.
  • the request identifier, the request packet, and the corresponding response data are recorded in the log file.
  • the response data includes a return code.
  • the location service can mark the return code as an abnormal return code.
  • the location service can query the local log file for the existence of an abnormal return code. If it exists, it indicates that the exception occurs on the local server. If it does not exist, the location service can query the third-party log file for the existence of an abnormal return code. If it exists, it indicates that the exception occurs on the third-party server. Therefore, when an abnormality occurs on the client, the server where the abnormality is located can be quickly identified.
  • the location service can query some abnormal return codes in the local log file and query another part of the abnormal return code in the third-party log file, it means that the local server and the third-party server have abnormalities.
  • the method further includes: when the abnormality of the client occurs on the local server, acquiring a data flow direction and a service flow direction between the plurality of program modules of the local server according to the log file; and abnormally according to the data flow direction and the service flow direction Position the part.
  • a number of program modules are running on the local server to support the work of the local server.
  • Program The module has a corresponding interface.
  • the local server can call different program modules through different interfaces.
  • the location service can use the log file to analyze the data flow and service flow corresponding to multiple program modules in the local server, thereby accurately positioning the abnormality.
  • Program module can use the log file to analyze the data flow and service flow corresponding to multiple program modules in the local server, thereby accurately positioning the abnormality.
  • the step of obtaining a data flow direction and a service flow direction between the plurality of program modules of the local server according to the log file includes: acquiring a log structure corresponding to the plurality of program modules according to the log file; corresponding to the plurality of modules The log structure is parsed to obtain data flow and service flow between multiple program modules on the local server.
  • the input and output of each program module can be included in the interface log.
  • the input may include a delivery parameter corresponding to the request packet, and the output may include response data corresponding to the request packet.
  • the location service can obtain a log file, and the log file includes log contents of a plurality of program modules that communicate with the client.
  • the location service extracts the log structure of the program module, extracts the input and output of each program module, and obtains the data flow between multiple program modules according to the input and output between the program modules.
  • the location service obtains the calling relationship between the program modules by parsing the log structure of the program module. According to the calling relationship between program modules, the flow of services between multiple program modules can be obtained.
  • the location service can locate the abnormality in a specific program module according to the data flow direction and the service flow direction between the program modules. This effectively improves the accuracy of abnormal positioning.
  • the present application further provides a client anomaly positioning device
  • the internal structure of the device may correspond to the structure shown in FIG. 2, and each of the following components may be partially or partially passed through software, hardware or The combination is implemented.
  • the client anomaly locating device includes an agent 402 and a location service 404, wherein:
  • the agent 402 is configured to: when the client running in the terminal sends a request to the server, intercept the request, record the request identifier corresponding to the request; forward the intercepted request to the server, so that the server returns the corresponding response according to the request. Data; intercepts the response data returned by the server, records the intercepted response data to the response file; and forwards the intercepted response data to the client.
  • the location service 404 is configured to: when the client is abnormal, capture the log content in the interface log of the server according to the request identifier, generate a log file by using the captured log content, and use the response file and the log file to locate the abnormality of the client. .
  • the location service 402 is further configured to obtain a return code in the response file; if the return code is the same as the preset value, the record exception occurs on the client; if the return code is different from the preset value, the record exception occurs.
  • the server On the server side; the server includes a local server and a third-party server; when an exception occurs on the server, the log file is used to identify whether the exception occurs on the local server, and if so, the record exception occurs on the local server, otherwise the record is abnormal. Occurs on a third-party server.
  • the location service 402 is further configured to mark a return code different from the preset value as an abnormal return code; query in the log file whether the source corresponding to the abnormal return code is a local server; if yes, record the abnormality Occurs on the local server.
  • the location service 402 is further configured to mark a return code different from the preset value as an abnormal return code; obtain a local log file, and query the local log file for an abnormal return code; if yes, record the abnormality Occurs on the local server.
  • the location service 402 is further configured to: when the exception of the client occurs on the local server, obtain a data flow direction and a service flow direction between the plurality of program modules of the local server according to the log file; according to the data flow direction and the service flow direction Position the abnormal part.
  • the location service 402 is further configured to obtain a log structure corresponding to the plurality of program modules according to the log file, and parse the log structure corresponding to the multiple modules to obtain a data flow between the plurality of program modules on the local server. Business flow.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executable by the processor to cause the one or more processors to execute The following steps:
  • the client running in the terminal sends a request to the server, the request is intercepted, and the request identifier corresponding to the request is recorded;
  • the response data returned by the server is intercepted, and the intercepted response data is recorded to the response file;
  • the log content is captured in the interface log of the server according to the request identifier, and the log file corresponding to the multiple log requests is generated by using the captured log content;
  • the computer readable instructions are executed by the processor such that the one or more processors further perform the following steps:
  • the server includes the local server and the third party server;
  • the log file is used to identify whether the exception occurred on the local server. If so, the record exception occurs on the local server, otherwise the record exception occurs on the third-party server.
  • the computer readable instructions are executed by the processor such that the one or more processors further perform the following steps:
  • the logging exception occurs on the local server.
  • the computer readable instructions are executed by the processor such that the one or more processors further perform the following steps:
  • the logging exception occurs on the local server.
  • the processor also performs the following steps when executing the computer readable instructions:
  • the abnormal part is located according to the data flow direction and the business flow direction.
  • the processor also performs the following steps when executing the computer readable instructions:
  • one or more computer readable non-volatile storage media having computer readable instructions, when executed by one or more processors, causing one or more processors Perform the following steps:
  • the client running in the terminal sends a request to the server, the request is intercepted, and the request identifier corresponding to the request is recorded;
  • the response data returned by the server is intercepted, and the intercepted response data is recorded to the response file;
  • the log content is captured in the interface log of the server according to the request identifier, and the log file corresponding to the multiple log requests is generated by using the captured log content;
  • the computer readable instructions when executed by the processor, also perform the following steps:
  • the server includes the local server and the third party server;
  • the log file is used to identify whether the exception occurred on the local server. If so, the record exception occurs on the local server, otherwise the record exception occurs on the third-party server.
  • the computer readable instructions when executed by the processor, also perform the following steps:
  • the logging exception occurs on the local server.
  • the computer readable instructions when executed by the processor, also perform the following steps:
  • the logging exception occurs on the local server.
  • the computer readable instructions when executed by the processor, also perform the following steps:
  • the abnormal part is located according to the data flow direction and the business flow direction.
  • the computer readable instructions when executed by the processor, also perform the following steps:
  • the readable storage medium which when executed, may include the flow of an embodiment of the methods as described above.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or the like.

Abstract

本申请涉及一种客户端异常定位方法,包括:当在终端运行的客户端向服务端发送请求时,拦截所述请求,记录所述请求对应的请求标识;将拦截到的请求转发至服务端,以使得服务端根据所述请求返回对应的响应数据;对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;将拦截到的响应数据转发至客户端;当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;利用所述响应文件和日志文件对客户端的异常进行定位。

Description

客户端异常定位方法、装置、计算机设备和存储介质
本申请要求于2017年07月26日提交中国专利局,申请号为2017106183052,发明名称为“客户端异常定位方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及一种客户端异常定位方法、装置、计算机设备和存储介质。
背景技术
当终端上安装的客户端在运行过程中出现异常时,可能是客户端这一侧出现了问题,也可能是服务端这一侧出现了问题。在传统的方式中,客户端出现异常之后,可以采用抓包软件来抓取服务端的响应数据,但是无法抓取到服务端的接口日志,只能通过抓取到的响应数据进行异常定位。由此导致定位时间较长,效率较低。
发明内容
根据本申请的各种实施例,,提供一种客户端异常定位方法、装置、计算机设备和存储介质。
一种客户端异常定位方法,包括:
当在终端运行的客户端向服务端发送请求时,拦截所述请求,记录所述请求对应的请求标识;将拦截到的请求转发至服务端,以使得服务端根据所述请求返回对应的响应数据;
对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;
将拦截到的响应数据转发至客户端;
当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;及
利用所述响应文件和日志文件对客户端的异常进行定位。
一种客户端异常定位装置,所述装置包括:
代理程序,用于当在终端运行的客户端向服务端发送请求时,拦截所述请求,记录所述请求对应的请求标识;将拦截到的请求转发至服务端,以使得服务端根据所述请求返回对应的响应数据;对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;将拦截到的响应数据转发至客户端;及
定位服务,用于当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;利用所述响应文件和日志文件对客户端的异常进行定位。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
当在终端运行的客户端向服务端发送请求时,拦截所述请求,记录所述请求对应的请求标识;将拦截到的请求转发至服务端,以使得服务端根据所述请求返回对应的响应数据;
对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;
将拦截到的响应数据转发至客户端;
当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;及
利用所述响应文件和日志文件对客户端的异常进行定位。
一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
当在终端运行的客户端向服务端发送请求时,拦截所述请求,记录所述请求对应的请求标识;将拦截到的请求转发至服务端,以使得服务端根据所述请求返回对应的响应数据;
对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;
将拦截到的响应数据转发至客户端;
当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;及
利用所述响应文件和日志文件对客户端的异常进行定位。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他实施例的附图。
图1为一个实施例中客户端异常定位方法的应用场景图;
图2为图1中的中间服务器的框图;
图3为一个实施例中客户端异常定位方法的流程图;
图4为一个实施例中客户端异常定位装置的框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例中所提供的客户端异常定位方法可以应用于如图1所示的 应用场景中。终端102通过网络与中间服务器104进行连接。中间服务器104通过网络与本地服务器106进行连接。中间服务器104通过网络与第三方服务器108进行连接。终端102上运行了客户端。本地服务器106上运行了本地服务端。第三方服务器上运行了第三方服务端。本地服务端和第三方服务器可以统称为服务端。
当客户端向服务端发送请求时,中间服务器104拦截请求,将请求记录至请求文件。请求文件中包括请求对应的请求标识和请求包。记录完成之后,中间服务器104将请求转发至本地服务端或第三方服务端。本地服务端或第三方服务端根据该请求返回对应的响应数据,中间服务器104响应数据进行拦截,将拦截到的响应数据记录至响应文件。在完成记录之后,中间服务器104将拦截到的响应数据转发至客户端。
当客户端出现异常时,中间服务器104根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成对应的日志文件。中间服务器104利用所述响应文件和日志文件对客户端的异常进行定位,由此能够有效提高异常定位效率。
在一个实施例中,中间服务器的框图如图2所示。该中间服务器包括通过系统总线连接的处理器、存储器和网络接口。其中,该中间服务器的处理器用于提供计算和控制能力。该中间服务器的存储器包括非易失性存储介质、内存储器。该中间服务器的非易失性存储介质存储有操作系统、数据库和计算机可读指令。数据库中存储了请求文件、响应文件和日志文件等。该中间服务器的内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该中间服务器的网络接口用于与客户端、本地服务端以及第三方服务端等通过网络连接通信。该计算机可读指令被处理器执行时以实现一种客户端异常定位方法。本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务端的限定,具体的服务端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,如图3所示,提供了一种客户端异常定位方法。应该理解的是,虽然图3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,图3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。以该方法应用于中间服务器为例进行说明,具体包括以下步骤:
步骤302,当在终端运行的客户端向服务端发送请求时,拦截请求,记录请求对应的请求标识。
终端上运行了客户端,客户端可以向为其对应的服务端发送请求,以使得客户端能够向用户提供相应的功能,比如,获取某个页面,或者进行某项查询等。中间服务器上运行了代理程序,当客户端向其对应的服务端发送请求时,中间服务器通过代理程序将客户端发送的请求进行拦截,并且将拦截到的请求记录至请求文件中。请求文件中记录了每个请求对应的请求标识和请求包。
步骤304,将拦截到的请求转发至服务端,以使得服务端根据请求返回对应的响应数据。
步骤306,对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件。
步骤308,将拦截到的响应数据转发至客户端。
代理程序将拦截到的请求记录至请求文件之后,将拦截到的请求转发至对应的服务端。客户端对应的服务端包括本地服务端和第三方服务端。
在其中一个实施例中,请求中还携带了目标服务端,目标服务端可以是本地服务端,也可以是第三方服务端。代理程序根据请求中携带的目标服务端,将请求转发至本地服务端或者第三方服务端。
在其中一个实施例中,本地服务端可以根据请求包识别是否为其自身需要响应的请求,若是,则本地服务端根据该请求返回响应数据。否则,本地服务端将请求转发至第三方服务端,以使得第三方服务端根据该请求返回响应数据。
代理程序将本地服务端或者第三方服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件。在完成记录之后,代理程序将拦截到的响应数据转发至客户端。以使得客户端能够获取到与请求对应的响应数据,从而向用户提供相应的功能。
步骤310,当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件。
步骤312,利用响应文件和日志文件对客户端的异常进行定位。
当客户端在运行中出现异常时,中间服务器启动定位服务,通过定位服务抓取服务端的接口日志的日志内容。具体的,定位服务获取本地服务端的接口日志,以及第三方服务端的接口日志,根据请求标识在本地服务端的接口日志和/或第三方服务端的接口日志中抓取相应的日志内容,利用抓取到的日志内容生成对应的日志文件。定位服务利用响应文件和日志文件对客户端的异常进行定位。
在其中一个实施例中,利用响应文件和日志文件对客户端的异常进行定位的步骤,包括:获取响应文件中的返回码;若返回码与预设值相同,则记录异常发生在客户端;若返回码与预设值不同,则记录异常发生在服务端;服务端包括本地服务端和第三方服务端;当异常发生在服务端时,利用日志文件识别异常是否发生在本地服务端,若是,则记录异常发生在本地服务端,否则记录异常发生在第三方服务端。
响应数据中携带了返回码。在对异常进行定位时,定位服务获取响应文件,提取响应文件中的返回码。定位服务判断返回码是否为预设值,若是,表示返回码正常。返回码正常表示服务端这一侧未出现异常,定位服务可以确定客户端的异常发生在客户端这一侧。
如果返回码与预设值不同,表示返回码异常,可以确定是服务端这一侧出现了异常。为了进一步确认异常是发生在本地服务端还是第三方服务端,定位应用还可以获取多个请求对应的日志文件。利用日志文件来识别异常是发生在本地服务端还是第三方服务端。
如果识别出异常发生在本地服务端,还可以通过日志文件对异常发生的模块进行定位,以此能够对异常部位进行精准的定位。如果识别出异常发生在第三方服务端,则定位服务生成异常通知,将异常通知发生至第三方服务端,以使得第三方能够对异常及时进行修复。
本实施例中,通过对请求进行拦截,可以将拦截到的请求实时记录至请求文件。通过对服务端返回的响应数据,可以将拦截到的响应数据实时记录至响应文件。在整个过程中,不需要在客户端发生异常时再去抓取响应数据。而且在发生异常时,还可以通过已记录的请求标识来抓取服务端的接口日志的内容,生成对应的日志文件,从而可以利用响应数据和日志文件快速定位异常部位。由此在客户端发生异常时,能够有效提高异常定位效率。
在一个实施例中,利用日志文件识别异常是否发生在本地服务端的步骤,包括:将与预设值不同的返回码标记为异常返回码;在日志文件中查询是否异常返回码对应的来源是否为本地服务端;若是,则记录异常发生在本地服务端。
本实施例中,当客户端在运行中发生异常时,中间服务器通过定位服务在服务端的接口日志中抓取相应的日志内容,利用抓取到的日志内容生成多个请求对应的日志文件。从不同服务端的接口日志中抓取到的日志内容可以生成一个日志文件,日志文件中可以对日志内容的来源进行标记。
日志文件中记录了请求标识、请求包和对应的响应数据。其中,响应数据中包括返回码。如果返回码与预设值不同,定位服务可以将该返回码标记为异常返回码。定位服务在日志文件中查询异常返回码对应的来源,若其对应的来源为本地服务端,则表示异常发生在本地服务端。若异常返回码对应的来源为第三方服务端,则表示异常发生在第三方服务端。由此在客户端发 生异常时,能够快速识别出异常所在的服务端。
进一步的,可以存在多个异常返回码。如果部分异常返回码对应的来源为本地服务端,另一部分异常返回码对应的来源为第三方服务端,则表示本地服务端和第三方服务端均发生了异常。
在一个实施例中,日志文件包括本地日志文件和第三方日志文件,利用日志文件识别异常是否发生在本地服务端的步骤,包括:将与预设值不同的返回码标记为异常返回码;获取本地日志文件,在本地日志文件中查询是否存在异常返回码;若存在,则记录异常发生在本地服务端。
本实施例中,当客户端在运行中发生异常时,中间服务器通过定位服务在服务端的接口日志中抓取相应的日志内容,利用抓取到的日志内容生成多个请求对应的日志文件。可以将从不同服务端的接口日志中抓取到的日志内容生成不同的日志文件。其中,利用从本地服务端的接口日志中抓取到的日志内容生成的日志文件可以称为本地日志文件。利用从第三方服务端的接口日志中抓取到的日志内容生成的日志文件可以称为第三方日志文件。
日志文件中记录了请求标识、请求包和对应的响应数据。其中,响应数据中包括返回码。如果返回码与预设值不同,定位服务可以将该返回码标记为异常返回码。定位服务可以在本地日志文件中查询是否存在异常返回码,若存在,则表示异常发生在本地服务端。若不存在,定位服务可以在第三方日志文件中查询是否存在异常返回码,若存在,则表示异常发生在第三方服务端。由此在客户端发生异常时,能够快速识别出异常所在的服务端。
进一步的,可以存在多个异常返回码。如果定位服务可以在本地日志文件中查询到部分异常返回码,在第三方日志文件中查询到另一部分异常返回码,则表示本地服务端和第三方服务端均发生了异常。
在一个实施例中,该方法还包括:当客户端的异常发生在本地服务端时,根据日志文件获取本地服务端多个程序模块之间的数据流向和业务流向;根据数据流向和业务流向对异常部位进行定位。
本地服务端上运行了多个程序模块,以此支持本地服务端的工作。程序 模块具有对应的接口。本地服务端通过不同的接口可以调用不同的程序模块。当客户端在运行中出现的异常存在于本地服务端时,定位服务可以利用日志文件对本地服务端中多个程序模块所对应的数据流向和业务流向进行分析,由此可以精确定位异常所在的程序模块。
在其中一个实施例中,根据日志文件获取本地服务端多个程序模块之间的数据流向和业务流向的步骤,包括:根据日志文件获取多个程序模块对应的日志结构;对多个模块对应的日志结构进行解析,得到本地服务端多个程序模块之间的数据流向和业务流向。
接口日志中可以包括每个程序模块的输入和输出。输入可以包括与请求包对应的传递参数,输出可以包括与请求包对应的响应数据。定位服务可以获取日志文件,日志文件中包括了与客户端进行通信的多个程序模块的日志内容。定位服务通过对程序模块的日志结构进行解析,提取每个程序模块的输入和输出,根据程序模块之间的输入和输出,得到多个程序模块之间的数据流向。
程序模块之间可以存在调用关系。例如,程序模块的输入用in表示,输出用out表示。比如A程序模块调用了B程序模块,那么日志文件中会按序输出AinBinBoutAout这种闭包格式的日志结构。若A程序模块与B程序模块不存在调用关系,则输出AinAoutBinBout的日志结构。定位服务通过对程序模块的日志结构进行解析,得到程序模块之间的调用关系。根据程序模块之间的调用关系可以得到多个程序模块之间的业务流向。
当本地服务端的接口出现异常时,定位服务可以根据程序模块之间的数据流向和业务流向,将异常定位在具体的某一个程序模块。由此有效提高了异常定位的准确性。
如图4所示,本申请还提供了一种客户端异常定位装置,该装置的内部结构可对应于如图2所示的结构,下述每个组成部分可全部或部分通过软件、硬件或其组合来实现。在一个实施例中,客户端异常定位装置包括:代理程序402和定位服务404,其中:
代理程序402,用于当在终端运行的客户端向服务端发送请求时,拦截请求,记录请求对应的请求标识;将拦截到的请求转发至服务端,以使得服务端根据请求返回对应的响应数据;对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;将拦截到的响应数据转发至客户端。
定位服务404,用于当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;利用响应文件和日志文件对客户端的异常进行定位。
在一个实施例中,定位服务402还用于获取响应文件中的返回码;若返回码与预设值相同,则记录异常发生在客户端;若返回码与预设值不同,则记录异常发生在服务端;服务端包括本地服务端和第三方服务端;当异常发生在服务端时,利用日志文件识别异常是否发生在本地服务端,若是,则记录异常发生在本地服务端,否则记录异常发生在第三方服务端。
在一个实施例中,定位服务402还用于将与预设值不同的返回码标记为异常返回码;在日志文件中查询是否异常返回码对应的来源是否为本地服务端;若是,则记录异常发生在本地服务端。
在一个实施例中,定位服务402还用于将与预设值不同的返回码标记为异常返回码;获取本地日志文件,在本地日志文件中查询是否存在异常返回码;若存在,则记录异常发生在本地服务端。
在一个实施例中,定位服务402还用于当客户端的异常发生在本地服务端时,根据日志文件获取本地服务端多个程序模块之间的数据流向和业务流向;根据数据流向和业务流向对异常部位进行定位。
在一个实施例中,定位服务402还用于根据日志文件获取多个程序模块对应的日志结构;对多个模块对应的日志结构进行解析,得到本地服务端多个程序模块之间的数据流向和业务流向。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
当在终端运行的客户端向服务端发送请求时,拦截请求,记录请求对应的请求标识;
将拦截到的请求转发至服务端,以使得服务端根据请求返回对应的响应数据;
对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;
将拦截到的响应数据转发至客户端;
当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成多个请求对应的日志文件;及
利用响应文件和日志文件对客户端的异常进行定位。
在一个实施例中,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器还执行以下步骤:
获取响应文件中的返回码;
若返回码与预设值相同,则记录异常发生在客户端;
若返回码与预设值不同,则记录异常发生在服务端;服务端包括本地服务端和第三方服务端;及
当异常发生在服务端时,利用日志文件识别异常是否发生在本地服务端,若是,则记录异常发生在本地服务端,否则记录异常发生在第三方服务端。
在一个实施例中,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器还执行以下步骤:
将与预设值不同的返回码标记为异常返回码;
在日志文件中查询是否异常返回码对应的来源是否为本地服务端;及
若是,则记录异常发生在本地服务端。
在一个实施例中,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器还执行以下步骤:
将与预设值不同的返回码标记为异常返回码;
获取本地日志文件,在本地日志文件中查询是否存在异常返回码;及
若存在,则记录异常发生在本地服务端。
在一个实施例中,处理器执行计算机可读指令时还执行以下步骤:
当客户端的异常发生在本地服务端时,根据日志文件获取本地服务端多个程序模块之间的数据流向和业务流向;
根据数据流向和业务流向对异常部位进行定位。
在一个实施例中,处理器执行计算机可读指令时还执行以下步骤:
根据日志文件获取多个程序模块对应的日志结构;及
对多个模块对应的日志结构进行解析,得到本地服务端多个程序模块之间的数据流向和业务流向。
在一个实施例中,提供了一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
当在终端运行的客户端向服务端发送请求时,拦截请求,记录请求对应的请求标识;
将拦截到的请求转发至服务端,以使得服务端根据请求返回对应的响应数据;
对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;
将拦截到的响应数据转发至客户端;
当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成多个请求对应的日志文件;及
利用响应文件和日志文件对客户端的异常进行定位。
在一个实施例中,计算机可读指令被处理器执行时还执行以下步骤:
获取响应文件中的返回码;
若返回码与预设值相同,则记录异常发生在客户端;
若返回码与预设值不同,则记录异常发生在服务端;服务端包括本地服务端和第三方服务端;及
当异常发生在服务端时,利用日志文件识别异常是否发生在本地服务端,若是,则记录异常发生在本地服务端,否则记录异常发生在第三方服务端。
在一个实施例中,计算机可读指令被处理器执行时还执行以下步骤:
将与预设值不同的返回码标记为异常返回码;
在日志文件中查询是否异常返回码对应的来源是否为本地服务端;及
若是,则记录异常发生在本地服务端。
在一个实施例中,计算机可读指令被处理器执行时还执行以下步骤:
将与预设值不同的返回码标记为异常返回码;
获取本地日志文件,在本地日志文件中查询是否存在异常返回码;及
若存在,则记录异常发生在本地服务端。
在一个实施例中,计算机可读指令被处理器执行时还执行以下步骤:
当客户端的异常发生在本地服务端时,根据日志文件获取本地服务端多个程序模块之间的数据流向和业务流向;及
根据数据流向和业务流向对异常部位进行定位。
在一个实施例中,计算机可读指令被处理器执行时还执行以下步骤:
根据日志文件获取多个程序模块对应的日志结构;及
对多个模块对应的日志结构进行解析,得到本地服务端多个程序模块之间的数据流向和业务流向。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详 细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种客户端异常定位方法,包括:
    当在终端运行的客户端向服务端发送请求时,拦截所述请求,记录所述请求对应的请求标识;
    将拦截到的请求转发至服务端,以使得服务端根据所述请求返回对应的响应数据;
    对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;
    将拦截到的响应数据转发至客户端;
    当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;及
    利用所述响应文件和日志文件对客户端的异常进行定位。
  2. 根据权利要求1所述的方法,其特征在于,所述利用所述响应文件和日志文件对客户端的异常进行定位的步骤包括:
    获取响应文件中的返回码;
    若返回码与预设值相同,则记录异常发生在客户端;
    若返回码与预设值不同,则记录异常发生在服务端;所述服务端包括本地服务端和第三方服务端;及
    当异常发生在服务端时,利用日志文件识别异常是否发生在本地服务端,若是,则记录异常发生在本地服务端,否则记录异常发生在第三方服务端。
  3. 根据权利要求2所述的方法,其特征在于,所述利用日志文件识别异常是否发生在本地服务端的步骤包括:
    将与预设值不同的返回码标记为异常返回码;
    在所述日志文件中查询是否异常返回码对应的来源是否为本地服务端;及
    若是,则记录异常发生在本地服务端。
  4. 根据权利要求2所述的方法,其特征在于,所述日志文件包括本地日 志文件,所述利用日志文件识别异常是否发生在本地服务端的步骤包括:
    将与预设值不同的返回码标记为异常返回码;
    获取本地日志文件,在所述本地日志文件中查询是否存在异常返回码;及
    若存在,则记录异常发生在本地服务端。
  5. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当客户端的异常发生在本地服务端时,根据所述日志文件获取本地服务端多个程序模块之间的数据流向和业务流向;及
    根据所述数据流向和业务流向对异常部位进行定位。
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述日志文件获取本地服务端多个程序模块之间的数据流向和业务流向的步骤包括:
    根据日志文件获取多个程序模块对应的日志结构;及
    对多个模块对应的日志结构进行解析,得到本地服务端多个程序模块之间的数据流向和业务流向。
  7. 一种客户端异常定位装置,所述装置包括:
    代理程序,用于当在终端运行的客户端向服务端发送请求时,拦截所述请求,记录所述请求对应的请求标识;将拦截到的请求转发至服务端,以使得服务端根据所述请求返回对应的响应数据;对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;及将拦截到的响应数据转发至客户端;
    定位服务,用于当客户端出现异常时,当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;及利用所述响应文件和日志文件对客户端的异常进行定位。
  8. 根据权利要求7所述的装置,其特征在于,所述定位服务还用于获取响应文件中的返回码;若返回码与预设值相同,则记录异常发生在客户端;若返回码与预设值不同,则记录异常发生在服务端;所述服务端包括本地服务端和第三方服务端;及当异常发生在服务端时,利用日志文件识别异常是 否发生在本地服务端,若是,则记录异常发生在本地服务端,否则记录异常发生在第三方服务端。
  9. 根据权利要求8所述的装置,其特征在于,定位服务还用于将与预设值不同的返回码标记为异常返回码;在所述日志文件中查询是否异常返回码对应的来源是否为本地服务端;及若是,则记录异常发生在本地服务端。
  10. 根据权利要求8所述的装置,其特征在于,定位服务还用于将与预设值不同的返回码标记为异常返回码;获取本地日志文件,在所述本地日志文件中查询是否存在异常返回码;及若存在,则记录异常发生在本地服务端。
  11. 根据权利要求7所述的装置,其特征在于,定位服务还用于当客户端的异常发生在本地服务端时,根据所述日志文件获取本地服务端多个程序模块之间的数据流向和业务流向;及根据所述数据流向和业务流向对异常部位进行定位。
  12. 根据权利要求11所述的装置,其特征在于,定位服务还用于根据日志文件获取多个程序模块对应的日志结构;及对多个模块对应的日志结构进行解析,得到本地服务端多个程序模块之间的数据流向和业务流向。
  13. 一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
    当在终端运行的客户端向服务端发送请求时,拦截所述请求,记录所述请求对应的请求标识;
    将拦截到的请求转发至服务端,以使得服务端根据所述请求返回对应的响应数据;
    对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;
    将拦截到的响应数据转发至客户端;
    当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;及
    利用所述响应文件和日志文件对客户端的异常进行定位。
  14. 根据权利要求13所述的计算机设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器还执行以下步骤:
    获取响应文件中的返回码;
    若返回码与预设值相同,则记录异常发生在客户端;
    若返回码与预设值不同,则记录异常发生在服务端;所述服务端包括本地服务端和第三方服务端;及
    当异常发生在服务端时,利用日志文件识别异常是否发生在本地服务端,若是,则记录异常发生在本地服务端,否则记录异常发生在第三方服务端。
  15. 根据权利要求14所述的计算机设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器还执行以下步骤:
    将与预设值不同的返回码标记为异常返回码;
    在所述日志文件中查询是否异常返回码对应的来源是否为本地服务端;及
    若是,则记录异常发生在本地服务端。
  16. 根据权利要求14所述的计算机设备,其特征在于,所述日志文件包括本地日志文件,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器还执行以下步骤:
    将与预设值不同的返回码标记为异常返回码;
    获取本地日志文件,在所述本地日志文件中查询是否存在异常返回码;及
    若存在,则记录异常发生在本地服务端。
  17. 一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    当在终端运行的客户端向服务端发送请求时,拦截所述请求,记录所述请求对应的请求标识;
    将拦截到的请求转发至服务端,以使得服务端根据所述请求返回对应的响应数据;
    对服务端返回的响应数据进行拦截,将拦截到的响应数据记录至响应文件;
    将拦截到的响应数据转发至客户端;
    当客户端出现异常时,根据请求标识在服务端的接口日志中抓取日志内容,利用抓取到的日志内容生成日志文件;及
    利用所述响应文件和日志文件对客户端的异常进行定位。
  18. 根据权利要求17所述的存储介质,其特征在于,计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:
    获取响应文件中的返回码;
    若返回码与预设值相同,则记录异常发生在客户端;
    若返回码与预设值不同,则记录异常发生在服务端;所述服务端包括本地服务端和第三方服务端;及
    当异常发生在服务端时,利用日志文件识别异常是否发生在本地服务端,若是,则记录异常发生在本地服务端,否则记录异常发生在第三方服务端。
  19. 根据权利要求18所述的存储介质,其特征在于,计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:
    将与预设值不同的返回码标记为异常返回码;
    在所述日志文件中查询是否异常返回码对应的来源是否为本地服务端;及
    若是,则记录异常发生在本地服务端。
  20. 根据权利要求18所述的存储介质,其特征在于,所述日志文件包括本地日志文件,计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:
    将与预设值不同的返回码标记为异常返回码;
    获取本地日志文件,在所述本地日志文件中查询是否存在异常返回码; 及
    若存在,则记录异常发生在本地服务端。
PCT/CN2017/104846 2017-07-26 2017-09-30 客户端异常定位方法、装置、计算机设备和存储介质 WO2019019394A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710618305.2 2017-07-26
CN201710618305.2A CN107678869B (zh) 2017-07-26 2017-07-26 客户端异常定位方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2019019394A1 true WO2019019394A1 (zh) 2019-01-31

Family

ID=61134048

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/104846 WO2019019394A1 (zh) 2017-07-26 2017-09-30 客户端异常定位方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN107678869B (zh)
WO (1) WO2019019394A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108762742A (zh) * 2018-05-18 2018-11-06 深圳壹账通智能科技有限公司 数据流向及业务流向的分析方法、装置、设备及介质
CN108683562B (zh) * 2018-05-18 2022-05-17 深圳壹账通智能科技有限公司 异常检测定位方法、装置、计算机设备及存储介质
CN109165127B (zh) * 2018-08-29 2022-09-02 北京奇艺世纪科技有限公司 问题接口的定位方法、装置及电子设备
CN109522206B (zh) * 2018-09-26 2023-09-26 平安科技(深圳)有限公司 异常数据定位方法、装置、计算机设备及存储介质
CN109144884A (zh) * 2018-09-29 2019-01-04 平安科技(深圳)有限公司 程序错误定位方法、装置、及计算机可读存储介质
CN111177428B (zh) * 2018-11-12 2023-06-30 马上消费金融股份有限公司 一种业务异常的处理方法及相关装置
CN111818025B (zh) * 2020-06-23 2022-10-14 五八有限公司 一种用户终端的检测方法和装置
CN112506761B (zh) * 2020-11-26 2022-07-05 福州智象信息技术有限公司 一种生产环境服务端接口调试方法及系统
CN112463429A (zh) * 2020-12-03 2021-03-09 北京五八信息技术有限公司 一种信息处理方法及装置
CN112783718A (zh) * 2020-12-31 2021-05-11 航天信息股份有限公司 一种用于系统异常的管理系统及方法
CN113626239A (zh) * 2021-07-27 2021-11-09 福建天泉教育科技有限公司 一种功能验证方法及终端
CN114579194B (zh) * 2022-03-08 2024-04-05 杭州每刻科技有限公司 一种基于Spring远程调用的异常处理方法和系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070293232A1 (en) * 2006-06-20 2007-12-20 Aruze Corp. Wireless communication failure monitoring system and monitoring device
CN101119235A (zh) * 2007-09-20 2008-02-06 金蝶软件(中国)有限公司 一种在应用服务系统中定位客户端的方法和系统
CN105955862A (zh) * 2016-04-15 2016-09-21 乐视控股(北京)有限公司 一种异常问题的监测定位方法及装置
CN105978723A (zh) * 2016-05-11 2016-09-28 广州唯品会信息科技有限公司 网络信息管理方法及装置
CN106155890A (zh) * 2015-04-02 2016-11-23 深圳市腾讯计算机系统有限公司 平台测试方法和系统

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844156B (zh) * 2017-01-24 2020-08-07 武汉虹信技术服务有限责任公司 智能建筑综合管理平台系统中wcf通信消息拦截方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070293232A1 (en) * 2006-06-20 2007-12-20 Aruze Corp. Wireless communication failure monitoring system and monitoring device
CN101119235A (zh) * 2007-09-20 2008-02-06 金蝶软件(中国)有限公司 一种在应用服务系统中定位客户端的方法和系统
CN106155890A (zh) * 2015-04-02 2016-11-23 深圳市腾讯计算机系统有限公司 平台测试方法和系统
CN105955862A (zh) * 2016-04-15 2016-09-21 乐视控股(北京)有限公司 一种异常问题的监测定位方法及装置
CN105978723A (zh) * 2016-05-11 2016-09-28 广州唯品会信息科技有限公司 网络信息管理方法及装置

Also Published As

Publication number Publication date
CN107678869A (zh) 2018-02-09
CN107678869B (zh) 2020-01-10

Similar Documents

Publication Publication Date Title
WO2019019394A1 (zh) 客户端异常定位方法、装置、计算机设备和存储介质
US7844692B2 (en) Web server multiplier for analyzing resource leaks
US20170123880A1 (en) Service metric analysis from structured logging schema of usage data
CN110740103A (zh) 业务请求处理方法、装置、计算机设备和存储介质
US10853183B2 (en) Serverless application operational recovery and manifest creation
WO2020259003A1 (zh) 一种链路追踪方法及装置
US10887261B2 (en) Dynamic attachment delivery in emails for advanced malicious content filtering
US9654580B2 (en) Proxy-based web application monitoring through script instrumentation
US20210248023A1 (en) Verifying application behavior based on distributed tracing
US20140337471A1 (en) Migration assist system and migration assist method
CN112532490A (zh) 回归测试系统、方法和电子设备
CN110830500B (zh) 网络攻击追踪方法、装置、电子设备及可读存储介质
CN108650123B (zh) 故障信息记录方法、装置、设备和存储介质
CN109714214B (zh) 一种服务器异常的处理方法及管理设备
CN113114794A (zh) 一种基于二次代理处理域名的方法及设备
US9374437B2 (en) Schema validation proxy
US11704214B2 (en) System and method for contact center fault diagnostics
US10521328B1 (en) Application data flow mapping
CN112148762A (zh) 一种实时数据流的统计方法和装置
CN114090514A (zh) 分布式系统的日志检索方法及装置
US9858549B2 (en) Business transaction resource usage tracking
CN110517010B (zh) 一种数据处理方法、系统及存储介质
US10296967B1 (en) System, method, and computer program for aggregating fallouts in an ordering system
CN114371866A (zh) 业务系统的版本重构测试方法、装置和设备
JP2014109975A (ja) 性能分析装置、性能分析方法及び性能分析プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17918980

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.07.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17918980

Country of ref document: EP

Kind code of ref document: A1