Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification 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 in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can be termed a second and, similarly, a second can be termed a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context.
The application provides a detection method based on a neural network, and also provides a detection device based on the neural network, a computing device and a machine readable storage medium. The following is a detailed description of the embodiments provided in this application, and the steps of the method are described in detail below.
The embodiment of the detection method based on the neural network provided by the application is as follows:
referring to fig. 1, which shows a processing flow chart of a detection method based on a neural network provided in this embodiment, referring to fig. 2, which shows a schematic diagram of a recurrent neural network model provided in this embodiment, referring to fig. 3, which shows a schematic diagram of a neuron provided in this embodiment, referring to fig. 4, which shows a processing flow chart of a service state detection process provided in this embodiment.
Step S102, acquiring service state data associated with at least one service calling sequence in a detection period.
The detection method based on the neural network provided by the embodiment of the application detects whether the operation of the service system is normal or not in a periodic detection mode on the premise of considering the mutual influence of the system states of the service system at different moments, and specifically, the service system is periodically abstracted into the following steps in the detection process: n (N > = 1) input sequences and 1 output result, wherein the N input sequences refer to system states of a service system at different moments, the 1 output result refers to a detection result of whether the service system is normal or not after service state detection is carried out according to the N input sequences, therefore, the N inputs are fused into one model through parallel calculation to carry out service state detection, the system states of the service system at the previous moment are further fused through a recurrent neural network model, the influence of the system states of the service system at the previous moment on the current service state detection is fully considered, and more accurate service detection is realized.
In practical application, the system states of the service system at different times can be determined by function calls in the field of computers, for example, D function (a, B, C) represents a function called function, 3 parameters a, B, C are received, an operation result D is returned by internal operation, and the system state during function call can be represented by D function (a, B, C). In the actual service processing process of the service system, N functions may participate in the calculation M times within 1 minute, and the higher the function frequency participating in the calculation is, the higher the probability that the whole system is paralyzed due to an error of the function is. In order to ensure the stability of the service system, the service state detection is performed on the service system with a specific time granularity as a detection period, for example, a detection logic for performing the service state detection on the service system is triggered at a starting time point of the detection period, and the detection logic is executed in a time range after the starting time point in the detection period.
It should be noted that the detection period should be determined in combination with the actual service processing condition of the service system, and if the time granularity of the detection period is too small, the computational burden caused by the execution of the detection logic is increased, and if the time granularity of the detection period is too large, the timeliness of the service detection is reduced. For example, the service system is detected with the time granularity of minutes as a detection period, the detection logic is triggered to execute according to a minute point (for example, 18:00:05 this moment an alarm is set off.
Based on this, if there are multiple service invocations of the service system in a detection period, a corresponding service invocation sequence is generated for each service invocation, and the generated service invocation sequence is associated with all service state data related to the service invocation, specifically, the service state data preferably includes service input data related to the service invocation and service output data related to the service invocation. Therefore, the embodiment of the application inputs the service input data and the service output data related to service calling into the recurrent neural network model simultaneously, so that the input and the output of the service calling are both used as the source of the abnormal detection of the service system, and the more comprehensive service detection of the service system is realized.
In a preferred embodiment provided in this embodiment of the present application, in the process of obtaining service state data associated with at least one service invocation sequence in a detection period, if there are two or more service invocations in a detection period, service invocation sequences generated by the service invocations need to be aggregated, specifically, the service invocation sequences in each detection period are aggregated according to a preset sequence aggregation rule; if there is only one service call in one detection period, aggregation processing is not needed, or only the service call sequence generated by one service call is aggregated, which is not limited.
Preferably, the preset sequence aggregation rule in the embodiment of the present application refers to aggregating two or more service invocation sequences, where service input data related to the service invocation and service output data related to the service invocation are the same, into one service invocation sequence.
For example, the service invocation sequence of the service invoker in the detection period T1 is as follows:
service invocation sequence 1: d function (A, B, C)
Service invocation sequence 2: d function (A, B, C)
Service invocation sequence 3: e function (A, B)
Service invocation sequence 4: e function (A, B)
Service invocation sequence 5: f function (A)
According to a preset sequence aggregation rule, aggregation processing needs to be performed on the service calling sequence 1 and the service calling sequence 2, and aggregation processing needs to be performed on the service calling sequence 3 and the service calling sequence 4, wherein the service calling sequences after aggregation processing are as follows:
d function (A, B, C), the number of times of sequence calling of the service calling sequence is 2
E function (A, B), the number of times of sequence calling of the service calling sequence is 2
F function (A), the number of times of sequence calling of the service calling sequence is 1.
In addition to the preset sequence aggregation rule provided above, the preset sequence aggregation rule may also refer to aggregating two or more service invocation sequences with the same service input data related to the service invocation into one service invocation sequence; similarly, the preset sequence aggregation rule may also refer to aggregating two or more service invocation sequences with the same service output data involved in the service invocation into one service invocation sequence.
In specific implementation, for a service invocation sequence, different numbers of times of invocation of the service invocation sequence (numbers of times of sequence invocation) represent that importance of the service invocation sequence in a service system operation process may also be different, where the importance may be represented as importance of service input data and service output data related to the service invocation sequence, or as other related characteristic information capable of distinguishing different numbers of times of invocation. Therefore, according to the number of times of calling the same service calling sequence, that is, the number of times of calling the service calling sequence after the aggregation processing, service state detection of different levels or different priorities can be performed respectively for service calling sequences with different numbers of times of calling the service calling sequence.
Preferably, the service calling sequence obtained after aggregation carries the sequence calling times of the aggregated service calling sequence; based on the above, the state parameters obtained by mapping the associated service state data corresponding to the service calling sequence obtained after aggregation are given sequence weights in the process of inputting the state parameters into the recurrent neural network model for service state detection; and determining the sequence weight according to the sequence number of the aggregated service calling sequence carried by the service calling sequence obtained after aggregation.
In practical application, when performing service detection on a service system, a recurrent neural network model for performing service detection, that is, a trained recurrent neural network model, is determined first, and on the basis of the trained recurrent neural network model, N system states of the service system at different times are input into the recurrent neural network model to perform service state detection, so as to obtain a detection result of whether the service system is operating normally.
In an embodiment of the present application, the recurrent neural network model is trained in the following manner:
1) Acquiring service state data associated with a service calling sequence in a detection period contained in a historical time period; the historical time period comprises detection cycles with time continuity;
for example, referring to fig. 4, in the actual operation process of the service system, all service data generated by the service system in the past day are collected regularly every morning at a certain time, and service state data associated with a service invocation sequence in every minute (detection period) is extracted from the service data.
2) Mapping the service state calling data to corresponding state parameters respectively to obtain a training sample set;
for example, for the service state data associated with the service call sequence in each minute of the past day, the service state data associated with the service call sequence in each minute is mapped into character strings respectively, and then the character strings obtained by mapping are encoded to obtain state parameters corresponding to the service state data in each minute, wherein the state parameters corresponding to the service state data in each minute are a training sample in the training sample set.
3) And carrying out model training according to the training sample set to obtain the recurrent neural network model.
In a preferred implementation manner provided by the embodiment of the present application, the recurrent neural network model includes: the input layer comprises at least one input, the input layer and the hidden layer have one-to-one correspondence, and each input is connected with a neuron corresponding to the hidden layer.
The above process of performing model training according to the training sample set specifically refers to a process of determining a weight parameter and a threshold parameter of the recurrent neural network model through learning training, and preferably, the weight parameter of the recurrent neural network model includes the following 3 items: the first weight parameter refers to a first connection weight corresponding to the connection between the input contained in the input layer and the neuron of the corresponding hidden layer, the second weight parameter refers to a second connection weight corresponding to the connection between the neuron of the preorder detection period of each hidden layer and the neuron of the current detection period, and the third weight parameter refers to a third connection weight corresponding to the connection between the neuron of each hidden layer and the output layer; and, the recurrent neural network model further includes the following two threshold parameters: a hidden layer threshold corresponding to a hidden layer, an output threshold corresponding to an output layer.
Further, in the process of determining the weight parameter and the threshold parameter of the recurrent neural network model through the learning training, the embodiment of the application preferably adopts an adaptive moment estimation algorithm to learn the weight parameter and the threshold parameter of the recurrent neural network model. In addition, other learning algorithms (e.g., a Stochastic gradient component (SGD)) may be used to learn the weight parameters and the threshold parameters of the recurrent neural network model, which is not limited herein.
Preferably, the Recurrent neural network model in the embodiment of the present application adopts a Long Short-Term Memory (LSTM) neural network model, and in addition, the Recurrent neural network model may also adopt other neural network models besides the LSTM neural network model, such as a Gated Recurrent Unit (GUR) neural network model, which is not limited in this respect.
The following description will be made of the model architecture and the model training process of the LSTM neural network model, taking the LSTM neural network model as an example, with reference to fig. 2, fig. 3 and fig. 4:
as shown in fig. 2, the LSTM neural network model includes an input layer (including N inputs), N hidden layers, and an output layer, where, taking the current time (t, i.e., the current detection period) as an example, the N inputs included in the input layer are sequentially:
wherein the content of the first and second substances,
neurons of the hidden
layer 1
The connection is carried out by connecting the two parts,
neurons of the hidden layer 2
The connection is carried out in the same way,
neurons related to hidden layer N
Connecting; neuron and its use
Respectively connected with output layer whose output is y
t 。
Meanwhile, connections are made between hidden layers of adjacent time periods, e.g. neurons of hidden layers of preamble detection period (t-1)
The neurons of the hidden layers of the current detection period (t) are respectively compared with the neurons of the hidden layers of the current detection period (t)
And (4) connecting.
As shown in FIG. 3, input at the input layer
For example, input of the input layer
Neurons with hidden layer N
The first connection right corresponding to the connection is
Neuron of hidden layer N of preamble detection period (t-1)
Hiding the neurons of layer N from the current detection period (t)
The second connection right corresponding to the connection is
Neurons of the hidden layer N of the current detection period (t)
The third connection right corresponding to the output layer connection is
In particular, the method comprises the following steps of,
can be expressed as:
where H is an activation function, a Linear rectification function (ReLU) can be used,
it is the weight parameter (first connection weight) that needs to be learned in the model training process,
is the influence of the system state of the preamble detection period (t-1) on the system state of the current detection period (t),
it is also necessary to learn the weight parameter (second connection weight) during the model training process,
the hidden layer threshold corresponding to the hidden layer is determined in the model training process.
Final output y of output layer
t Can be expressed as:
the weight parameter (third connection weight) needs to be learned in the model training process, b
y Refers to the output threshold corresponding to the output layer, determined during the model training process.
To sum up, the model training process actually learns and determines the three weight parameters (
And
) And two threshold parameters: (
And by).
And step S104, mapping the service state data into corresponding state parameters respectively.
After the service state data associated with at least one service invocation sequence in the detection period is acquired in step S102, the acquired service state data is processed in this step so as to meet the data input requirement of the recurrent neural network model, specifically, the acquired service state data is respectively mapped to corresponding state parameters. In a preferred embodiment provided in the embodiment of the present application, mapping the obtained service status data to corresponding status parameters respectively includes:
1) Calling a mapping function to map input data related to the service call and output data related to the service call into the same character string;
for example, for the service invocation sequence 1: and D function (A, B, C), mapping the service input data A, B, C and the service output data D related to the service calling sequence 1 into a string of character strings through a mapping function f, wherein the mapping function f needs to ensure that the character strings mapped by D, A, B and C are the same.
2) And coding the character string obtained by mapping, and taking the coding result of the character string as a state parameter corresponding to the service state data.
For example, a string mapped by the service input data a, B, C and the service output data D of the service invocation sequence 1 may be used as an input of the recurrent neural network after the string is encoded by One-hot.
In addition to the preferred embodiment provided above, in the process of mapping the obtained service status data to corresponding status parameters, a mapping function may be invoked to map input data related to the service invocation into a character string, or map output data related to the service invocation into a character string, and then further encode the character string obtained by mapping, and use the encoding result of the character string as the status parameter corresponding to each service status data.
And S106, inputting the state parameters into a recurrent neural network model to carry out service state detection, and obtaining a service detection result.
Taking the state parameters mapped by the N service state data in the detection period obtained in the step S104 as N inputs of the recurrent neural network model, inputting the state parameters into the recurrent neural network model for service state detection, and if the output service detection result indicates that a service system is abnormal, sending an alarm; and if the output service detection result is normal, continuing to execute the service state detection in the next detection period.
An example is provided below to further illustrate the traffic status monitoring process:
the detection system performs the service state detection on the service system with the time granularity of minutes as a detection period, and triggers the service state detection when the time reaches the first second of every minute (xx: xx: 00), and the following service state detection logic is executed after the service state detection is triggered, which is described in detail below with reference to fig. 4.
(1) Acquiring all service calling sequences contained in the current 1 minute, specifically comprising:
service invocation sequence 1: d function (A, B, C)
Service invocation sequence 2: d function (A, B, C)
Service invocation sequence 3: e function (A, B)
Service invocation sequence 4: e function (A, B)
Service invocation sequence 5: f function (A)
(2) Two or more than two service calling sequences with the same service input data and service output data related to service calling are aggregated into one service calling sequence, and the service calling sequences after aggregation processing are as follows:
d function (A, B, C), the number of times of sequence calling of the service calling sequence is 2
E function (A, B), the number of times of sequence calling of the service calling sequence is 2
And F function (A), wherein the sequence calling times of the service calling sequence is 1.
(3) Then calling a mapping function f to map the aggregated 3 service calling sequences into respective corresponding character strings respectively;
mapping service input data A, B and C and service output data D related to a service calling sequence D function (A, B and C) into a string1; similarly, the service input data a and B and the service output data E related to the service invocation sequence E function (a, B) are mapped into a string as string2, and the service input data a and the service output data F related to the service invocation sequence F function (a) are mapped into a string as string3.
(4) Coding the string1, string2 and string3 obtained by mapping through One-hot coding, thereby obtaining state parameters x1, x2 and x3 corresponding to the string1, string2 and string3 respectively;
(5) Inputting the state parameters x1, x2 and x3 into the trained recurrent neural network model for calculation, outputting a service detection result, and if the output service detection result indicates that the service system is abnormal, sending an alarm; and if the output service detection result is normal, continuing to execute the service state detection logic for the next minute.
In summary, the detection method based on the neural network provided by the application performs service state detection in a periodic manner, and fuses system states at different moments as input to the recurrent neural network model for service state detection in the detection process, and further fuses the system states at the preceding moments based on the recurrent neural network model, so that the mutual influence of the system states at different moments is fully considered, more timely service state detection is realized, and the detection accuracy is higher.
The embodiment of the detection device based on the neural network provided by the application is as follows:
in the foregoing embodiment, a detection method based on a neural network is provided, and correspondingly, the present application also provides a detection apparatus based on a neural network, which is described below with reference to the accompanying drawings.
Referring to fig. 5, a schematic diagram of an embodiment of a neural network-based detection apparatus provided in the present application is shown.
Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to the corresponding description of the method embodiments provided above for relevant portions. The device embodiments described below are merely illustrative.
The application provides a detection device based on neural network, includes:
a service state data obtaining module 502 configured to obtain service state data associated with at least one service invocation sequence in a detection period;
a state parameter mapping module 504 configured to map the service state data into corresponding state parameters, respectively;
and a service state detection module 506 configured to input the state parameter into a recurrent neural network model for service state detection, so as to obtain a service detection result.
Optionally, the recurrent neural network model is trained in the following manner:
acquiring service state data associated with a service calling sequence in a detection period contained in a historical time period; the historical time period comprises detection cycles with time continuity;
mapping the service state calling data into corresponding state parameters respectively to obtain a training sample set; a state parameter corresponding to the service state data associated with the service calling sequence in each detection period is a training sample in the training sample set;
and carrying out model training according to the training sample set to obtain the recurrent neural network model.
Optionally, the recurrent neural network model includes:
an input layer comprising at least one input, an output layer, and at least one hidden layer;
the input layer comprises inputs which are in one-to-one correspondence with the hidden layers, and the inputs are respectively connected with the neurons of the corresponding hidden layers.
Optionally, the performing model training according to the training sample set includes:
training a weight parameter and/or a threshold parameter of the recurrent neural network model;
wherein the weight parameters of the recurrent neural network model include:
the input layer comprises a first connection right corresponding to the connection of the input and the neuron of the corresponding hidden layer, a second connection right corresponding to the connection of the neuron of the preorder detection period of each hidden layer and the neuron of the detection period, and a third connection right corresponding to the connection of the neuron of each hidden layer and the output layer;
the threshold parameters include: a hidden layer threshold corresponding to a hidden layer, an output threshold corresponding to an output layer.
Optionally, the service state data associated with the service invocation sequence includes at least one of the following: service input data related to the service invocation, and service output data related to the service invocation.
Optionally, the service state data obtaining module 502 is specifically configured to, when a condition that the number of service call sequences included in the detection period is greater than or equal to 2 is met, aggregate the service call sequences in the detection period according to a preset sequence aggregation rule.
Optionally, the preset sequence aggregation rule includes at least one of:
and aggregating at least two service calling sequences with the same service input data related to the service calling and/or the same service output data related to the service calling into one service calling sequence.
Optionally, the service call sequence obtained after aggregation carries the sequence call times of the aggregated service call sequence;
the state parameters obtained by mapping the associated service state data corresponding to the service calling sequences obtained after aggregation are endowed with sequence weights in the process of inputting the state parameters into the recurrent neural network model for service state detection;
and determining the sequence weight according to the sequence calling times of the aggregated service calling sequence carried by the service calling sequence obtained after aggregation.
Optionally, the state parameter mapping module 504 includes:
the mapping submodule is configured to call a mapping function to map input data related to the service call and output data related to the service call into the same character string;
and the encoding submodule is configured to encode the character string obtained by mapping, and take an encoding result of the character string as a state parameter corresponding to the service state data.
Optionally, the state parameter mapping module 504 includes:
a second mapping submodule configured to call a mapping function to map input data related to the service call into a character string, or to map output data related to the service call into a character string;
and the second encoding submodule is configured to encode the character string obtained through mapping, and the encoding result of the character string is used as the state parameter corresponding to each service state data.
Optionally, the model training is trained by using at least one learning algorithm as follows: an adaptive moment estimation algorithm and a random gradient descent algorithm.
Optionally, the recurrent neural network model includes: a long-short term memory neural network model and a gated cyclic unit neural network model.
The embodiment of the computing device provided by the application is as follows:
fig. 6 is a block diagram illustrating a structure of a computing device 600 according to an embodiment of the present description. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is coupled to the memory 610 via a bus 630 and a database 650 is used to store data.
Computing device 600 also includes access device 640, access device 640 enabling computing device 600 to communicate via one or more networks 660. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 640 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the other components of computing device 600 described above and not shown in FIG. 6 may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 6 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 600 may also be a mobile or stationary server.
The present application provides a computing device comprising a memory 610, a processor 620, and computer instructions stored on the memory and executable on the processor, the processor 610 being configured to execute the following computer-executable instructions:
acquiring service state data associated with at least one service calling sequence in a detection period;
mapping the service state data into corresponding state parameters respectively;
and inputting the state parameters into a recurrent neural network model to carry out service state detection, and obtaining a service detection result.
Optionally, the recurrent neural network model is trained in the following manner:
acquiring service state data associated with a service calling sequence in a detection period contained in a historical time period; the historical time period comprises detection cycles with time continuity;
mapping the service state calling data to corresponding state parameters respectively to obtain a training sample set; a state parameter corresponding to the service state data associated with the service calling sequence in each detection period is a training sample in the training sample set;
and carrying out model training according to the training sample set to obtain the recurrent neural network model.
Optionally, the recurrent neural network model includes:
an input layer comprising at least one input, an output layer, and at least one hidden layer;
the input layer comprises inputs which are in one-to-one correspondence with the hidden layers, and the inputs are respectively connected with the neurons of the corresponding hidden layers.
Optionally, the performing model training according to the training sample set includes:
training a weight parameter and/or a threshold parameter of the recurrent neural network model;
wherein the weight parameters of the recurrent neural network model include:
the input layer comprises a first connection right corresponding to the connection of the neuron of the corresponding hidden layer, a second connection right corresponding to the connection of the neuron of the preorder detection period of each hidden layer and the neuron of the detection period, and a third connection right corresponding to the connection of the neuron of each hidden layer and the output layer;
the threshold parameters include: a hidden layer threshold corresponding to a hidden layer, an output threshold corresponding to an output layer.
Optionally, the service state data associated with the service invocation sequence includes at least one of the following: service input data related to the service invocation, service output data related to the service invocation.
Optionally, the obtaining service state data associated with at least one service invocation sequence in the detection period includes:
and if the number of the service calling sequences contained in the detection period is more than or equal to 2, aggregating the service calling sequences in the detection period according to a preset sequence aggregation rule.
Optionally, the preset sequence aggregation rule includes at least one of:
and aggregating at least two service calling sequences with the same service input data and/or service output data related to the service calling into one service calling sequence.
Optionally, the service call sequence obtained after aggregation carries the sequence call times of the aggregated service call sequence;
the state parameters obtained by mapping the associated service state data corresponding to the service calling sequences obtained after aggregation are endowed with sequence weights in the process of inputting the state parameters into the recurrent neural network model for service state detection;
and determining the sequence weight according to the sequence calling times of the aggregated service calling sequence carried by the service calling sequence obtained after aggregation.
Optionally, the mapping the service status data to corresponding status parameters respectively includes:
calling a mapping function to map input data related to the service call and output data related to the service call into the same character string;
and coding the character string obtained by mapping, and taking the coding result of the character string as a state parameter corresponding to the service state data.
Optionally, the mapping the service status data to corresponding status parameters respectively includes:
calling a mapping function to map input data related to the service call into a character string, or mapping output data related to the service call into a character string;
and coding the character string obtained by mapping, and taking the coding result of the character string as the state parameter corresponding to the service state data.
Optionally, the model training is trained by using at least one learning algorithm as follows: an adaptive moment estimation algorithm and a random gradient descent algorithm.
Optionally, the recurrent neural network model includes: a long-short term memory neural network model and a gated cyclic unit neural network model.
An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which when executed by a processor implement the following:
acquiring service state data associated with at least one service calling sequence in a detection period;
mapping the service state data into corresponding state parameters respectively;
and inputting the state parameters into a recurrent neural network model to carry out service state detection, and obtaining a service detection result.
Optionally, the recurrent neural network model is trained in the following manner:
acquiring service state data associated with a service calling sequence in a detection period contained in a historical time period; the historical time period comprises detection cycles with time continuity;
mapping the service state calling data into corresponding state parameters respectively to obtain a training sample set; a state parameter corresponding to the service state data associated with the service calling sequence in each detection period is a training sample in the training sample set;
and carrying out model training according to the training sample set to obtain the recurrent neural network model.
Optionally, the recurrent neural network model includes:
an input layer comprising at least one input, an output layer, and at least one hidden layer;
the input layer comprises inputs which are in one-to-one correspondence with the hidden layers, and the inputs are respectively connected with the neurons of the corresponding hidden layers.
Optionally, the performing model training according to the training sample set includes:
training a weight parameter and/or a threshold parameter of the recurrent neural network model;
wherein the weight parameters of the recurrent neural network model include:
the input layer comprises a first connection right corresponding to the connection of the neuron of the corresponding hidden layer, a second connection right corresponding to the connection of the neuron of the preorder detection period of each hidden layer and the neuron of the detection period, and a third connection right corresponding to the connection of the neuron of each hidden layer and the output layer;
the threshold parameters include:
hidden layer threshold corresponding to the hidden layer, output threshold corresponding to the output layer.
Optionally, the service state data associated with the service invocation sequence includes at least one of the following: service input data related to the service invocation, and service output data related to the service invocation.
Optionally, the obtaining service state data associated with at least one service invocation sequence in the detection period includes:
and if the number of the service calling sequences contained in the detection period is more than or equal to 2, aggregating the service calling sequences in the detection period according to a preset sequence aggregation rule.
Optionally, the preset sequence aggregation rule includes at least one of:
and aggregating at least two service calling sequences with the same service input data related to the service calling and/or the same service output data related to the service calling into one service calling sequence.
Optionally, the service call sequence obtained after aggregation carries the sequence call times of the aggregated service call sequence;
state parameters obtained by mapping the associated service state data corresponding to the service calling sequences obtained after aggregation are endowed with sequence weights in the process of inputting the state parameters into the recurrent neural network model for service state detection;
and determining the sequence weight according to the sequence calling times of the aggregated service calling sequence carried by the service calling sequence obtained after aggregation.
Optionally, the mapping the service status data to corresponding status parameters respectively includes:
calling a mapping function to map input data related to the service call and output data related to the service call into the same character string;
and coding the character string obtained by mapping, and taking the coding result of the character string as a state parameter corresponding to the service state data.
Optionally, the mapping the service status data to corresponding status parameters respectively includes:
calling a mapping function to map input data related to the service call into a character string, or mapping output data related to the service call into a character string;
and coding the character string obtained by mapping, and taking the coding result of the character string as the state parameter corresponding to the service state data.
Optionally, the model training is trained by using at least one learning algorithm: an adaptive moment estimation algorithm and a random gradient descent algorithm.
Optionally, the recurrent neural network model includes: a long-short term memory neural network model and a gated cyclic unit neural network model.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the neural network-based detection method, and for details that are not described in detail in the technical solution of the storage medium, reference may be made to the description of the technical solution of the neural network-based detection method.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U.S. disk, removable hard disk, magnetic diskette, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signal, telecommunications signal, and software distribution medium, etc. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that for simplicity and convenience of description, the above-described method embodiments are described as a series of combinations of acts, but those skilled in the art will appreciate that the present application is not limited by the order of acts, as some steps may, in accordance with the present application, occur in other orders and/or concurrently. Further, those skilled in the art will appreciate that the embodiments described in this specification are presently considered to be preferred embodiments and that acts and modules are not required in the present application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.