Coal-Electric Integration: Ledger Aggregation and Report Generation - Database and Operations Maintenance

Coal-Electric Integration: Ledger Aggregation and Report Generation - Database and Operations Maintenance

What this category of data looks like

Data primarily comes from coal mine excavation monitoring systems, power plant operation dispatch systems, and archived files from offline paper ledgers that have been digitized. Update frequencies fall into three categories: real-time collected operation parameters, daily aggregated production ledgers, and monthly archived maintenance reports. Each ledger document includes fields such as unique device identifier, operation duration, coal consumption, power generation, and maintenance batch. The units are, respectively, serial number, hour, ton, megawatt-hour, and batch. Documents are stored in structured JSON or CSV format. Some historical ledgers are in text format extracted via OCR from scanned documents.

High-frequency writes of real-time operation parameters require the database to support high-concurrency connections to avoid connection exhaustion. Large volumes of daily aggregated ledger data require batch write configuration strategies to prevent single-write timeouts. Unstructured text from OCR-recognized historical ledgers requires support for both structured field storage and full-text indexing. The presence of multi-unit fields requires the database to have unified unit validation rules to avoid data entry confusion. Data with different update frequencies must be split and stored by time dimension to facilitate subsequent calls for ledger aggregation and report generation tasks.

How to configure settings

Configuration ItemRecommended ValueRationale
MONGODB_URImongodb://coal_power:xxxx@10.0.0.1:27017/coal_power_db?authSource=adminStores multi-format data including real-time operation parameters and OCR historical ledgers, adapts to the mixed structured and unstructured storage needs of coal-electric integration data
PG_URLpostgresql://report_user:xxxx@10.0.0.2:5432/coal_power_report?sslmode=requireStores structured ledger fields and aggregated report metadata, supports complex associated queries
DB_MAX_LINK200–300Matches the concurrency requirements of high-frequency real-time data writes, prevents database connection pool exhaustion
REDIS_URLredis://:xxxx@10.0.0.3:6379/0Caches frequently called ledger aggregation results to reduce load on core databases
Database query timeout600 secondsAdapts to the duration of aggregated ledger data queries and aggregation tasks, prevents single tasks from triggering timeouts

Three common mistakes

  • Symptom: A timeout of 360000ms exceeded error is triggered when importing ledger CSV files larger than 10 MB. Cause: The maximum connection count and timeout configuration of the database connection pool were not adjusted, causing batch write tasks to fail to complete within the preset time limit.
  • Symptom: After a workflow calls a database query, the returned result is empty or does not include the queried ledger data. Cause: The permission parameters of MONGODB_URI were not configured correctly, causing the workflow to lack permission to read the ledger collection in the target database.
  • Symptom: Abnormal data with inconsistent units appears when generating aggregated reports. Cause: No unified field unit validation rules were configured for the database, causing units of ledger data from different sources to remain unstandardized.

How to confirm correct configuration

  • Access the FastGPT database configuration page, verify the connection status of MONGODB_URI and PG_URL, and check whether a connection successful prompt is displayed.
  • Run a single ledger data query task, and verify whether the returned fields and units match the preset ledger structure.
  • Initiate a batch ledger import test, observe whether the task execution duration meets business requirements, and confirm that no timeout errors are triggered.
  • Check the Redis cached ledger aggregation results, confirm that frequently queried results can be called normally by workflows.

Reference only; verify against the target FastGPT release and deployment documentation. The values provided are common starting points and should be evaluated against the samples relevant to the specific deployment.

Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-09-28.