What the Data for This Category Looks Like
This category’s data covers multi-source information across the entire injection molding workflow. Daily documents include injection molding process cards, raw material drying records, mold histories, first-piece inspection reports, patrol inspection forms, and material change and machine cleaning logs. Data sources include resin batches and property sheets, injection molding machine parameters, mold temperature controllers, MES systems, and dimensional and appearance inspection equipment. Data is synchronized every production batch, each time molds or materials are changed, and at the end of each shift. Fields include resin batch numbers, injection pressure and temperature parameters, mold temperatures, drying durations, material change times, measured dimensional values, and more. Different documents have dedicated field and unit requirements: pressure is measured in MPa, and temperature in ℃.
What Constraints These Characteristics Impose on Database and Operations Workflows
Multi-source data access requires the database to support mixed storage of structured and semi-structured data, to avoid parsing failures caused by inconsistent data formats. High-frequency update cycles require database connection pool configurations to support batch writes and real-time reads, to prevent service interruptions from exhausted connections. Storage needs for multiple document types require the database to support splitting table structures by business entities, to facilitate filtering data by process, inspection, and other dimensions during subsequent ledger summarization. Data sensitivity requires permission controls in operations, to prevent batch defects or safety incidents caused by material mixing, mold parameter tampering, and similar issues.
Configuration Settings
This configuration applies to FastGPT v4.17.0. Configuration items include standard parameters such as MONGODB_URI, PG_URL, DB_MAX_LINK, REDIS_URL, with specific settings as follows:
| Configuration Item | Recommended Setting | Rationale |
|---|---|---|
| MongoDB Connection URI | mongodb://[username]:[password]@[host]:27017/injection_logs | Stores semi-structured business data such as injection molding machine parameters and inspection results |
| PostgreSQL Connection URI | postgresql://[username]:[password]@[host]:5432/injection_docs | Stores structured, fixed-field documents such as injection molding process cards and patrol inspection forms |
| Maximum Database Connections | 20–30 | Adapts to high-frequency data writes during material changes and shift-end synchronization, preventing connection pool exhaustion |
| Redis Connection URI | redis://[host]:6379/1 | Caches static frequently-read data such as mold histories and resin property sheets, reducing database load |
| Data Cache Expiration Time | 3600 seconds | Balances data freshness and query performance, adapting to shift-end update cycles |
| Database Version Selection | MongoDB 6 or 7 | Supports bulk data operations and permission controls, fitting the business scenario |
Three Common Misconfigurations
- Issue: Deployment on a Linux environment results in a MongoDB connection failure, returning
connection timed outorauth failed. Cause: The username and password inMONGODB_URIare not configured correctly, or outbound access to the default MongoDB port 27017 is not enabled. - Issue: Some mold history data is missing from generated production ledgers. Cause: Data is not synchronized to the database at the update frequency for each mold change, resulting in cached mold data not being refreshed in a timely manner.
- Issue: Data truncation errors occur during batch writes of injection molding machine parameters. Cause: An incompatible MongoDB version is used, which does not support bulk storage operations for large fields.
How to Verify Successful Configuration
- Run the built-in database connectivity detection tool to verify that all configured database connection URIs can establish normal connections.
- Submit a simulated raw material drying record, and check that the written fields in the database match the input format.
- Trigger a single production ledger generation task, and confirm that the output covers all configured data source types.
- Simulate a high-frequency data write scenario, and observe the database connection pool usage to confirm that the configured connection count supports peak business loads.
The values provided here are common starting points, and should be evaluated against the reader's own samples.