CN113157911A - Service verification method and device - Google Patents
Service verification method and device Download PDFInfo
- Publication number
- CN113157911A CN113157911A CN202010013806.XA CN202010013806A CN113157911A CN 113157911 A CN113157911 A CN 113157911A CN 202010013806 A CN202010013806 A CN 202010013806A CN 113157911 A CN113157911 A CN 113157911A
- Authority
- CN
- China
- Prior art keywords
- log
- target log
- service
- classification
- feature matrix
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
- G06F16/355—Class or cluster creation or modification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1805—Append-only file systems, e.g. using logs or journals to store data
- G06F16/1815—Journaling file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- General Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- Computational Linguistics (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a service verification method and device, and relates to the technical field of computers. One embodiment of the method comprises: acquiring a target log called by a service, and determining a characteristic matrix corresponding to the target log; matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log; and determining the type of the target log according to the classification probability, and verifying whether the service is abnormal or not according to the type of the target log. The embodiment improves the accuracy of service verification, shortens the verification time and reduces the verification cost.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a service verification method and device.
Background
With the continuous expansion of the overall scale of business of e-commerce companies and interconnected enterprises and the increasing complexity of system architecture, the deployment scale of multiple machine rooms and multiple instances is also increasing, the verification cost required by service release is also increasing, and the verification of services only by traditional manpower is more and more challenging. Therefore, a new technology is urgently needed to discover abnormal events of online updating of the service in time, always master the service correctness condition, reduce the risk of online service release and improve the intelligent management and control of the service.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
whether the type judgment is carried out on service call logs manually or service type judgment is carried out through service interface data, the method is long in time consumption, high in verification cost and low in accuracy.
Disclosure of Invention
In view of this, embodiments of the present invention provide a service verification method and apparatus, which can significantly improve accuracy of service verification, shorten verification duration, and reduce verification cost.
To achieve the above object, according to a first aspect of an embodiment of the present invention, there is provided a service verification method, including:
acquiring a target log called by a service, and determining a characteristic matrix corresponding to the target log;
matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log;
and determining the type of the target log according to the classification probability, and verifying whether the service is abnormal or not according to the type of the target log.
Further, the step of determining the feature matrix corresponding to the target log includes: and after converting the target log into a calling link text, mapping the calling link text into a discrete text, extracting an incidence matrix from the discrete text, and performing convolution calculation on the incidence matrix to obtain a characteristic matrix corresponding to the target log.
Further, before the step of performing matching calculation on the feature matrix and the feature matrix corresponding to the history log in the classification library, the service verification method further includes: obtaining a history log, converting the history log into a calling link text, mapping the calling link text corresponding to the history log into a discrete text, extracting an incidence matrix from the discrete text according to the log type indicated by the discrete text, and putting the incidence matrix into a training model to perform convolution calculation to obtain a feature matrix corresponding to the history log and probability intervals corresponding to different log types.
Further, before the step of extracting the correlation matrix according to the log type indicated by the discrete text, the service verification method further includes: and dividing all the discrete texts into a training set and a verification set according to the configuration proportion, wherein the training set is placed in a training model for convolution calculation, and the verification set is used for verifying the convolution calculation result.
Further, before the step of performing matching calculation on the feature matrix and the feature matrix corresponding to each history log in the classification library, the service verification method further includes: and performing variance calculation on the feature matrix corresponding to the target log and the feature matrix corresponding to the historical log in the classification library to obtain the variance of the feature matrix corresponding to the target log, and judging that the variance is less than or equal to a variance threshold value.
Further, under the condition that the variance is larger than the variance threshold, the target log is used as an unreturned training sample and is placed into a training set of the historical log, the training set is placed into a training model for convolution calculation, and the convolution calculation result is placed into a classification library.
Further, the step of performing matching calculation on the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log comprises: and matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to obtain a classification probability set corresponding to the target log, and determining the classification probability corresponding to the target log from the classification probability set according to set conditions.
Further, the classification library also includes probability intervals corresponding to different log types, and the step of determining the type of the target log according to the classification probability includes: and comparing the classification probability of the target log with probability intervals corresponding to different log types in the classification library to determine the type of the target log.
According to a second aspect of the embodiments of the present invention, there is provided a service authentication apparatus including:
the target log obtaining module is used for obtaining a target log called by the service and determining a characteristic matrix corresponding to the target log;
the matching calculation module is used for performing matching calculation on the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log;
and the service verification module is used for determining the type of the target log according to the classification probability and verifying whether the service is abnormal according to the type of the target log.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including:
one or more processors;
a storage device for storing one or more programs,
when executed by one or more processors, cause the one or more processors to implement any of the service authentication methods described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable medium having stored thereon a computer program which, when executed by a processor, implements any one of the service authentication methods described above.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of obtaining a target log called by a service, and determining a feature matrix corresponding to the target log; matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log; the type of the target log is determined according to the classification probability, and whether the service is abnormal or not is verified according to the type of the target log, so that the technical problems of long time consumption, high verification cost and low accuracy in the prior art are solved, and the technical effects of remarkably improving the accuracy of service verification, shortening the verification time and reducing the verification cost are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a service authentication method provided according to a first embodiment of the present invention;
fig. 2 is a schematic diagram of a main flow of a service authentication method provided according to a second embodiment of the present invention;
fig. 3 is a schematic diagram of the main modules of a service authentication apparatus provided according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
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 schematic diagram of a main flow of a service authentication method provided according to a first embodiment of the present invention; as shown in fig. 1, the service verification method provided in the embodiment of the present invention mainly includes:
step S101, a target log of service calling is obtained, and a feature matrix corresponding to the target log is determined.
The target logs are all logs to be analyzed generated during service calling, whether abnormal conditions occur in the service calling process can be determined according to the types of the logs to be analyzed, and verification before service online is completed.
Specifically, according to the embodiment of the present invention, the step of determining the feature matrix corresponding to the target log includes: and after converting the target log into a calling link text, mapping the calling link text into a discrete text, extracting an incidence matrix according to the discrete text, and performing convolution calculation on the incidence matrix to obtain a characteristic matrix corresponding to the target log.
In actual operation, the implementation of the corresponding function of the service needs to rely on multiple calls to return results, therefore, in order to better solve the coupling, the system may perform layering on the code structure, for example, a layer for initiating an RPC (Remote Procedure Call) and a layer for logically processing aggregated data are separated, and these layers are concurrently called each time a service request responds, and therefore, the generated Call request sequence is usually not performed according to a link of one Call, but is a discrete log statement. By the arrangement, the target log is subjected to calculation processing, namely, the log link generated according to the calling request is preprocessed according to the calling sequence, a complete calling link text is obtained again, the calling link text is mapped into a discrete text through the service interface, the incidence matrix is extracted according to the discrete text, the characteristic matrix corresponding to the target log can be obtained through convolution calculation of the incidence matrix, and the accuracy of determining the type corresponding to the target log by subsequent further processing is facilitated.
And step S102, performing matching calculation on the feature matrix and the feature matrix corresponding to each historical log in the classification library, and determining the classification probability corresponding to the target log.
Specifically, according to the embodiment of the present invention, before the step of performing matching calculation on the feature matrix and the feature matrix corresponding to each history log in the classification library, the service verification method further includes: the method comprises the steps of obtaining a historical log, converting the historical log into a calling link text, mapping the calling link text corresponding to the historical log into a discrete text, extracting an incidence matrix from the discrete text according to the log type indicated by the discrete text, and putting the incidence matrix into a training model to perform convolution calculation to obtain a feature matrix corresponding to the historical log and probability intervals corresponding to different log types.
Through the setting, all historical log data in the system are obtained, then discrete texts are obtained through preprocessing and mapping, a plurality of incidence matrixes are extracted according to log types indicated by the discrete texts, and then a feature matrix corresponding to the historical logs and probability intervals corresponding to different log types are obtained through convolution calculation.
Further, according to an embodiment of the present invention, before the step of extracting the correlation matrix according to the log type indicated by the discrete text, the service verification method further includes: and dividing all the discrete texts into a training set and a verification set according to the configuration proportion, wherein the training set is placed in a training model for convolution calculation, and the verification set is used for verifying the convolution calculation result. Specifically, the training set is placed in a training model for convolution calculation to obtain a feature matrix corresponding to each historical log and probability intervals corresponding to different log types, and the verification set is used for verifying the convolution calculation result.
The log type indicated by the discrete text can be determined manually, the log type comprises a normal type and an abnormal type, and the abnormal type comprises a warning, an error and the like. For discrete texts belonging to a verification set, due to the high requirement on accuracy, the log type corresponding to the discrete texts needs to be judged manually; for discrete texts belonging to a training set, the corresponding log type can be judged by directly extracting the feature vectors of the discrete texts without manual judgment.
According to the embodiment of the present invention, before the step of performing matching calculation on the feature matrix and the feature matrix corresponding to each history log in the classification library, the service verification method further includes: and performing variance calculation on the feature matrix corresponding to the target log and the feature matrix corresponding to the historical log in the classification library to obtain the variance of the feature matrix corresponding to the target log, and judging that the variance is less than or equal to a variance threshold value.
Through the setting, the feature matrix corresponding to the target log and the feature matrix corresponding to the historical log in the classification library are subjected to matching calculation, firstly, the variance corresponding to the target matrix is obtained, if the variance is smaller than or equal to the variance threshold value, the type corresponding to the target log can be correspondingly matched with the type indicated by the historical log in the classification library, and the matching calculation is continued to obtain the classification probability corresponding to the target log.
Further, according to the embodiment of the present invention, when the variance is greater than the variance threshold, the target log is used as an unreregressive training sample and placed in the training set of the history log, the training set is placed in the training model for convolution calculation, and the convolution calculation result is placed in the classification library.
When the variance corresponding to the target log is greater than the variance threshold, it is indicated that the log type indicated by the target log does not appear in the log type set included in the historical log, and therefore, the target log needs to be used as an unreturned training set, and convolution calculation is performed again together with the training set in the historical log to obtain the corresponding feature matrix and the probability interval of the log type again, so that the classification library is perfected and supplemented, and the accuracy of subsequent continuous service verification is improved.
According to the embodiment of the invention, the step of performing matching calculation on the feature matrix and the feature matrix corresponding to each historical log in the classification library and determining the classification probability corresponding to the target log comprises the following steps: and matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to obtain a classification probability set corresponding to the target log, and determining the classification probability corresponding to the target log from the classification probability set according to set conditions.
Specifically, the feature matrixes corresponding to the target logs are respectively matched with feature matrixes corresponding to different historical logs in the classification library for calculation, the calculation results are normalized according to the probability tree to obtain a classification probability set corresponding to the target logs, and then the classification probability corresponding to the target logs is determined from the classification probability set according to set conditions. The set condition may be that one or more (greater than or equal to 2) classification probabilities with the highest values in the classification probability set are used as the classification probabilities corresponding to the target logs.
And step S103, determining the type of the target log according to the classification probability, and verifying whether the service is abnormal or not according to the type of the target log.
According to the embodiment of the invention, the step of determining the type of the target log according to the classification probability comprises the following steps: and comparing the classification probability of the target log with probability intervals corresponding to different log types in the classification library to determine the type of the target log.
And if the classification probability corresponding to the target log is one, directly determining the type corresponding to the target log according to the probability interval determined by comparing the classification probabilities. If the classification probability corresponding to the target log is multiple (greater than or equal to two), if the multiple classification probabilities fall in the same probability interval, the type of the target log can be determined, if the multiple classification probabilities fall in different probability intervals, the type comparison representing the target log fails, the target log also needs to be used as an unreregressive training sample, the training sample is placed into a training set of a historical log, the training set is placed into a training model for convolution calculation, and a processing result is placed into a classification library.
In the construction process of the classification library, probability intervals of different log types are obtained through calculation processing of the historical logs, the classification probability corresponding to the target log is directly compared with the classification probability, the type of the target log can be determined, the type corresponding to the target log is the type of the service, and whether the service is in an abnormal condition or not can be known according to the type of the service. Therefore, the verification time is shortened, and the verification cost is reduced.
According to the technical scheme of the embodiment of the invention, the target log of the service call is obtained, and the characteristic matrix corresponding to the target log is determined; matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log; the type of the target log is determined according to the classification probability, and whether the service is abnormal or not is verified according to the type of the target log, so that the technical problems of long time consumption, high verification cost and low accuracy in the prior art are solved, and the technical effects of remarkably improving the accuracy of service verification, shortening the verification time and reducing the verification cost are achieved.
Fig. 2 is a schematic diagram of a main flow of a service authentication method provided according to a second embodiment of the present invention; as shown in fig. 2, the service verification method provided in the embodiment of the present invention mainly includes:
step S201, obtaining a history log, converting the history log into a calling link text, and mapping the calling link text corresponding to the history log into a discrete text.
Specifically, the history log includes data related to the chain of anomalies. By acquiring the data, the log type included in the historical log can be determined so as to be convenient for comparison with the target log subsequently, the type of the target log is determined, and then the verification on whether the service is abnormal or not is realized.
In actual operation, the implementation of the corresponding function of the service needs to rely on multiple calls to return results, therefore, in order to better solve the coupling, the system may perform layering on the code structure, for example, a layer for initiating an RPC (Remote Procedure Call) and a layer for logically processing aggregated data are separated, and these layers are concurrently called each time a service request responds, and therefore, the generated Call request sequence is usually not performed according to a link of one Call, but is a discrete log statement. Through the setting, the target log is subjected to calculation processing, namely, the log link generated according to the calling request is preprocessed according to the calling sequence, a complete calling link text is obtained again, and then the calling link text is mapped into a discrete text through the service interface calling link.
And S202, dividing all the discrete texts into a training set and a verification set according to the configuration proportion, and judging the log types corresponding to the discrete texts, wherein the training set is placed in a training model for convolution calculation, and the verification set is used for verifying the convolution calculation result.
According to the embodiment of the invention, the configuration proportion is based on the twenty-eight principle, namely 80% of discrete text data is used as a training set, and 20% is used as a verification set. The above numerical values are not limitations of the present invention, and the corresponding configuration ratios may be set according to actual situations.
According to the embodiment of the invention, the log type indicated by the discrete text can be judged manually, the log type comprises a normal type and an abnormal type, and the abnormal type comprises warning, error and the like. For discrete texts belonging to a verification set, due to the high requirement on accuracy, the log type corresponding to the discrete texts needs to be judged manually; for discrete texts belonging to a training set, the corresponding log type can be judged by directly extracting the feature vectors of the discrete texts without manual judgment.
Step S203, extracting an association matrix from the discrete text according to the log type indicated by the discrete text, and performing convolution calculation on the association matrix to obtain a classification library, wherein the classification library comprises a feature matrix corresponding to the historical log and probability intervals corresponding to different log types.
Through the setting, all historical log data in the system are obtained, then discrete texts are obtained through preprocessing and mapping, the incidence matrix is extracted according to the log types indicated by the discrete texts, and the feature matrix corresponding to the historical logs and the probability intervals corresponding to different log types are obtained through convolution calculation.
Step S204, a target log of service calling is obtained, and a characteristic matrix corresponding to the target log is determined.
The target logs are all logs to be analyzed generated during service calling, whether abnormal conditions occur in the service calling process can be determined according to the types of the logs to be analyzed, and verification before service online is completed.
Specifically, according to the embodiment of the present invention, the step of determining the feature matrix corresponding to the target log includes: and after converting the target log into a calling link text, mapping the calling link text into a discrete text, extracting an incidence matrix according to the discrete text, and performing convolution calculation on the incidence matrix to obtain a characteristic matrix corresponding to the target log.
Through the arrangement, the incidence matrix is extracted according to the discrete text, the characteristic matrix corresponding to the target log can be obtained through convolution calculation of the incidence matrix, and the accuracy rate of determining the type corresponding to the target log through subsequent further processing is provided.
Step S205, the variance calculation is carried out on the feature matrix corresponding to the target log and the feature matrix corresponding to the historical log in the classification library to obtain the variance of the feature matrix corresponding to the target log, and whether the variance is smaller than or equal to the variance threshold value is judged. If yes, that is, the variance corresponding to the target log is less than or equal to the variance threshold, then step S206 is executed; if not, that is, the variance corresponding to the target log is greater than the variance threshold, go to step S207.
According to the setting, the variance calculation is carried out on the feature matrix corresponding to the target log and the feature matrix corresponding to the historical log in the classification library, firstly, the variance corresponding to the target matrix is obtained, if the variance is smaller than or equal to the variance threshold value, the fact that the type corresponding to the target log can be correspondingly matched with the type indicated by the historical log in the classification library is shown, and the classification probability corresponding to the target log is obtained through the matching calculation.
And step S206, matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to obtain a classification probability set.
Step S207, the target log is used as an unreturned training sample, and placed in the training set of the history log, and the process goes to step S202.
When the variance corresponding to the target log is greater than the variance threshold, it is indicated that the log type indicated by the target log does not appear in the log type set included in the historical log, and therefore, the target log needs to be used as an unreturned training set, and convolution calculation is performed again together with the training set in the historical log to obtain the corresponding feature matrix and the probability interval of the log type again, so that the classification library is perfected and supplemented, and the accuracy of subsequent continuous service verification is improved.
And step S208, determining the classification probability corresponding to the target log from the classification probability set according to the set conditions.
Specifically, feature matrixes corresponding to the target logs are respectively matched with feature matrixes corresponding to different historical logs in a classification library for calculation, the calculation results are normalized according to probability numbers to obtain a classification probability set corresponding to the target logs, and then the numerical values of the classification probabilities in the classification probability set are sorted from high to low, and one or more classification probabilities in front are selected as the classification probabilities corresponding to the target logs.
Step S209, determining the type of the target log according to the classification probability, and verifying whether the service is abnormal according to the type of the target log.
According to the embodiment of the invention, the step of determining the type of the target log according to the classification probability comprises the following steps: and comparing the classification probability of the target log with probability intervals corresponding to different log types in the classification library to determine the type of the target log.
And if the classification probability corresponding to the target log is one, directly determining the type corresponding to the target log according to the probability interval determined by comparing the classification probabilities. If the classification probability corresponding to the target log is multiple (greater than or equal to two), if the multiple classification probabilities fall in the same probability interval, the type of the target log can be determined, if the multiple classification probabilities fall in different probability intervals, the type comparison representing the target log fails, the target log also needs to be used as an unreregressive training sample, the training sample is placed into a training set of a historical log, the training set is placed into a training model for convolution calculation, and a processing result is placed into a classification library.
In the construction process of the classification library, probability intervals of different log types are obtained through calculation processing of the historical logs, the classification probability corresponding to the target log is directly compared with the classification probability, the type of the target log can be determined, the type corresponding to the target log is the type of the service, and whether the service is in an abnormal condition or not can be known according to the type of the service. Therefore, the verification time is shortened, and the verification cost is reduced.
According to the technical scheme of the embodiment of the invention, the target log of the service call is obtained, and the characteristic matrix corresponding to the target log is determined; matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log; the type of the target log is determined according to the classification probability, and whether the service is abnormal or not is verified according to the type of the target log, so that the technical problems of long time consumption, high verification cost and low accuracy in the prior art are solved, and the technical effects of remarkably improving the accuracy of service verification, shortening the verification time and reducing the verification cost are achieved.
Fig. 3 is a schematic diagram of the main modules of a service authentication apparatus provided according to an embodiment of the present invention; as shown in fig. 3, the service verification apparatus 300 according to the embodiment of the present invention mainly includes:
the target log obtaining module 301 is configured to obtain a target log of service invocation, and determine a feature matrix corresponding to the target log.
The target logs are all logs to be analyzed generated during service calling, whether abnormal conditions occur in the service calling process can be determined according to the types of the logs to be analyzed, and verification before service online is completed.
Specifically, according to the embodiment of the present invention, the target log obtaining module 301 is further configured to: and after converting the target log into a calling link text, mapping the calling link text into a discrete text, extracting an incidence matrix according to the discrete text, and performing convolution calculation on the incidence matrix to obtain a characteristic matrix corresponding to the target log.
In actual operation, the implementation of the corresponding function of the service needs to rely on multiple calls to return results, therefore, in order to better solve the coupling, the system may perform layering on the code structure, for example, a layer for initiating an RPC (Remote Procedure Call) and a layer for logically processing aggregated data are separated, and these layers are concurrently called each time a service request responds, and therefore, the generated Call request sequence is usually not performed according to a link of one Call, but is a discrete log statement. By the arrangement, the target log is subjected to calculation processing, namely, the log link generated according to the calling request is preprocessed according to the calling sequence, a complete calling link text is obtained again, the calling link text is mapped into a discrete text through the service interface, the incidence matrix is extracted according to the discrete text, the characteristic matrix corresponding to the target log can be obtained through convolution calculation of the incidence matrix, and the accuracy of determining the type corresponding to the target log by subsequent further processing is facilitated.
And the matching calculation module 302 is used for performing matching calculation on the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log.
Specifically, according to the embodiment of the present invention, the service verification apparatus 300 further includes a classification library creating module, before the step of performing matching calculation on the feature matrix and the classification library, the classification library creating module is configured to: the method comprises the steps of obtaining a historical log, converting the historical log into a calling link text, mapping the calling link text corresponding to the historical log into a discrete text, extracting an incidence matrix from the discrete text according to the log type indicated by the discrete text, and putting the incidence matrix into a training model to perform convolution calculation to obtain a feature matrix corresponding to the historical log and probability intervals corresponding to different log types.
Through the setting, all historical log data in the system are obtained, then discrete texts are obtained through preprocessing and mapping, the incidence matrix is extracted according to the log types indicated by the discrete texts, and the feature matrix corresponding to the historical logs and the probability intervals corresponding to different log types are obtained through convolution calculation.
Further, according to the embodiment of the present invention, before the step of performing convolution calculation on the association matrix to obtain the feature matrix corresponding to the history log, the classification library creating module is further configured to: and dividing all the discrete texts into a training set and a verification set according to the configuration proportion, wherein the training set is placed in a training model for convolution calculation, and the verification set is used for verifying the convolution calculation result.
The log type indicated by the discrete text can be determined manually, the log type comprises a normal type and an abnormal type, and the abnormal type comprises a warning, an error and the like. For discrete texts belonging to a verification set, due to the high requirement on accuracy, the log type corresponding to the discrete texts needs to be judged manually; for discrete texts belonging to a training set, the corresponding log type can be judged by directly extracting the feature vectors of the discrete texts without manual judgment.
According to the embodiment of the present invention, the service verification apparatus 300 further includes a variance calculation module, before the feature matrix is matched and calculated with the feature matrix corresponding to the history log in the classification library, the variance calculation module is configured to: and performing variance calculation on the feature matrix corresponding to the target log and the feature matrix corresponding to the historical log in the classification library to obtain the variance of the feature matrix corresponding to the target log, and judging that the variance is less than or equal to a variance threshold value.
Through the setting, the feature matrix corresponding to the target log and the feature matrix corresponding to the historical log in the classification library are subjected to matching calculation, firstly, the variance corresponding to the target matrix is obtained, if the variance is smaller than or equal to the variance threshold value, the type corresponding to the target log can be correspondingly matched with the type indicated by the historical log in the classification library, and the matching calculation is continued to obtain the classification probability corresponding to the target log.
Further, in the case that the variance is greater than the variance threshold, the matching calculation module 302 is further configured to: and taking the target log as an unreregressive training sample, putting the target log into a training set of the historical log, putting the training set into a training model for convolution calculation, and putting the convolution calculation result into a classification library.
When the variance corresponding to the target log is greater than the variance threshold, it is indicated that the log type indicated by the target log does not appear in the log type set included in the historical log, and therefore, the target log needs to be used as an unreturned training set, and convolution calculation is performed again together with the training set in the historical log to obtain the corresponding feature matrix and the probability interval of the log type again, so that the classification library is perfected and supplemented, and the accuracy of subsequent continuous service verification is improved.
According to an embodiment of the present invention, the matching calculation module 302 is further configured to: and performing matching calculation on the feature matrix and the feature matrix corresponding to each historical log in the classification library to obtain a classification probability set corresponding to the target log, and determining the classification probability corresponding to the target log according to the sorting of classification probability values in the classification probability set.
Specifically, feature matrixes corresponding to the target logs are respectively matched with feature matrixes corresponding to different historical logs in a classification library for calculation, the calculation results are normalized according to probability numbers to obtain a classification probability set corresponding to the target logs, and then the numerical values of the classification probabilities in the classification probability set are sorted from high to low, and one or more classification probabilities in front are selected as the classification probabilities corresponding to the target logs.
And the service verification module 303 determines the type of the target log according to the classification probability, and verifies whether the service is abnormal according to the type of the target log.
According to the embodiment of the present invention, the service verification module 303 is further configured to: and comparing the classification probability of the target log with probability intervals corresponding to different log types in the classification library to determine the type of the target log.
And if the classification probability corresponding to the target log is one, directly determining the type corresponding to the target log according to the probability interval determined by comparing the classification probabilities. If the classification probability corresponding to the target log is multiple (greater than or equal to two), if the multiple classification probabilities fall in the same probability interval, the type of the target log can be determined, if the multiple classification probabilities fall in different probability intervals, the type comparison representing the target log fails, the target log also needs to be used as an unreregressive training sample, the training sample is placed into a training set of a historical log, the training set is placed into a training model for convolution calculation, and a processing result is placed into a classification library.
In the construction process of the classification library, probability intervals of different log types are obtained through calculation processing of the historical logs, the classification probability corresponding to the target log is directly compared with the classification probability, the type of the target log can be determined, the type corresponding to the target log is the type of the service, and whether the service is in an abnormal state or not can be known according to the type of the service. Therefore, the verification time is shortened, and the verification cost is reduced.
According to the technical scheme of the embodiment of the invention, the target log of the service call is obtained, and the characteristic matrix corresponding to the target log is determined; matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log; the type of the target log is determined according to the classification probability, and whether the service is abnormal or not is verified according to the type of the target log, so that the technical problems of long time consumption, high verification cost and low accuracy in the prior art are solved, and the technical effects of remarkably improving the accuracy of service verification, shortening the verification time and reducing the verification cost are achieved.
Fig. 4 shows an exemplary system architecture 400 to which the service authentication method or service authentication apparatus of an embodiment of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404 and a server 405 (this architecture is merely an example, and the components included in the specific architecture may be adjusted according to the specific situation of the invention). The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 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 401, 402, 403 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 405 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 401, 402, 403. The background management server may analyze and perform other processing on the received data such as the target log, the classification library, and the like, and feed back a processing result (such as a feature matrix, a classification probability, which is merely an example) to the terminal device.
It should be noted that the service authentication method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the service authentication apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 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. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 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 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
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 target log acquisition module, a matching computation module, and a service verification module. The names of the modules do not form a limitation on the modules themselves in some cases, for example, the target log obtaining module may also be described as a "target log for obtaining service calls, and determining a feature matrix module corresponding to the target log".
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: acquiring a target log called by a service, and determining a characteristic matrix corresponding to the target log; matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log; and determining the type of the target log according to the classification probability, and verifying whether the service is abnormal or not according to the type of the target log.
According to the technical scheme of the embodiment of the invention, the target log of the service call is obtained, and the characteristic matrix corresponding to the target log is determined; matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log; the type of the target log is determined according to the classification probability, and whether the service is abnormal or not is verified according to the type of the target log, so that the technical problems of long time consumption, high verification cost and low accuracy in the prior art are solved, and the technical effects of remarkably improving the accuracy of service verification, shortening the verification time and reducing the verification cost are achieved.
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.
Claims (11)
1. A method for service authentication, comprising:
acquiring a target log called by a service, and determining a characteristic matrix corresponding to the target log;
matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log;
and determining the type of the target log according to the classification probability, and verifying whether the service is abnormal or not according to the type of the target log.
2. The service verification method according to claim 1, wherein the step of determining the feature matrix corresponding to the target log comprises: and after converting the target log into a calling link text, mapping the calling link text into a discrete text, extracting an incidence matrix from the discrete text, and performing convolution calculation on the incidence matrix to obtain a characteristic matrix corresponding to the target log.
3. The service verification method according to claim 1, wherein before the step of performing matching calculation on the feature matrix and the feature matrix corresponding to the history log in the classification library, the service verification method further comprises: obtaining a history log, converting the history log into a calling link text, mapping the calling link text corresponding to the history log into a discrete text, extracting an incidence matrix from the discrete text according to the log type indicated by the discrete text, and putting the incidence matrix into a training model for convolution calculation to obtain a feature matrix corresponding to the history log and probability intervals corresponding to different log types.
4. The service authentication method according to claim 3, wherein before the step of extracting the correlation matrix according to the log type indicated by the discrete text, the service authentication method further comprises: and dividing all discrete texts into a training set and a verification set according to a configuration proportion, wherein the training set is placed into the training model for convolution calculation, and the verification set is used for verifying the convolution calculation result.
5. The service verification method according to claim 1, wherein before the step of performing matching calculation on the feature matrix and the feature matrix corresponding to each history log in the classification library, the service verification method further comprises: and carrying out variance calculation on the feature matrix corresponding to the target log and the feature matrix corresponding to the historical log in the classification library to obtain the variance of the feature matrix corresponding to the target log, and judging that the variance is less than or equal to a variance threshold value.
6. The service verification method according to claim 5, wherein in the case that the variance is greater than the variance threshold, the target log is placed as an unreturned training sample into a training set of a history log, the training set is placed into a training model for convolution calculation, and the convolution calculation result is placed into the classification library.
7. The service verification method according to claim 1, wherein the feature matrix is matched with the feature matrix corresponding to each historical log in the classification library, and the step of determining the classification probability corresponding to the target log comprises: and matching and calculating the feature matrix and the feature matrix corresponding to each historical log in the classification library to obtain a classification probability set corresponding to the target log, and determining the classification probability corresponding to the target log from the classification probability set according to set conditions.
8. The service verification method according to claim 1, wherein the classification library further includes probability intervals corresponding to different log types, and the step of determining the type of the target log according to the classification probability includes: and comparing the classification probability of the target log with probability intervals corresponding to different log types in a classification library to determine the type of the target log.
9. A service authentication apparatus, comprising:
the target log obtaining module is used for obtaining a target log called by a service and determining a characteristic matrix corresponding to the target log;
the matching calculation module is used for performing matching calculation on the feature matrix and the feature matrix corresponding to each historical log in the classification library to determine the classification probability corresponding to the target log;
and the service verification module is used for determining the type of the target log according to the classification probability and verifying whether the service is abnormal or not according to the type of the target log.
10. An electronic device, comprising:
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 one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010013806.XA CN113157911A (en) | 2020-01-07 | 2020-01-07 | Service verification method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010013806.XA CN113157911A (en) | 2020-01-07 | 2020-01-07 | Service verification method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113157911A true CN113157911A (en) | 2021-07-23 |
Family
ID=76881379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010013806.XA Pending CN113157911A (en) | 2020-01-07 | 2020-01-07 | Service verification method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113157911A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114356908A (en) * | 2022-01-07 | 2022-04-15 | 福建省海峡信息技术有限公司 | Method for quickly detecting and processing dirty data acquired by log |
CN114548047A (en) * | 2022-04-25 | 2022-05-27 | 阿里巴巴达摩院(杭州)科技有限公司 | Data processing method and device, and text processing method and device |
-
2020
- 2020-01-07 CN CN202010013806.XA patent/CN113157911A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114356908A (en) * | 2022-01-07 | 2022-04-15 | 福建省海峡信息技术有限公司 | Method for quickly detecting and processing dirty data acquired by log |
CN114548047A (en) * | 2022-04-25 | 2022-05-27 | 阿里巴巴达摩院(杭州)科技有限公司 | Data processing method and device, and text processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107809331B (en) | Method and device for identifying abnormal flow | |
CN105808652B (en) | Method and device for realizing online customer service | |
CN112527649A (en) | Test case generation method and device | |
CN112184154A (en) | Business approval method and device | |
CN108933695B (en) | Method and apparatus for processing information | |
CN109873863B (en) | Asynchronous calling method and device of service | |
CN113361838A (en) | Business wind control method and device, electronic equipment and storage medium | |
CN111367663A (en) | Service processing method and device | |
CN112445860B (en) | Method and device for processing distributed transaction | |
CN113157911A (en) | Service verification method and device | |
CN115525411A (en) | Method, device, electronic equipment and computer readable medium for processing service request | |
CN112181307A (en) | Block chain based distributed data redundancy storage method and electronic equipment | |
CN112947919A (en) | Method and device for constructing service model and processing service request | |
CN112073395B (en) | File distribution method and device | |
CN112559646A (en) | Report downloading method and device | |
CN116204428A (en) | Test case generation method and device | |
CN113590447B (en) | Buried point processing method and device | |
CN113485902B (en) | Method, device, equipment and computer readable medium for testing service platform | |
CN115964302A (en) | Data testing method and device | |
CN114924937A (en) | Batch task processing method and device, electronic equipment and computer readable medium | |
CN115330540A (en) | Method and device for processing transaction data | |
CN112256855B (en) | User intention recognition method and device | |
CN116933189A (en) | Data detection method and device | |
CN114612212A (en) | Business processing method, device and system based on risk control | |
CN109087097B (en) | Method and device for updating same identifier of chain code |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |