Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for detecting quality of SERVICE, which can define a set of complete quality metrics of SERVICEs (HTTP/HTTPs, TCP/IP, SERVICE), and measure stability and quality of SERVICEs.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a quality of service detection method, including:
collecting service quality logs;
and calculating the service quality, namely calculating a quality log after service consumption reporting, and calculating the target service quality in time granularity in real time according to different target services and the time granularity.
Optionally, the collecting the service quality log is implemented by at least one of the following two collection manners:
actively requesting a service interface according to a time period configured by a target service, and acquiring a service availability log from the service interface; and/or the presence of a gas in the gas,
the target service actively reports service logs and service running logs to a log receiving interface of the acquisition service, and the acquisition service is uniformly sent to the streaming queue.
Optionally, the quality of service calculation calculates the quality of service in at least one of the following two calculation manners:
the statistical mode in the unit time is counted,
proportion of failures: number of faults per minute/total number per minute;
quality of service: success per minute/total number per minute;
the failure number refers to the number of failed logs in the logs received every minute; the success number refers to the number of successful logs in the logs received every minute; the total number refers to the total number of logs received per minute; and/or the presence of a gas in the gas,
the frequency of occurrence of faults within a fixed length of time is calculated,
proportion of failures: number/total number of consecutive failures;
quality of service: success number/total number;
wherein the total number is the total number of logs in the time range of the target service configuration.
Optionally, the two quality of service calculation methods are adapted to the hypertext transfer protocol service, the transmission control protocol service, and the calculation class.
Optionally, the method further comprises the following steps of service quality display and early warning:
sending the calculated quality of service result to a real-time streaming queue;
consuming the streaming queue, and storing consumed data into a database;
checking the service quality condition in the database by using a preset page, and setting a service quality threshold value for the service under each authority; and when the service quality reaches the threshold value range, early warning the user.
According to another aspect of the embodiments of the present invention, there is also provided a quality of service detection apparatus, including:
a service quality log collection module;
and the service quality calculating module consumes the reported quality logs and calculates the target service quality in the time granularity in real time according to different target services and the time granularity.
Optionally, the collecting the service quality log module is implemented by at least one of the following two collecting modes:
actively requesting a service interface according to a time period configured by a target service, and acquiring a service availability log from the service interface; and/or the presence of a gas in the gas,
the target service actively reports service logs and service running logs to a log receiving interface of the acquisition service, and the acquisition service is uniformly sent to the streaming queue.
Optionally, the service quality calculation module calculates the service quality in at least one of the following two quality calculation manners:
the statistical mode in the unit time is counted,
proportion of failures: number of faults per minute/total number per minute;
quality of service: success per minute/total number per minute;
the failure number refers to the number of failed logs in the logs received every minute; the success number refers to the number of successful logs in the logs received every minute; the total number refers to the total number of logs received per minute; and/or the presence of a gas in the gas,
the frequency of occurrence of faults within a fixed length of time is calculated,
proportion of failures: number/total number of consecutive failures;
quality of service: success number/total number;
wherein the total number is the total number of logs in the time range of the target service configuration.
Optionally, the two quality of service calculation methods are adapted to the hypertext transfer protocol service, the transmission control protocol service, and the calculation class.
Optionally, the system further comprises a service quality display and early warning module, configured to:
sending the calculated quality of service result to a real-time streaming queue;
consuming the streaming queue, and storing consumed data into a database;
checking the service quality condition in the database by using a preset page, and setting a service quality threshold value for the service under each authority; and when the service quality reaches the threshold value range, early warning the user.
According to still another aspect of an embodiment of the present invention, there is also provided an electronic apparatus including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of the first aspects of the invention described above.
According to a further aspect of embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the method of any of the above first aspects of the present invention.
One embodiment of the above invention has the following advantages or advantages: because the technical means of service quality measurement, monitoring and early warning are adopted, the technical problems that the monitoring and management of the service quality are lacked and the stability and the quality of the service are difficult to measure in the prior art are solved, and the technical effect of providing a basis for the stability of the service and the decision of the service is further achieved.
Specifically, (1) the service quality is an index for measuring the service stability, and can provide a quality standard for the service to the external output; (2) providing complete full-dimensional service quality display of days, hours and minutes, and providing a basis for service stability and service decision; (3) providing an early warning scheme, configuring a self-defined threshold value for each service, and informing a service provider of the fact that the service stability reaches an early warning value; (4) the technical scheme outputs the service quality score. Basic data can be provided for the service load scheme, and weight values can be provided for the weight algorithm.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a block diagram of a solution according to an embodiment of the invention, as shown in fig. 1,
the first step is as follows: and collecting a service quality log.
Collecting service quality logs provides two ways to collect service logs.
< service log collection mode 1> the system scheduling service actively requests a service interface according to a time period configured by a target service, and obtains a service availability log from the service interface.
< service log collection mode 2> the target service actively reports logs of a service nginx (a high-performance hypertext transfer protocol and a reverse proxy server) and service running logs to a log receiving interface of the collection service, and the collection service is uniformly sent to a streaming queue (kafka).
Streaming queue lining (kafka) is an open source streaming platform developed by the Apache software foundation, written in Scala and Java. Kafka is a high-throughput distributed publish-subscribe messaging system that can handle all the action flow data in a consumer-scale website. This action (web browsing, searching and other user actions) is a key factor in many social functions on modern networks. These data are typically addressed by handling logs and log aggregations due to throughput requirements. This is a viable solution to the limitations of log data and offline analysis systems like Hadoop (a distributed system infrastructure), but requiring real-time processing. The purpose of Kafka is to unify online and offline message processing through the parallel loading mechanism of Hadoop, and also to provide real-time messages through clustering.
The second step is as follows: quality of service calculation
And calculating the quality log after the service consumption report, and calculating the target service quality in the time granularity in real time according to the time granularity (the minimum time granularity is 1 minute) according to different target services.
Definition of service failure in service quality
A HyperText Transfer Protocol (HTTP) service failure may be obtained from an HTTP code. nginx log, such as an HTTP-500 error (server internal error), an HTTP-503 error (server unavailable error), as shown in fig. 1 and described above; or may be obtained directly by an active request. Such status codes represent that the server has an error or abnormal status during the process of processing the request, and it is also possible that the server realizes that the processing of the request cannot be completed by the current software and hardware resources. Unless this is a HEAD request (a request for only the beginning of the page), the server should contain an interpretation information entity that interprets the current error status and whether this condition is temporary or permanent. The browser should present the user with any entities contained in the current response.
A Control Transmission Protocol (TCP) service can customize a service error identifier, and the error identifier indicates success or failure. For example, the error identification may include: the number of communication packets, the number of bytes, the number of successful bytes and the number of failed bytes; as another example, the error identification may include: total byte data, success, failure status, etc.
The computing class only provides output and input services, and service fault identification can be customized. The fault identification includes, for example: timing cycle, run-in-cycle, success or failure.
There are two ways to calculate the quality of service, which can be adapted to different fields, such as but not limited to HTTP services, TCP services, computing classes, etc. as mentioned above.
The statistical method in the statistical unit time comprises the following steps:
proportion of failures: number of faults per minute/total number per minute
Quality of service: success per minute/total number per minute
The failure count refers to the number of failed logs in a log received every minute.
The success count refers to the number of successful logs in a log received every minute.
The total number refers to the total number of logs received per minute.
The fixed length of time may be a cycle time configured for the target service. For example, take 10 minutes as an example: failure occurred continuously within 10 minutes, namely failure. Failures that are not consecutive may not be recorded as success numbers. (for some operation and maintenance hardware or the service hanging scene)
The statistical method for calculating the fault occurrence frequency in a fixed time length comprises the following steps:
proportion of failures: number of consecutive failures/total number
Quality of service: success/total
The total number is the total number of logs in the time range of the target service configuration.
The third step: and displaying and early warning the service quality.
The amount of received logs can be large due to the quality of service interfacing with the various target services. The final calculation result may also be large, so that the calculated result is sent to a real-time streaming queue (kafka) first to relieve the database pressure. And finally, the consumption streaming queue is stored in a database. And the user checks the condition of the calculated service quality in the database through a uniform page. The user can define a service quality threshold value for the service under the authority of the user, and the service quality reaches the threshold value range, so that the user is warned.
Optionally, a service quality output step can be included
The quality of service calculation results stored in the database provide an acquisition interface. The quality of service result can provide basic data for a service load scheme and can provide a weight value for a weight algorithm.
In order to more clearly illustrate the above technical solution of the present invention, the following is specifically exemplified with reference to fig. 2 and 3.
Fig. 2 is a schematic diagram of the main flow of a quality of service detection method according to an embodiment of the present invention. This embodiment comprises the steps of:
(1) and reporting a real-time service quality log on a service line.
(2) And calculating the quality log after the service consumption is reported.
(3) Counting the total number of the logs, judging the success number of the service states in the logs, and judging the failure number of the service states in the logs.
(4) And calculating the success rate and the failure rate per minute.
(5) And sending the calculation result to a real-time queue as a success failure result.
(6) And storing the result in a database for a user to check the condition of the calculated service quality in the database through a uniform page.
Fig. 3 is a schematic diagram of a main flow of a quality of service detection method according to still another embodiment of the present invention. This embodiment comprises the steps of:
(1) and reporting a real-time service quality log on a service line.
(2) And calculating the quality log after the service consumption is reported.
(1') configuring a database, wherein the database is used for configuring calculation rules under the service line.
(2') reading the calculation rules under the service line from the configured database.
(3) Counting the total number of the logs, judging the continuous failure number according to the configuration period, and counting the success number.
(4) And calculating the success rate and the failure rate per minute.
(5) And sending the calculation result to a real-time queue as a success failure result.
(6) And storing the result in a database for a user to check the condition of the calculated service quality in the database through a uniform page.
The embodiment of fig. 3 differs from the embodiment of fig. 2 in that it further comprises the above-mentioned step (1 ') and step (2'), and steps (1 ') and (2') may be performed in parallel with steps (1) and (2) or may be performed sequentially.
Fig. 4 is a schematic diagram of main blocks of a quality of service detection apparatus according to an embodiment of the present invention. The figure illustrates the main blocks of an exemplary quality of service detection apparatus, for example, but not limited thereto. As an example, the main modules of the service quality detection device include a module for collecting service quality logs; the service quality calculation module consumes the reported quality logs and calculates the target service quality in time granularity in real time according to different target services and time granularity; and the service quality display and early warning module is used for storing the calculation result into the database so that a user can check the condition of the calculated service quality in the database through a uniform page. In addition, the service quality detection device of the embodiment of the invention can also comprise a service scheduling module, and the modules work under the unified scheduling of the service scheduling module. The service quality display and early warning module can comprise a service quality display unit and a service quality early warning unit. Optionally, the qos display and warning module may further include a qos data output unit, and in the case of including the qos data output unit, the module may also be referred to as the qos display and warning output module.
The detailed implementation of the qos detection apparatus in the embodiment of the present invention has been described in detail in the above-mentioned qos detection method, and therefore, the repeated description is not repeated here.
Fig. 5 shows an exemplary system architecture 500 to which a quality of service detection method or a quality of service detection apparatus of an embodiment of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 501, 502, 503. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for detecting quality of service provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the apparatus for detecting quality of service is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a collect quality of service log module; the service quality calculation module is used for calculating the quality log after the service consumption report, and calculating the target service quality in the time granularity in real time according to different target services and the time granularity; and a service quality display and early warning module.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: a service quality log collection module; the service quality calculation module is used for calculating the quality log after the service consumption report, and calculating the target service quality in the time granularity in real time according to different target services and the time granularity; and a service quality display and early warning module.
According to the technical scheme of the embodiment of the invention, because the technical means of service quality measurement, monitoring and early warning are adopted, the technical problems that the prior art is lack of monitoring and management on the service quality and the stability and the quality of the service are difficult to measure are solved, and the technical effect of providing a basis for the stability of the service and the decision of the service is further achieved. Specifically, (1) the service quality is an index for measuring the service stability, and can provide a quality standard for the service to the external output; (2) providing complete full-dimensional service quality display of days, hours and minutes, and providing a basis for service stability and service decision; (3) providing an early warning scheme, configuring a self-defined threshold value for each service, and informing a service provider of the fact that the service stability reaches an early warning value; (4) the technical scheme outputs the service quality score. Basic data can be provided for the service load scheme, and weight values can be provided for the weight algorithm.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.