Case 32: Workshop energy overuse alert
This case corresponds to scenario 32 of JQuick-Java USE-CASES (requirement 37: workshop energy anomaly detection and overuse alerting), in the manufacturing energy-management domain. The decision aggregates multiple per-shift signals — electricity consumption, water consumption, maximum demand, unit consumption, and temperature — and outputs a four-level alert of CRITICAL/WARNING/INFO/NORMAL together with handling hints.
Industry scenario
Section titled “Industry scenario”A manufacturer’s energy management system collects energy and operating-condition data by workshop and shift. The input model WorkshopEnergyRecord carries the workshop ID and name, shift (DAY / MIDDLE / NIGHT), current-shift total electricity and the historical baseline for the same period, current-shift output and the standard electricity per unit of product, water usage and its baseline, maximum demand and the contracted demand, whether the workshop is temperature-controlled plus the measured temperature, and whether gas pressure is normal, whether energy meters are online, and the production line running/stopped status.
The rule side owns only objective criteria: the year-over-year/over-contract ratios for electricity, water, and demand are expressed as integer percentages; the unit-consumption rating compares actual total electricity against “output × standard unit consumption” by cross-multiplication, rating WASTE above 20% over standard, ATTENTION above 5%, otherwise NORMAL; for temperature-controlled workshops, a temperature outside the 18-26°C process band is abnormal. The orchestration side aggregates the signals by patrol logic: an offline meter short-circuits directly to CRITICAL; a stopped line still drawing more than 10% of baseline electricity indicates idling equipment or power leakage; electricity deviation at 30%/15%, demand over contract at 10%, and water deviation at 100%/50% escalate to critical or warning respectively; a running line rated WASTE with zero output triggers a critical “energy completely wasted” alarm; abnormal gas pressure and out-of-band controlled temperature each add one warning signal.
The decision result is carried by WorkshopEnergyAlert: the four-level alert level, electricity deviation rate, demand over-contract rate, water deviation rate, unit-consumption rating, and the signals list of abnormal signals — each signal is dispatch-ready handling text (inspect high-consumption equipment, shift peak load, patrol lines for leaks, check the air-conditioning system, etc.). Signals only raise the level, never lower it; the final level is the highest among all hit signals.
Business pain points
Section titled “Business pain points”- Alert thresholds vary with equipment, contracts, and seasons: the critical year-over-year electricity line, contracted demand values, and the controlled-temperature process band differ by workshop and energy-supply contract; hardcoding them in the acquisition program means coordinating an IT release for every adjustment.
- Multiple energy-media signals are independent yet need unified grading: electricity, water, demand, temperature, and gas belong to different metering loops, with thresholds scattered across subsystems — a decision layer that aggregates them into a single alert level is missing.
- Special operating-condition short-circuits are complex: meter offline, stopped line idling, energy use with zero output — these scenarios must unconditionally escalate, and ordinary scoring branches can hardly guarantee such signals are not diluted by low scores.
- Alert results are hard to audit and dispatch: a level without reasons forces the operations crew to go back and review curves; the level, hit reasons, and handling suggestions must be output together.
- Legacy energy management systems are stuck on JDK 8: plant servers and IT-innovation environments can hardly deploy heavyweight IoT rule platforms; an embeddable, extra-process-free lightweight solution is needed.
Solution architecture
Section titled “Solution architecture”This case uses the standard JQuick-Java six-piece set: input model, decision result model, Rules interface, XML rule script, Service orchestration, and JUnit tests. All code is verified on Oracle JDK 1.8.
| Layer | Responsibility | Files |
|---|---|---|
| Domain model | Carries shift energy/condition attributes and the multi-signal alert decision | WorkshopEnergyRecord.java, WorkshopEnergyAlert.java |
| Rule layer | Electricity/water/demand deviation rates, unit-consumption rating via cross-multiplication, controlled-temperature band check; thresholds externalized | WorkshopEnergyRules.java, workshop-energy.xml |
| Orchestration layer | Meter-offline short-circuit, level-only-up signal aggregation, signal text assembly | WorkshopEnergyAlertService.java |
| Tests | 6 real-world shift energy profiles | WorkshopEnergyAlertServiceTest.java |
Rule method breakdown
Section titled “Rule method breakdown”| Rule method | Criteria | Score/output |
|---|---|---|
powerDeviationPercent |
(current electricity - baseline) × 100 / baseline; percentage carried by integer division | Deviation rate (%, integer) |
efficiencyLevel |
Standard total = output × standard unit electricity; actual ×100 greater than standard ×120 → WASTE, greater than standard ×105 → ATTENTION, otherwise NORMAL | WASTE/ATTENTION/NORMAL |
demandExcessPercent |
(max demand - contracted demand) × 100 / contracted demand | Over-contract rate (%, integer, may be negative) |
waterDeviationPercent |
(current water - baseline) × 100 / baseline | Deviation rate (%, integer) |
temperatureAbnormal |
Checked only for temperature-controlled workshops: true when temperature is below 18°C or above 26°C; always false for non-controlled workshops | boolean |
Code implementation (complete & runnable)
Section titled “Code implementation (complete & runnable)”Place the two model classes under src/test/java/com/github/paohaijiao/demo/model/, the rules interface under demo/, the Service under demo/service/, the XML script under src/test/resources/demo/, and the test class under demo/, keeping the package names exactly as in the source. Run mvn test -Dtest=WorkshopEnergyAlertServiceTest from the project root to reproduce all 6 cases.
WorkshopEnergyRecord.java
Section titled “WorkshopEnergyRecord.java”package com.github.paohaijiao.demo.model;
import lombok.AllArgsConstructor;import lombok.Data;import lombok.NoArgsConstructor;
/** * 车间班次能耗与工况要素 */@Data@NoArgsConstructor@AllArgsConstructorpublic class WorkshopEnergyRecord {
/** * 车间编号 */ private String workshopId;
/** * 车间名称 */ private String workshopName;
/** * 班次:DAY 白班 / MIDDLE 中班 / NIGHT 夜班 */ private String shift;
/** * 本班总用电(kWh) */ private int totalKwh;
/** * 历史同期基准用电(kWh) */ private int baselineKwh;
/** * 本班产量 */ private int outputQty;
/** * 单位产品标准电耗(kWh/件) */ private int standardKwhPerUnit;
/** * 本班用水量(吨) */ private int waterUsageTon;
/** * 用水基准(吨) */ private int waterBaselineTon;
/** * 本班最大需量(kW) */ private int maxDemandKw;
/** * 合同约定需量(kW) */ private int demandContractKw;
/** * 是否恒温车间 */ private boolean tempControlled;
/** * 车间温度(℃) */ private int temperature;
/** * 燃气压力是否正常 */ private boolean gasPressureOk;
/** * 能耗计量表是否在线 */ private boolean meterOnline;
/** * 产线状态:RUNNING 运行 / STOPPED 停线 */ private String productionLineStatus;}WorkshopEnergyAlert.java
Section titled “WorkshopEnergyAlert.java”package com.github.paohaijiao.demo.model;
import lombok.Data;
import java.util.ArrayList;import java.util.List;
/** * 车间能耗预警决策 */@Datapublic class WorkshopEnergyAlert {
/** * 车间编号 */ private String workshopId;
/** * 告警级别:CRITICAL 紧急 / WARNING 预警 / INFO 提示 / NORMAL 正常 */ private String alertLevel;
/** * 用电同比偏离率(整数百分比) */ private int powerDeviationPercent;
/** * 最大需量超合同率(整数百分比) */ private int demandExcessPercent;
/** * 用水同比偏离率(整数百分比) */ private int waterDeviationPercent;
/** * 单耗评级:WASTE 浪费 / ATTENTION 关注 / NORMAL 正常 */ private String efficiencyLevel;
/** * 异常信号与处置提示 */ private List<String> signals = new ArrayList<String>();
public void addSignal(String signal) { this.signals.add(signal); }}WorkshopEnergyRules.java
Section titled “WorkshopEnergyRules.java”package com.github.paohaijiao.demo;
import com.github.paohaijiao.xml.param.Param;
/** * 场景 32:车间能耗偏离率、单耗评级与温度异常规则 */public interface WorkshopEnergyRules {
/** * 用电同比偏离率(%) */ int powerDeviationPercent(@Param("total") int total, @Param("baseline") int baseline);
/** * 单位产品电耗评级(交叉相乘:total*100 对 标准耗电*阈值) */ String efficiencyLevel(@Param("total") int total, @Param("output") int output, @Param("standardPerUnit") int standardPerUnit);
/** * 需量超合同率(%) */ int demandExcessPercent(@Param("maxDemand") int maxDemand, @Param("contract") int contract);
/** * 用水同比偏离率(%) */ int waterDeviationPercent(@Param("usage") int usage, @Param("baseline") int baseline);
/** * 恒温车间温度是否超出 18-26℃ 工艺区间 */ boolean temperatureAbnormal(@Param("controlled") boolean controlled, @Param("temperature") int temperature);}workshop-energy.xml
Section titled “workshop-energy.xml”<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE javas PUBLIC "-//PAOHAIJIAO//DTD API JAVA 1.0//EN" "classpath:paohaijiao/dtd/Jquick-java.dtd"><javas namespace="com.github.paohaijiao.demo.WorkshopEnergyRules">
<java name="powerDeviationPercent" returnClass="int"> <![CDATA[ int def powerDeviationPercent(int:total, int:baseline) { return (total - baseline) * 100 / baseline; } ]]> </java>
<java name="efficiencyLevel" returnClass="java.lang.String"> <![CDATA[ str def efficiencyLevel(int:total, int:output, int:standardPerUnit) { int standardTotal = output * standardPerUnit; if (total * 100 > standardTotal * 120) { return "WASTE"; } else if (total * 100 > standardTotal * 105) { return "ATTENTION"; } else { return "NORMAL"; } } ]]> </java>
<java name="demandExcessPercent" returnClass="int"> <![CDATA[ int def demandExcessPercent(int:maxDemand, int:contract) { return (maxDemand - contract) * 100 / contract; } ]]> </java>
<java name="waterDeviationPercent" returnClass="int"> <![CDATA[ int def waterDeviationPercent(int:usage, int:baseline) { return (usage - baseline) * 100 / baseline; } ]]> </java>
<java name="temperatureAbnormal" returnClass="boolean"> <![CDATA[ boolean def temperatureAbnormal(boolean:controlled, int:temperature) { if (controlled) { if (temperature >= 18) { if (temperature <= 26) { return false; } else { return true; } } else { return true; } } else { return false; } } ]]> </java>
</javas>WorkshopEnergyAlertService.java
Section titled “WorkshopEnergyAlertService.java”package com.github.paohaijiao.demo.service;
import com.github.paohaijiao.demo.WorkshopEnergyRules;import com.github.paohaijiao.demo.model.WorkshopEnergyAlert;import com.github.paohaijiao.demo.model.WorkshopEnergyRecord;
/** * 场景 32:车间能耗多信号聚合预警 */public class WorkshopEnergyAlertService {
private static final int LEVEL_NORMAL = 0; private static final int LEVEL_INFO = 1; private static final int LEVEL_WARNING = 2; private static final int LEVEL_CRITICAL = 3;
private final WorkshopEnergyRules rules;
public WorkshopEnergyAlertService(WorkshopEnergyRules rules) { this.rules = rules; }
public WorkshopEnergyAlert evaluate(WorkshopEnergyRecord r) { WorkshopEnergyAlert alert = new WorkshopEnergyAlert(); alert.setWorkshopId(r.getWorkshopId()); alert.setEfficiencyLevel("NORMAL");
if (!r.isMeterOnline()) { alert.setAlertLevel("CRITICAL"); alert.addSignal("能耗计量表离线,数据采集中断,须立即检修计量回路"); return alert; }
int level = LEVEL_NORMAL;
if ("STOPPED".equals(r.getProductionLineStatus()) && r.getTotalKwh() > r.getBaselineKwh() * 0.1) { level = upgrade(level, LEVEL_CRITICAL); alert.addSignal("产线已停线但仍有 " + r.getTotalKwh() + "kWh 用电(超基准 10%),疑似设备空转或偷漏电"); }
int powerDev = rules.powerDeviationPercent(r.getTotalKwh(), r.getBaselineKwh()); alert.setPowerDeviationPercent(powerDev); if (powerDev >= 30) { level = upgrade(level, LEVEL_CRITICAL); alert.addSignal("用电同比偏高 " + powerDev + "%,超过 30% 紧急线,须立即排查高耗能设备"); } else if (powerDev >= 15) { level = upgrade(level, LEVEL_WARNING); alert.addSignal("用电同比偏高 " + powerDev + "%,关注排产与设备能效"); }
if ("RUNNING".equals(r.getProductionLineStatus())) { String efficiency = rules.efficiencyLevel(r.getTotalKwh(), r.getOutputQty(), r.getStandardKwhPerUnit()); alert.setEfficiencyLevel(efficiency); if ("WASTE".equals(efficiency)) { if (r.getOutputQty() == 0) { level = upgrade(level, LEVEL_CRITICAL); alert.addSignal("本班有能耗但产量为 0,能源完全空耗"); } else { level = upgrade(level, LEVEL_WARNING); alert.addSignal("单位产品电耗超标准 20%,能效评级 WASTE"); } } else if ("ATTENTION".equals(efficiency)) { level = upgrade(level, LEVEL_INFO); alert.addSignal("单位产品电耗超标准 5%,能效评级 ATTENTION"); } }
int demandExcess = rules.demandExcessPercent(r.getMaxDemandKw(), r.getDemandContractKw()); alert.setDemandExcessPercent(demandExcess); if (demandExcess >= 10) { level = upgrade(level, LEVEL_CRITICAL); alert.addSignal("最大需量超合同 " + demandExcess + "%,面临需量电费加价,立即错峰"); } else if (demandExcess > 0) { level = upgrade(level, LEVEL_WARNING); alert.addSignal("最大需量超合同 " + demandExcess + "%,接近加价线"); }
int waterDev = rules.waterDeviationPercent(r.getWaterUsageTon(), r.getWaterBaselineTon()); alert.setWaterDeviationPercent(waterDev); if (waterDev >= 100) { level = upgrade(level, LEVEL_CRITICAL); alert.addSignal("用水同比偏高 " + waterDev + "%,疑似供水管网泄漏,立即巡线"); } else if (waterDev >= 50) { level = upgrade(level, LEVEL_WARNING); alert.addSignal("用水同比偏高 " + waterDev + "%,核查冷却水与清洗用水"); }
if (!r.isGasPressureOk()) { level = upgrade(level, LEVEL_WARNING); alert.addSignal("燃气压力异常,可能影响加热炉工艺稳定性"); }
if (rules.temperatureAbnormal(r.isTempControlled(), r.getTemperature())) { level = upgrade(level, LEVEL_WARNING); alert.addSignal("恒温车间实测 " + r.getTemperature() + "℃,超出 18-26℃ 工艺区间,检查空调系统"); }
alert.setAlertLevel(levelName(level)); return alert; }
private int upgrade(int current, int candidate) { return candidate > current ? candidate : current; }
private String levelName(int level) { if (level >= LEVEL_CRITICAL) { return "CRITICAL"; } if (level >= LEVEL_WARNING) { return "WARNING"; } if (level >= LEVEL_INFO) { return "INFO"; } return "NORMAL"; }}WorkshopEnergyAlertServiceTest.java
Section titled “WorkshopEnergyAlertServiceTest.java”package com.github.paohaijiao.demo;
import com.github.paohaijiao.demo.model.WorkshopEnergyAlert;import com.github.paohaijiao.demo.model.WorkshopEnergyRecord;import com.github.paohaijiao.demo.service.WorkshopEnergyAlertService;import com.github.paohaijiao.xml.JQuickJava;import org.junit.Assert;import org.junit.Before;import org.junit.Test;
/** * 场景 32:车间能耗异常判定与超标预警 * <p> * 6 组班次形态:全要素正常、用电 18% 预警叠加温度燃气异常、用电 37%+单耗浪费+需量紧急、 * 停线空转紧急、用水泄漏紧急、计量离线紧急与需量 8% 预警。 */public class WorkshopEnergyAlertServiceTest {
private WorkshopEnergyAlertService service;
@Before public void setUp() { WorkshopEnergyRules rules = JQuickJava.create() .createApi(WorkshopEnergyRules.class, "demo/workshop-energy.xml"); this.service = new WorkshopEnergyAlertService(rules); }
/** * 用电、单耗、需量、用水全部贴合基准 → NORMAL */ @Test public void shouldStayNormalWhenAllMetricsOnBaseline() { WorkshopEnergyRecord r = base("WS01"); r.setTotalKwh(800); r.setBaselineKwh(800); r.setOutputQty(100); r.setWaterUsageTon(30); r.setWaterBaselineTon(30);
WorkshopEnergyAlert a = service.evaluate(r);
Assert.assertEquals("NORMAL", a.getAlertLevel()); Assert.assertEquals(0, a.getPowerDeviationPercent()); Assert.assertEquals("NORMAL", a.getEfficiencyLevel()); Assert.assertEquals(0, a.getSignals().size()); }
/** * 用电 +18%、恒温 28℃、燃气压力异常 → WARNING,三信号齐备 */ @Test public void shouldWarnOnPowerDeviationAndUtilityIssues() { WorkshopEnergyRecord r = base("WS02"); r.setTotalKwh(950); r.setBaselineKwh(800); r.setOutputQty(120); r.setTemperature(28); r.setGasPressureOk(false);
WorkshopEnergyAlert a = service.evaluate(r);
Assert.assertEquals("WARNING", a.getAlertLevel()); Assert.assertEquals(18, a.getPowerDeviationPercent()); Assert.assertTrue(a.getSignals().contains("燃气压力异常,可能影响加热炉工艺稳定性")); Assert.assertTrue(a.getSignals().get(0).contains("用电同比偏高 18%")); Assert.assertTrue(a.getSignals().contains( "恒温车间实测 28℃,超出 18-26℃ 工艺区间,检查空调系统")); }
/** * 用电 +37%、单耗浪费、需量超 20% → CRITICAL */ @Test public void shouldRaiseCriticalForWasteAndDemandOverrun() { WorkshopEnergyRecord r = base("WS03"); r.setTotalKwh(1100); r.setBaselineKwh(800); r.setOutputQty(100); r.setMaxDemandKw(600); r.setDemandContractKw(500);
WorkshopEnergyAlert a = service.evaluate(r);
Assert.assertEquals("CRITICAL", a.getAlertLevel()); Assert.assertEquals(37, a.getPowerDeviationPercent()); Assert.assertEquals(20, a.getDemandExcessPercent()); Assert.assertEquals("WASTE", a.getEfficiencyLevel()); Assert.assertTrue(a.getSignals().contains("单位产品电耗超标准 20%,能效评级 WASTE")); Assert.assertTrue(a.getSignals().get(2).contains("最大需量超合同 20%")); }
/** * 停线仍耗电 200kWh(超基准 10%)→ 空转/偷漏电路径紧急告警 */ @Test public void shouldRaiseCriticalForStoppedLineEnergyUse() { WorkshopEnergyRecord r = base("WS04"); r.setTotalKwh(200); r.setBaselineKwh(800); r.setProductionLineStatus("STOPPED"); r.setOutputQty(0);
WorkshopEnergyAlert a = service.evaluate(r);
Assert.assertEquals("CRITICAL", a.getAlertLevel()); Assert.assertEquals("NORMAL", a.getEfficiencyLevel()); Assert.assertTrue(a.getSignals().get(0).contains("产线已停线但仍有 200kWh 用电")); }
/** * 用水从 30 吨飙到 80 吨(+166%)→ 管网泄漏紧急告警 */ @Test public void shouldRaiseCriticalForWaterLeak() { WorkshopEnergyRecord r = base("WS05"); r.setTotalKwh(800); r.setBaselineKwh(800); r.setOutputQty(100); r.setWaterUsageTon(80); r.setWaterBaselineTon(30);
WorkshopEnergyAlert a = service.evaluate(r);
Assert.assertEquals("CRITICAL", a.getAlertLevel()); Assert.assertEquals(166, a.getWaterDeviationPercent()); Assert.assertTrue(a.getSignals().get(0).contains("用水同比偏高 166%,疑似供水管网泄漏")); }
/** * 计量表离线直接 CRITICAL;最大需量超合同 8% 但未到 10% 紧急线 → WARNING */ @Test public void shouldHandleMeterOfflineAndNearDemandLimit() { WorkshopEnergyRecord offline = base("WS06"); offline.setMeterOnline(false); WorkshopEnergyAlert a1 = service.evaluate(offline); Assert.assertEquals("CRITICAL", a1.getAlertLevel()); Assert.assertTrue(a1.getSignals().get(0).contains("能耗计量表离线,数据采集中断"));
WorkshopEnergyRecord nearLimit = base("WS07"); nearLimit.setTotalKwh(800); nearLimit.setBaselineKwh(800); nearLimit.setOutputQty(100); nearLimit.setMaxDemandKw(540); nearLimit.setDemandContractKw(500); WorkshopEnergyAlert a2 = service.evaluate(nearLimit); Assert.assertEquals("WARNING", a2.getAlertLevel()); Assert.assertEquals(8, a2.getDemandExcessPercent()); Assert.assertTrue(a2.getSignals().contains("最大需量超合同 8%,接近加价线")); }
private WorkshopEnergyRecord base(String id) { WorkshopEnergyRecord r = new WorkshopEnergyRecord(); r.setWorkshopId(id); r.setWorkshopName("一号车间"); r.setShift("DAY"); r.setTotalKwh(800); r.setBaselineKwh(800); r.setOutputQty(100); r.setStandardKwhPerUnit(8); r.setWaterUsageTon(30); r.setWaterBaselineTon(30); r.setMaxDemandKw(400); r.setDemandContractKw(500); r.setTempControlled(true); r.setTemperature(22); r.setGasPressureOk(true); r.setMeterOnline(true); r.setProductionLineStatus("RUNNING"); return r; }}Run & verified results
Section titled “Run & verified results”Run from the project root:
mvn test -Dtest=WorkshopEnergyAlertServiceTestTest coverage (6 @Test methods covering normal, multi-signal warning, critical stacking, and the four unconditional-escalation scenarios):
| Test method | Business profile | Key assertions / expected decision |
|---|---|---|
shouldStayNormalWhenAllMetricsOnBaseline |
WS01 day shift: electricity 800/baseline 800, output 100 units, water 30/30, demand 400 below contract 500, 22°C | NORMAL, electricity deviation 0, unit consumption NORMAL, signals empty |
shouldWarnOnPowerDeviationAndUtilityIssues |
WS02: electricity 950 (+18%), output 120 with normal unit consumption, controlled temp 28°C, gas pressure abnormal | WARNING, deviation 18; signals include “用电同比偏高 18%” (first), “燃气压力异常”, “恒温车间实测 28℃,超出 18-26℃ 工艺区间” |
shouldRaiseCriticalForWasteAndDemandOverrun |
WS03: electricity 1100 (+37%), output 100 with WASTE unit consumption, demand 600/contract 500 (+20%) | CRITICAL, electricity deviation 37, demand excess 20, unit consumption WASTE; includes “单位产品电耗超标准 20%,能效评级 WASTE”, third signal contains “最大需量超合同 20%” |
shouldRaiseCriticalForStoppedLineEnergyUse |
WS04: line STOPPED yet still drawing 200kWh (25% of baseline 800, above the 10% line), output 0 | CRITICAL, unit-consumption rating stays NORMAL (no rating while stopped); first signal contains “产线已停线但仍有 200kWh 用电” |
shouldRaiseCriticalForWaterLeak |
WS05: water jumps from 30 to 80 tons, everything else on baseline | CRITICAL, water deviation 166; first signal contains “用水同比偏高 166%,疑似供水管网泄漏” |
shouldHandleMeterOfflineAndNearDemandLimit |
WS06 meter offline; WS07 demand 540/contract 500 (+8%) | Offline batch CRITICAL, first signal contains “能耗计量表离线,数据采集中断”; near-limit batch WARNING, over-contract rate 8, contains “最大需量超合同 8%,接近加价线” |
Technical highlights
Section titled “Technical highlights”- Thresholds externalized in XML, hot-updatable per workshop: the 30%/15% electricity lines, the 10% demand surcharge line, the 100%/50% water lines, and the 18-26°C controlled-temperature band all live in
workshop-energy.xml; switching workshops or energy contracts only means swapping the XML/rebuilding the proxy, without touching the energy acquisition program. - One method per criterion, ratios and ratings independently auditable: five rule methods each compute exactly one thing — electricity, unit consumption, demand, water, temperature — and the decision writes back three integer ratios plus the unit-consumption rating; together with the
signalstext, alert causes are fully traceable. - Service-side short-circuit and level-only-up aggregation: meter offline goes straight to CRITICAL and returns; all other signals take the maximum via
upgrade, so no critical signal is ever diluted by other normal metrics. - Cross-multiplication + integer-carried ratios: the unit-consumption rating uses
total * 100 > standardTotal * 120to avoid floating-point comparison; deviation rates are produced by integer multiply/divide directly as percentages like 18, 37, 166 — no floating-point error on JDK 8. - Production-line status as a gate for context: both idling detection and unit-consumption rating are gated on
productionLineStatus; stopped lines are never mis-rated for unit consumption and WASTE is only judged while running, avoiding false alarms from mismatched operating conditions. - ASM proxy with zero heavyweight dependencies:
@Paramname binding and singleton-reusable proxies embed directly into JDK 8 plant energy-management systems and IT-innovation environments, with no separate rule-service process.