Disclosure of Invention
Accordingly, embodiments of the present invention provide a method and apparatus for detecting quality of SERVICE, which can define a complete set of quality metrics of SERVICE (HTTP/HTTPs, TCP/IP, SERVICE), and measure stability and quality of SERVICE.
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 a service quality log;
And calculating the service quality, calculating a quality log after reporting the service expense, and calculating the target service quality in the time granularity according to different target services and the time granularity in real time.
Optionally, the collecting the quality of service log is implemented in at least one of the following two collecting modes:
actively requesting a service interface according to a time period of target service configuration, and acquiring a service availability log from the service interface; and/or the number of the groups of groups,
The target service actively reports the service log and the service running log to the 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 modes:
The statistical manner in which the unit time is counted,
Proportion of faults: number of faults per minute/total number of faults per minute;
Quality of service: successful number per minute/total number per minute;
the fault 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 number of the groups of groups,
The frequency of occurrence of the fault within a fixed length of time is calculated,
Proportion of faults: number of consecutive occurrences/total number of failures;
Quality of service: number of successes/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 modes are adapted to hypertext transfer protocol service, transmission control protocol service and calculation class.
Optionally, the method further comprises the steps of service quality display and early warning:
transmitting the calculated service quality result to a real-time streaming queue;
consuming the stream queue and storing the consumed data in a database;
checking the service quality condition in a database by using a preset page, and setting a service quality threshold 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 embodiment of the present invention, there is also provided a quality of service detection apparatus, including:
a quality of service log module is collected;
And the service quality calculation module is used for consuming the reported quality logs and calculating the target service quality in the time granularity according to different target services and the time granularity in real time.
Optionally, the collecting service quality log module is implemented in at least one of the following two collecting modes:
actively requesting a service interface according to a time period of target service configuration, and acquiring a service availability log from the service interface; and/or the number of the groups of groups,
The target service actively reports the service log and the service running log to the log receiving interface of the acquisition service, and the acquisition service is uniformly sent to the streaming queue.
Optionally, the quality of service calculation module calculates the quality of service in at least one of the following two quality calculation modes:
The statistical manner in which the unit time is counted,
Proportion of faults: number of faults per minute/total number of faults per minute;
Quality of service: successful number per minute/total number per minute;
the fault 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 number of the groups of groups,
The frequency of occurrence of the fault within a fixed length of time is calculated,
Proportion of faults: number of consecutive occurrences/total number of failures;
Quality of service: number of successes/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 modes are adapted to hypertext transfer protocol service, transmission control protocol service and calculation class.
Optionally, the system further comprises a service quality display and early warning module for:
transmitting the calculated service quality result to a real-time streaming queue;
consuming the stream queue and storing the consumed data in a database;
checking the service quality condition in a database by using a preset page, and setting a service quality threshold 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 the embodiment of the present invention, there is also provided an electronic apparatus including:
one or more processors;
storage means for storing one or more programs,
The 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 an embodiment of the present invention there is also provided a computer readable medium having stored thereon a computer program, characterized in that the program when executed by a processor implements the method of any of the above-mentioned first aspects of the present invention.
One embodiment of the above invention has the following advantages or benefits: because the technical means of quality of service measurement, monitoring and early warning are adopted, the technical problems that the prior art lacks monitoring and management of quality of service and is difficult to measure the stability of service and the quality of service are solved, and the technical effect of providing basis for the stability of service and the decision of 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 basis for service stability and service decision; (3) Providing an early warning scheme, configuring a self-defined threshold value for each service, and notifying a service provider that the service stability reaches an early warning value; (4) the solution outputs a quality of service score. Basic data may be provided for the service load scheme and weight values may be provided for the weight algorithm.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered 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,
A first step of: a quality of service log is collected.
Collecting quality of service logs provides two ways of collecting service logs.
< Service log collection mode 1> the system scheduling service actively requests the service interface according to the time period of the target service configuration, and obtains the service availability log from the service interface.
< Service log collection mode 2> the target service actively reports the log of service nginx (a high performance hypertext transfer protocol and reverse proxy server), the running log of service to the log receiving interface of collection service, and the collection service is sent to the flow queue (kafka) in the same way.
The streaming queue (kafka) is an open source streaming platform developed by the Apache software foundation, written by Scala and Java. Kafka is a high-throughput distributed publish-subscribe messaging system that can handle all action flow data in consumer-scale websites. Such actions (web browsing, searching and other user actions) are a key factor in many social functions on modern networks. These data are typically addressed by processing logs and log aggregations due to throughput requirements. This is a viable solution for log data and offline analysis systems like Hadoop (a distributed system infrastructure), but with the limitation of requiring real-time processing. The purpose of Kafka is to unify on-line and off-line message processing through the Hadoop parallel loading mechanism, and also to provide real-time messages through the clusters.
And a second step of: quality of service calculation
And calculating a quality log after service expense reporting, and calculating the target service quality in the time granularity according to different target services according to the time granularity (the minimum time granularity is 1 minute).
Definition of service faults in quality of service
Hypertext transfer protocol (HyperText Transfer Protocol, HTTP) service failures can be obtained from httpcode. Nginx logs, such as HTTP-500 errors (server internal errors), HTTP-503 errors (server unavailable errors), as described in FIG. 1 and above; or may be obtained directly by active request. Such status codes represent errors or abnormal states occurring in the process of processing the request by the server, 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 (request for page header only), the server should contain an interpretation information entity that interprets the current error state and whether this condition is temporary or permanent. The browser should present the user with any entity that is included in the current response.
The control transmission protocol (Transmission Control Protocol, TCP) service may customize the service error identification, which indicates success or failure. For example, the error identification may include: number of communication packets, number of bytes, number of successful bytes, number of failed bytes; for another example, the error identification may include: total byte data, success, failure status, etc.
The computing class only provides the service of output and input, and can customize the service fault identification. The fault identification includes, for example: timing period, running condition within period, success or failure.
There are two ways of quality of service calculation, which are adapted to different fields, such as, but not limited to, HTTP services, TCP services, calculation classes, etc. as described above.
Counting the counting mode in unit time, including:
Proportion of faults: number of faults per minute/total number of faults per minute
Quality of service: number of successes per minute/total number of successes per minute
The failure number refers to the number of log pieces that failed in the log received per minute.
The success number refers to the number of log pieces that succeed in the log received per minute.
The total number refers to the total number of logs received per minute.
The fixed length of time may be a cycle time of the target service configuration. For example, take 10 minutes: and continuously generating faults within 10 minutes to obtain the fault. Faults may not be counted as success numbers rather than continuously. (scene adapted to some operation and maintenance hardware or service hanging)
The statistical method for calculating the occurrence frequency of the faults in the fixed time length comprises the following steps:
Proportion of faults: number/total number of consecutive failures
Quality of service: number of successes/total number
The total number is the total number of logs in the time range of the target service configuration.
And a third step of: and (5) showing and early warning the service quality.
The amount of received log may be large because the quality of service is to interface with a variety of different target services. The final calculation result will be large, so that the calculated result will be sent to the real-time streaming queue (kafka) first to relieve the database pressure. And finally, storing the data in the consumption flow queue. The user checks the calculated service quality in the database through the unified page. The user can customize the service quality threshold value for the service under the authority of the user, and the service quality reaches the threshold value range, thereby early warning the user.
Optionally, a quality of service output step can be included
The quality of service calculation results stored in the database provide an acquisition interface. The quality of service result may provide basic data for the service loading scheme and may provide weight values for the weight algorithm.
In order to more clearly illustrate the above technical solutions of the present invention, the following description is specifically given by way of example with reference to fig. 2 and 3.
Fig. 2 is a schematic diagram of a 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 the service is uploaded to a real-time service quality log.
(2) And calculating a quality log after service expense reporting.
(3) Counting the total number of logs, judging the successful number of service states in the logs and judging the failed number of service states in the logs.
(4) And calculating the success rate per minute and the failure rate.
(5) And sending the calculation result to a real-time queue as a success and failure result.
(6) And storing the result into a database for a user to check the calculated service quality in the database through a unified page.
Fig. 3 is a schematic diagram of the 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 the service is uploaded to a real-time service quality log.
(2) And calculating a quality log after service expense reporting.
(1') Configuring a database for configuring calculation rules under the business line.
(2') Reading the computation rules under the business line from the configured database.
(3) Counting the total number of logs, judging the number of continuous failures according to the configuration period, and counting the number of successes.
(4) And calculating the success rate per minute and the failure rate.
(5) And sending the calculation result to a real-time queue as a success and failure result.
(6) And storing the result into a database for a user to check the calculated service quality in the database through a unified page.
The embodiment of fig. 3 differs from the embodiment of fig. 2 in that it further comprises the above-mentioned steps (1 ') and (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 modules of a quality of service detection apparatus according to an embodiment of the present invention. The figure is an exemplary example of the main modules of a quality of service detection apparatus, such as but not limited to. As an example, the main modules of the quality of service detection apparatus include an acquisition quality of service log module; the service quality calculation module is used for consuming the reported quality logs and calculating the target service quality in the time granularity in real time according to different target services; and the service quality display and early warning module stores the calculation result into the database so that a user can check the condition of the calculated service quality in the database through a unified 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 quality of service presentation and early warning module may further comprise a quality of service data output unit, which in case of comprising a quality of service data output unit may also be referred to as quality of service presentation and early warning output module.
The implementation of the qos detection device according to the embodiment of the present invention is already described in detail in the qos detection method described above, and thus the description thereof will not be repeated here.
Fig. 5 illustrates an exemplary system architecture 500 to which a quality of service detection method or quality of service detection apparatus of embodiments 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 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 505 via the network 504 using the terminal devices 501, 502, 503 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 501, 502, 503, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using the terminal devices 501, 502, 503. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the method for detecting the quality of service provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the quality of service detecting device 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, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which 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 required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through 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, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; 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 drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to 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 shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 601.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this document, 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, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 flowcharts 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 involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a collection quality of service log module; the service quality calculation module calculates a quality log after service expense reporting, and calculates the target service quality in time granularity according to different target services and time granularity in real time; 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 present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: a quality of service log module is collected; the service quality calculation module calculates a quality log after service expense reporting, and calculates the target service quality in time granularity according to different target services and time granularity in real time; and a service quality display and early warning module.
According to the technical scheme of the embodiment of the invention, the technical means of quality of service measurement, monitoring and early warning are adopted, so that the technical problems that the prior art lacks monitoring and management of quality of service and is difficult to measure the stability of service and the quality of service are solved, and the technical effect of providing basis for the stability of service and the decision of 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 basis for service stability and service decision; (3) Providing an early warning scheme, configuring a self-defined threshold value for each service, and notifying a service provider that the service stability reaches an early warning value; (4) the solution outputs a quality of service score. Basic data may be provided for the service load scheme and weight values may be provided for the weight algorithm.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.