From 3176e89236fac6c921721febae5d75c32c30f408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Fri, 1 Mar 2024 07:32:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=B0=D0=BB?= =?UTF-8?q?=D0=B3=D0=BE=D1=80=D0=B8=D1=82=D0=BC=20=D1=83=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=D0=B6=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=BA=D0=BB=D0=B8?= =?UTF-8?q?=D0=BD=D1=8C=D1=8F=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetectedOperation/DetectedOperationDto.cs | 8 ++- .../DetectOperations/DetectableTelemetry.cs | 3 +- .../DetectedOperationExportService.cs | 11 ++-- .../Detectors/DetectorAbstract.cs | 26 +++----- .../Detectors/DetectorSlipsTime.cs | 59 +++++++++++++++---- .../Specifications/Удержание в клиньях.md | 27 ++++++--- 6 files changed, 88 insertions(+), 46 deletions(-) diff --git a/AsbCloudApp/Data/DetectedOperation/DetectedOperationDto.cs b/AsbCloudApp/Data/DetectedOperation/DetectedOperationDto.cs index e81a45fb..ce433aff 100644 --- a/AsbCloudApp/Data/DetectedOperation/DetectedOperationDto.cs +++ b/AsbCloudApp/Data/DetectedOperation/DetectedOperationDto.cs @@ -77,7 +77,13 @@ public class DetectedOperationDto: IId /// [Required] public WellOperationCategoryDto OperationCategory { get; set; } = null!; - + + /// + /// Положение долота на момент окончания операции + /// + [Required] + public float BitDepth { get; set; } + /// /// Ключевой параметр операции /// diff --git a/AsbCloudInfrastructure/Services/DetectOperations/DetectableTelemetry.cs b/AsbCloudInfrastructure/Services/DetectOperations/DetectableTelemetry.cs index 9c72c4e8..aeb18fe2 100644 --- a/AsbCloudInfrastructure/Services/DetectOperations/DetectableTelemetry.cs +++ b/AsbCloudInfrastructure/Services/DetectOperations/DetectableTelemetry.cs @@ -13,4 +13,5 @@ public class DetectableTelemetry public float BlockPosition { get; set; } public float BitDepth { get; set; } public float RotorSpeed { get; set; } -} + public float AxialLoad { get; set; } +} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationExportService.cs b/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationExportService.cs index 3ba4350a..fd33c32a 100644 --- a/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationExportService.cs +++ b/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationExportService.cs @@ -118,13 +118,14 @@ public class DetectedOperationExportService for (int i = 0; i < operations.Count; i++) { var current = operations[i]; - var dateStart = current.DateStart.ToRemoteDateTime(well.Timezone.Hours); - var dateEnd = current.DateEnd.ToRemoteDateTime(well.Timezone.Hours); + var dateStart = current.DateStart.DateTime; + var dateEnd = current.DateEnd.DateTime; var row = sheet.Row(5 + i + headerRowsCount); var categoryName = GetCategoryName(wellOperationCategories, current); + row.Cell(columnDateStart).SetCellValue(dateStart); row.Cell(columnOperationName).SetCellValue(categoryName); row.Cell(columnDateEnd).SetCellValue(dateEnd); row.Cell(columnDuration).SetCellValue((dateEnd - dateStart).TotalMinutes); @@ -143,9 +144,7 @@ public class DetectedOperationExportService query.Add("end", dateStart.AddSeconds(1800 * 0.9).ToString("yyyy-MM-ddTHH:mm:ss.fff")); query.Add("range", "1800"); - row.Cell(columnDateStart).SetCellValue(dateStart); - - var link = $"{host}/well/{well.Id}/telemetry/monitoring{query}"; + var link = $"{host}/well/{well.Id}/telemetry/monitoring{query}"; row.Cell(columnDateStart).SetHyperlink(link); var deltaDepth = i > 0 && i + 1 < operations.Count @@ -180,6 +179,8 @@ public class DetectedOperationExportService 1 => "Не определено начало операции", 101 => "Разница глубин забоя и положением долота", 300 => "Низкое давление", + 301 => "Высокое давление", + 700 => "Изменение глубины долота и осевая нагрузка < веса на крюке", _ => idReasonOfEnd.ToString($"Причина № {idReasonOfEnd}"), }; diff --git a/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorAbstract.cs b/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorAbstract.cs index 6c5b99de..ec05be39 100644 --- a/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorAbstract.cs +++ b/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorAbstract.cs @@ -1,5 +1,4 @@ -using AsbCloudDb.Model; -using System; +using System; using System.Collections.Generic; using AsbCloudApp.Data.DetectedOperation; @@ -7,8 +6,6 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors { public abstract class DetectorAbstract { - private readonly int stepLength = 3; - protected const int IdReasonOfEnd_NotDetected = 0; protected const int IdReasonOfEnd_NotDetectBegin = 1; @@ -33,7 +30,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors protected const int IdReasonOfEnd_Drilling = 600; - protected const int IdReasonOfEnd_Custom1 = 10_000; + protected const int IdReasonOfEnd_ChangeBithDepthAndAxiloadLessHookWeight = 700; public bool TryDetect(int idTelemetry, DetectableTelemetry[] telemetry, int begin, int end, DetectedOperationDto? previousOperation, out OperationDetectorResult? result) @@ -44,9 +41,10 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors // Поиск окончания соответствия критерию int idReasonOfEnd = 0; var positionEnd = begin; + while (positionEnd < end) { - positionEnd += stepLength; + positionEnd += 1; if (positionEnd > end) break; @@ -55,15 +53,9 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors if (idReasonOfEnd != IdReasonOfEnd_NotDetected) break; } - + var (Begin, End) = RefineEdges(telemetry, begin, positionEnd); - - if (!IsValidTelemetryRange(telemetry, Begin, End)) - { - result = null; - return false; - } - + result = MakeOperationDetectorResult(idTelemetry, telemetry, Begin, End, idReasonOfEnd); return IsValidOperationDetectorResult(result); @@ -72,10 +64,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors result = null; return false; } - - protected virtual bool IsValidTelemetryRange(DetectableTelemetry[] telemetry, int begin, int end) - => end - begin > 1; - + protected virtual (int Begin, int End) RefineEdges(DetectableTelemetry[] telemetry, int begin, int end) => (begin, end); @@ -125,6 +114,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors DepthStart = (double)pBegin.WellDepth, DepthEnd = (double)pEnd.WellDepth, ExtraData = ExtraData, + BitDepth = pEnd.BitDepth, Value = CalcValue(telemetry, begin, end), EnabledSubsystems = DetectEnabledSubsystems(telemetry, begin, end, ExtraData) }; diff --git a/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorSlipsTime.cs b/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorSlipsTime.cs index 9388918d..4d06365a 100644 --- a/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorSlipsTime.cs +++ b/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorSlipsTime.cs @@ -12,29 +12,64 @@ public class DetectorSlipsTime : DetectorAbstract protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperationDto? previousOperation) { - var point0 = telemetry[position]; - var delta = point0.WellDepth - point0.BitDepth; - if (delta > 2.5d) + var currentPoint = telemetry[position]; + var delta = Math.Abs(currentPoint.WellDepth - currentPoint.BitDepth); + + if (delta < 0.1d) return false; - if (point0.Pressure > 15) + if (currentPoint.Pressure > 20) return false; - if (point0.BlockPosition > 8) + var nextIndexPoint = telemetry.Length <= position ? position : position + 1; + + var nextPoint = telemetry[nextIndexPoint]; + var deltaBitDepth = Math.Abs(currentPoint.BitDepth - nextPoint.BitDepth); + var deltaBlockPosition = Math.Abs(currentPoint.BlockPosition - nextPoint.BlockPosition); + + if (deltaBitDepth > 0.001d) return false; - if (point0.HookWeight > 20) + if (deltaBlockPosition < 0.001d) return false; return true; } - protected override (int IdCategory, IDictionary ExtraData) GetSpecificInformation(DetectableTelemetry[] telemetry, int begin, int end) - { + protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperationDto? previousOperation) + { + var currentPoint = telemetry[position]; + + if (currentPoint.Pressure > 20) + return IdReasonOfEnd_PressureIsHi; + + var prevPointIndex = position <= 0 ? 0 : position - 1; + + var prevPoint = telemetry[prevPointIndex]; + + var deltaBitDepth = Math.Abs(currentPoint.BitDepth - prevPoint.BitDepth); + + if (deltaBitDepth > 0.001d && currentPoint.AxialLoad < currentPoint.HookWeight) + return IdReasonOfEnd_ChangeBithDepthAndAxiloadLessHookWeight; + + return IdReasonOfEnd_NotDetected; + } + + protected override (int IdCategory, IDictionary ExtraData) GetSpecificInformation(DetectableTelemetry[] telemetry, + int begin, + int end) + { return (WellOperationCategory.IdSlipsTime, new Dictionary()); - } + } - protected override bool IsValidOperationDetectorResult(OperationDetectorResult operationDetectorResult) => - Math.Abs(operationDetectorResult.Operation.DepthStart - operationDetectorResult.Operation.DepthEnd) > 0.01; -} + protected override bool IsValidOperationDetectorResult(OperationDetectorResult operationDetectorResult) + { + if (Math.Abs((operationDetectorResult.Operation.DateStart - operationDetectorResult.Operation.DateEnd).TotalMinutes) > 30) + return false; + if (operationDetectorResult.Operation.BitDepth <= 150d) + return false; + + return true; + } +} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/DetectOperations/Specifications/Удержание в клиньях.md b/AsbCloudInfrastructure/Services/DetectOperations/Specifications/Удержание в клиньях.md index fee75476..eda6b993 100644 --- a/AsbCloudInfrastructure/Services/DetectOperations/Specifications/Удержание в клиньях.md +++ b/AsbCloudInfrastructure/Services/DetectOperations/Specifications/Удержание в клиньях.md @@ -3,19 +3,28 @@ Наращивание бурильного инструмента – операция, во время которой после добуривания очередной трубы/ свечи циркуляция выключается, инструмент разгружается в клиньях (остается только вес крюкоблока и ВСП), происходит развинчивание трубы от верхнего силового привода, берется очередная труба/ свеча, свинчивается с инструментом в клиньях, свинчивается с верхним силовым приводом, происходит подъем инструмента, вес на крюке увеличивается. Далее включается циркуляция и происходит механическое бурение. - Наращивается определяется как время между: -- разгрузкой инструмента на клинья (остается только вес крюкоблока и ВСП). При этом давление менее 15 атм. В случае давления более 15 атм считать началом операции как снижение давления менее 15 атм и началом движения талевого блока вверх. -- снятие инструмента с клиньев (вес увеличивается более, чем на 1т). При этом движение талевого блока происходит вверх. +Наращивание определяется как время между: +- началом разгрузки инструмента на клинья (остается только вес крюкоблока и ВСП). При этом расстояние от долота до забоя в диапазоне от 0.1 до 3м., давление менее 20 атм. В случае Если происходит движение блока без изменения глубины долота—-> идем назад и ищем падение давления ниже 20атм. +- снятие инструмента с клиньев (вес увеличивается более, чем на 1т). При этом движение талевого блока происходит вверх ИЛИ увеличение давления больше 20 атм. + ## Метод определения Признак начала операции = - ( расстояние от долота до забоя < 2.5м ) И - ( положение талевого блока < 8 ) И - ( вес на крюке < 20 тонн ) И - ( давление < 15 атм ); + ( Расстояние от долота до забоя > 0.1 м) И + ( давление < 20атм) И + ( движение блока без изменения глубины долота) И + ( глубина долота > 150 м); + + Признак окончания операции = + ( давление > 20атм) ИЛИ + ( время продолжительности > 30 мин) ИЛИ + ( глубина долота < 150 м) ИЛИ + ( изменение глубины долота) И + ( осевая нагрузка < веса на крюке); - Признак окончания операции = НЕ выполняется признак начала операции; ## Ключевой параметр -Продолжительность операции. \ No newline at end of file +Продолжительность операции. + +Предел времени операции 30 минут, всё что больше 30 минут это уже не наращивание - а НПВ. \ No newline at end of file