Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is a flowchart illustrating a service monitoring method according to an exemplary embodiment of the present application.
Referring to fig. 1, the service monitoring method may be applied in a server or a server cluster deployed by a service provider, and includes the following steps:
step 101, calculating the corresponding relation between the service scene and the service rule according to the historical service data.
In this embodiment, the correspondence between the service scenario and the service rule may be periodically calculated, where the calculation period may be set by a developer according to a service condition, for example: 1 day, 3 days, etc., which the present application does not specifically limit.
Step 102, aiming at real-time service data, acquiring a real service scene and a real service rule of the real-time service data.
In this embodiment, in order to find out the configuration error problem of the service rule in time, real-time service data may be monitored, and if the real-time service data is monitored, the service scenario and the service rule of the real-time service data may be obtained.
And 103, searching the business rule corresponding to the real business scene in the corresponding relation.
Based on the foregoing step 102, after the real service scene of the real-time service data is obtained, the service rule corresponding to the real service scene may be searched in the calculated corresponding relationship.
And 104, if the real business rule is different from the searched business rule, outputting an alarm prompt.
In this embodiment, if the real service rule of the real-time service data is different from the service rule corresponding to the found real service scene, an alarm prompt including the real service scene, the service rule corresponding to the found real service scene, and the real service rule may be output, so that a service person may determine whether the situation is an expected situation or a configuration problem.
As can be seen from the above description, according to the present application, the corresponding relationship between the service scenario and the service rule can be calculated according to the historical service data, and for the real-time service data, when the real service rule of the real-time service data is different from the service rule corresponding to the found real service scenario, an alarm prompt is output, so that the service personnel can check the influence range of the service rule, solve the configuration problem, and thereby ensure the stability of the service.
The implementation process of the present application is introduced below through two aspects of calculation of the corresponding relationship between the service scenario and the service rule and monitoring of real-time service data.
Calculation of corresponding relation between business scene and business rule
In this embodiment, the correspondence between the service scenario and the service rule may be periodically calculated, where the calculation period may be set by a developer according to a service condition, for example: 1 day, 3 days, etc. Taking the calculation cycle of 1 day as an example, at each time zero, the correspondence between the service scene and the service rule can be calculated based on the historical service data of the previous day, and the correspondence calculated at the time zero of the previous day is updated by using the correspondence.
For example, when the time is 2 months and 2 days, the corresponding relationship between the service scene and the service rule can be calculated and stored according to the service data of 2 months and 1 days. And when the time of 2 month and 3 days is zero, the corresponding relation between the service scene and the service rule can be recalculated according to the service data of 2 month and 2 days, and the corresponding relation is used for replacing the calculated corresponding relation when the time of 2 month and 2 days is saved.
The method and the device for calculating the corresponding relation between the service scene and the service rule periodically can calculate the corresponding relation between the service scene and the updated service rule in time according to historical service data of the previous period when the service rule is updated. When the business rule is updated, the corresponding relation does not need to be modified manually, and the applicability is better.
Fig. 2 is a schematic diagram of a method for calculating a correspondence between a business scenario and a business rule according to an exemplary embodiment of the present application.
Referring to fig. 2, the calculation of the correspondence between the business scenario and the business rule may include the following steps:
step 201, determining a service scene of historical service data.
In this embodiment, the service scenario of the service data may be formed by the dimensions of the service differentiation, different dimension values generally represent different service differentiations, and a combination of different dimension values also generally represents different service scenarios. For example, assume that a service scenario consists of 5 service-differentiated dimensional values, which are: if the 5 differentiated dimensional values of the two service data, namely dimA, dimB, dimC, dim4 and dim5, are the same, it can be determined that the service scenes of the two service data are the same. Referring to the example of table 1, the service differentiation dimension values of the service data 1 and the service data 2 are the same, and thus it may be determined that the service scenarios of the service data 1 and the service data 2 are the same and different from the service data 3.
Serial number
|
Business scenario
|
1
|
dimA=1,dimB=2,dimC=3,dim4=4,dim5=5
|
2
|
dimA=1,dimB=2,dimC=3,dim4=4,dim5=5
|
3
|
dimA=1,dimB=2,dimC=3,dim4=5,dim5=6 |
TABLE 1
In this embodiment, to improve the calculation efficiency of the correspondence between the service scenario and the service rule, the service system may extract a preset service parameter of the service data as a log embedded point when the service data flows through, print the log embedded point in a log file, subsequently adjust the structure of the log file, and convert the log embedded point into structured data convenient for processing and analysis, and store the structured data. When the corresponding relationship between the service scenario and the service rule is calculated, the dimension value of the service data in each service division in the last time period can be extracted from the structured data to serve as the service scenario of the service data. On the other hand, the business rules of the business data can be extracted from the structured data. Referring to the example of table 2, table 2 shows a business scenario and a business rule of historical business data.
Serial number
|
Business scenario
|
Business rules
|
1
|
dimA=1,dimB=2,dimC=3,dim4=4,dim5=5
|
rule1_v1,rule2_v1,rule3_v1
|
2
|
dimA=1,dimB=2,dimC=3,dim4=4,dim5=5
|
rule4_v1,rule5_v1
|
3
|
dimA=1,dimB=2,dimC=3,dim4=5,dim5=6
|
rule3_v1,rule6_v1 |
TABLE 2
It should be noted that, in practical applications, in order to improve the execution efficiency and facilitate the later maintenance, a plurality of different systems may be used to implement the functions of printing, structure adjustment, and the like of the log embedded point, such as: after the service system prints the log embedded points of the service data flowing through into the log file, the acquisition system can acquire the log embedded points, the adjustment system can perform structural adjustment on the log embedded points, the computing system can also calculate the corresponding relation between the service scene and the service rule, and the like, and the application does not specially limit the corresponding relation.
Step 202, aggregating the service rules of the historical service data with the same service scene as the service rule corresponding to the service scene.
In this embodiment, after the service scenario of the historical service data is determined, the service rules of the historical service data having the same service scenario may be aggregated to serve as the service rule corresponding to the service scenario. In other words, the service rules of the historical service data with the same service scenario may be merged to serve as the service rules corresponding to the service scenario.
Still taking the historical service data shown in table 2 as an example, if the service scenarios of the service data 1 and the service data 2 are the same, the service rules of the service data 1 and the service data 2 may be aggregated to be used as the service rule corresponding to the service scenario, and then the corresponding relationship shown in table 3 is formed and stored.
TABLE 3
Monitoring of real-time service data
In this embodiment, the service data generated in real time can be monitored, and problems can be timely discovered and solved. In one example, when the service data flows through, the service system may extract preset service parameters of the service data, print the preset service parameters as log embedded points in a log file, adjust the structure of the log file, and convert the log embedded points into structured data convenient for processing and analysis for storage. It should be noted that, in the present application, the converted structured data may be stored in two different databases, one of which may be a first database for subsequently calculating the correspondence between the business scenario and the business rule, such as: ODPS, which can perform a technology of correspondence between a service scenario and a service rule when a next time period is reached. Another may be a second database, such as: hbase, structured time corresponding to real-time service data can be rapidly obtained based on Hbase so as to facilitate monitoring, and timeliness is higher.
In this embodiment, the real-time data in the second database may be monitored, and if structured data corresponding to the newly added real-time service data in the second database is monitored, a real service scene and a real service rule of the real-time service data may be extracted based on the structured data. The extracted real service scene is generally a dimension value of the real-time service data distinguished in each service. The extracted real service rule may be a simpler action or a more complex action according to the actual condition of the service, for example: including preconditions and actions.
For example, assume that the business scenario is code scanning payment and the business rule is a payment instrument. The method is simple, and the extracted real business rule of a certain piece of real-time business data can be as follows: the balance used is paid. More complicated, the extracted real business rule of a certain piece of real-time business data may include preconditions and actions, such as: the precondition is mobile-end platform, promotion, and action is payment by bank card.
It should be noted that, in practical applications, the precondition of the business rule may include a partial dimension value of the business scenario, such as: the service scenario includes dimension values of 5 service partitions, and the corresponding service rule may include 3 of the dimension values of 5 service partitions, which may be specifically set according to the service condition, and this is not particularly limited in this application.
In this embodiment, after extracting the real service scene and the real service rule of the real-time service data, the service rule corresponding to the real service scene may be searched in the stored correspondence, and then it is determined whether the real service rule matches the searched service rule, and if there is a real service rule different from the searched service rule, an alarm prompt may be output. On the other hand, if the corresponding relation between the service scene and the service rule does not have a real service scene of some real-time service data, an alarm prompt can be output.
For example, assume that, in the stored correspondence relationship between the service scenario and the service rule, the service rule (payment tool) corresponding to the code scanning payment of the service scenario is: allowing balance payment, allowing bank card payment, allowing balance treasures payment, and not allowing flower payment. If the real service scene of the real-time service data 1 is code scanning payment and the real service rule is balance payment, it can be determined that the real service rule of the real-time service data 1 matches the searched service rule. Assuming that the real service scene of the real-time service data 2 is code scanning payment and the real service rule is flower payment, it can be determined that the real service rule of the real-time service data 2 is different from the searched service rule, and then an alarm prompt is output so that a service person can check the alarm prompt.
In this embodiment, the warning prompt may be output in a form of a short message, an email, or the like, and after receiving the warning prompt, the service personnel may view the relevant information in the warning page. In one example, for facilitating the viewing of service personnel, the real service scene of the real-time service data, the service rule corresponding to the found real service scene, and the real service rule may be displayed in an alarm page, wherein a service rule different from the found real service scene in the real service rule may be displayed differently. Referring to the alarm page shown in fig. 3, through the alarm page, a service person can intuitively know that the service scenario of the real-time service data to be alarmed is code scanning payment in offline payment of a payment bank, and an abnormal service rule occurring in a real service rule is a service rule 4. Optionally, the service personnel may also query the service scenario affected by the service rule by clicking the service rule in the alarm page, for example: the service person can click on the service rule 4 to view all the service scenarios related to the service rule 4.
As can be seen from the above description, the present application can monitor real-time service data, and if the real service rule of the real-time service data is different from the service rule corresponding to the found real service scene, the service person can check the details of the alarm through the alarm page by outputting the alarm prompt, so as to solve the related problems in time. On the other hand, based on the technical scheme provided by the application, business personnel can monitor the business rules, professional technical personnel are not needed to participate in the whole process, and a large amount of labor cost is saved.
Corresponding to the embodiment of the foregoing service monitoring method, the present application also provides an embodiment of a service monitoring apparatus.
The embodiment of the service monitoring device can be applied to a server or a server cluster deployed by a service provider. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the server where the device is located. In terms of hardware, as shown in fig. 4, the hardware structure diagram of the server where the service monitoring device is located in the present application is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 4, the server where the device is located in the embodiment may also include other hardware according to the actual function of the server, which is not described again.
Fig. 5 is a block diagram of a traffic monitoring apparatus according to an exemplary embodiment of the present application.
Referring to fig. 5, the service monitoring apparatus 400 can be applied to the server shown in fig. 4, and includes: a relation calculation unit 401, a real-time acquisition unit 402, a rule search unit 403, and an output alarm unit 404.
The relation calculation unit 401 calculates a corresponding relation between a service scene and a service rule according to historical service data;
a real-time obtaining unit 402, configured to obtain, for real-time service data, a real service scene and a real service rule of the real-time service data;
a rule searching unit 403, configured to search the corresponding relation for a service rule corresponding to the real service scenario;
and an output alarm unit 404, configured to output an alarm prompt if the actual service rule is different from the found service rule.
Optionally, when the preset time period is reached, the relationship calculation unit 401 calculates a correspondence between the service scene and the service rule based on the historical service data in the previous time period, and updates the correspondence calculated in the previous time period with the correspondence.
Optionally, the relationship calculating unit 401 determines the service scenarios of the historical service data, and aggregates the service rules of the historical service data with the same service scenario as the service rule corresponding to the service scenario.
Optionally, the real-time obtaining unit 402:
extracting preset service parameters of the real-time service data as log burying points;
converting the log buried points into structured data;
and extracting the real service scene and the real service rule of the real-time service data from the structured data.
Optionally, the output warning unit 404 displays, in a warning page, the real service scene of the real-time service data, the service rule corresponding to the found real service scene, and the real service rule, where a service rule different from the found real service scene in the real service rule is displayed differently.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.