deepanshuk | 297dbd6 | 2020-11-03 13:09:19 +0530 | [diff] [blame] | 1 | # ================================================================================== |
| 2 | # Copyright (c) 2020 HCL Technologies Limited. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # ================================================================================== |
| 16 | |
| 17 | Usage of all the programs and files have been mentioned below for the reference. |
deepanshuk | 91624d7 | 2021-07-06 13:07:04 +0530 | [diff] [blame^] | 18 | For AD xapp we require ueMeasReport(UE related dataset) |
| 19 | |
| 20 | AD xApp expect UE data from influxDB database in following structure: |
| 21 | * There exists database with name "UEData" |
| 22 | * Inside "UEData" database we have three measurments namely "liveUE", "train", "valid" |
| 23 | |
| 24 | Note: *We need to specify influxdb service ruuning in RIC platform in database.py(host = <service name>.<namespace>) |
| 25 | *InfluxDB will be populated when xApp starts via insert.py. This will be depreciated in next release when there will be data coming from KPIMON |
| 26 | |
deepanshuk | 297dbd6 | 2020-11-03 13:09:19 +0530 | [diff] [blame] | 27 | Need to update this file each time when there is any modifications in the following components. |
| 28 | |
| 29 | main.py: |
deepanshuk | 91624d7 | 2021-07-06 13:07:04 +0530 | [diff] [blame^] | 30 | * Initiates xapp api, populated influxDB with data and runs the entry() using xapp.run() |
| 31 | * If Model is not present in the current path, run train() to train the model for the prediction. |
| 32 | * Call predict function to perform the following activities for every 10 milisecond. |
| 33 | a) Currently read the input from "liveUE" measurments and iterate through it. (Needs to update: To iterate every 10 miliseconds and fetch latest sample from influxDB) |
| 34 | b) Detect anomalous records for the inputs |
| 35 | c) send the UEID, DU-ID, Degradation type and timestamp for the anomalous records to the Traffic Steering (via rmr with the message type as 30003) |
| 36 | d) Get the acknowledgement message from the traffic steering |
deepanshuk | 297dbd6 | 2020-11-03 13:09:19 +0530 | [diff] [blame] | 37 | |
deepanshuk | 91624d7 | 2021-07-06 13:07:04 +0530 | [diff] [blame^] | 38 | Note: Need to implement the logic if we do not get the acknowledgment from the TS. (How xapp api handle this?) |
deepanshuk | 588acf1 | 2021-01-06 16:10:44 +0530 | [diff] [blame] | 39 | |
deepanshuk | 91624d7 | 2021-07-06 13:07:04 +0530 | [diff] [blame^] | 40 | ad_train.py - Fetch "train" and "valid"(labelled dataset) measurments from influxDB for build and testing Isolation Forest model. Save final model. |
| 41 | |
| 42 | Model: Model has been trained using history data feteched from influxdb for all UE's |
| 43 | validation: we need to have smaller sample dataset(labelled) for validation in influxDB for model validation. |
deepanshuk | 297dbd6 | 2020-11-03 13:09:19 +0530 | [diff] [blame] | 44 | |
| 45 | processing.py: |
| 46 | It performs the following activities: |
| 47 | * Columns that are not useful for the prediction will be dropped(UEID, Category, & Timestamp) |
deepanshuk | 91624d7 | 2021-07-06 13:07:04 +0530 | [diff] [blame^] | 48 | * Filetered numeric data type(as per problem need) |
| 49 | * verify and drop the highly correlated parameters |
| 50 | * Use Transformation for makine all parameters in same scale and saved transformer info. |
| 51 | * returns remaining parameters required for training and testing |
deepanshuk | 297dbd6 | 2020-11-03 13:09:19 +0530 | [diff] [blame] | 52 | |
deepanshuk | 588acf1 | 2021-01-06 16:10:44 +0530 | [diff] [blame] | 53 | |
deepanshuk | 297dbd6 | 2020-11-03 13:09:19 +0530 | [diff] [blame] | 54 | ad_model.py: |
deepanshuk | 91624d7 | 2021-07-06 13:07:04 +0530 | [diff] [blame^] | 55 | * Call Predict method to get the anomalous users and send information related to anomalous user to Traffic steering xapp |
deepanshuk | 297dbd6 | 2020-11-03 13:09:19 +0530 | [diff] [blame] | 56 | |
deepanshuk | 91624d7 | 2021-07-06 13:07:04 +0530 | [diff] [blame^] | 57 | database.py |
| 58 | * This module creates connection to influxDB and have methods to read and write data into influxDB |
deepanshuk | 588acf1 | 2021-01-06 16:10:44 +0530 | [diff] [blame] | 59 | |
deepanshuk | 297dbd6 | 2020-11-03 13:09:19 +0530 | [diff] [blame] | 60 | |