Why Simulation Is Essential for E‑Commerce Supply Chain Optimization
Simulation enables low‑cost, time‑agnostic testing of e‑commerce supply‑chain strategies—covering procurement, inter‑warehouse allocation, and order dispatch—by combining precedent, experimentation, and modeling, offering a more flexible and comprehensive alternative to AB‑testing for evaluating policies, algorithms, and configurations.
Why Simulation Is Needed
As technical staff, the earliest exposure to simulation is through embedded hardware programming where simulation software mimics hardware behavior. Since then, everything from unit testing to full‑link stress testing for events like Double‑Eleven can be regarded as a broad form of simulation.
Simulation’s main benefits are the ability to test various scenarios at low cost without the constraints of real‑time and physical space, thereby achieving optimization or risk‑control objectives.
Practical Cases
Simulation is widely used internally at Yanxuan and can be divided into four types:
Generate Model – Simulate order scheduling without inventory constraints to compute ideal product allocations across warehouses, guiding procurement and inter‑warehouse transfers.
Solution Tuning – Adjust order‑scheduling strategies and parameters to optimize costs (warehouse picking, courier fees) and user experience (delivery time, package splitting).
Benefit Evaluation – Merge orders for the same user and address in a time window, simulate before merging, and compare the two data sets to derive merging benefits.
Risk Control – Detect mis‑configured dispatch times (e.g., a truck’s departure time set to zero) that would overload a warehouse; simulation reveals such issues before production.
Design Idea
The simulation system shares similarities with stress testing: it requires a dedicated environment, external input construction, concurrency settings, and task execution with result collection. However, simulation has three distinctive requirements:
Rich Customization – Besides historical data capture and concurrency settings, users need to adjust system configuration parameters, initialize states, simulate key timed tasks, and perform agile data analysis.
Strict Timing Sequencing – Multiple stateful services must receive accurately timed external inputs for reliable evaluation.
Concurrent Simulation Tasks – Multiple configuration scenarios need parallel execution for comparative assessment, while overall concurrency is limited by data‑quality constraints.
Data Model Definition
For clarity, the following concepts are introduced:
Simulation Task
A unit of simulation used for a single solution‑evaluation request.
Plugin Configuration
(pluginConfig) contains reusable runtime configuration for plugins required by a simulation task.
Simulation Event
(SimulateEvent) represents a single user‑triggered action within a task, such as external input, statistic trigger, timed task, or configuration initialization.
Platform Plugins
Implement the following Java interfaces, package them, and upload to the simulation platform. Each plugin runs in an isolated container.
Boolean produceEvent(BlockingQueue queue, Long startTime, Long endTime, String pluginParam) Boolean processEvent(SimulateEvent simulateEvent) String exportDefaultParam() Boolean checkParam(String pluginParam)Platform Components
Unified Interaction Layer
The platform’s entry point provides two functions: plugin management (submission, enabling, container creation) and task management (CRUD, default‑parameter export, parameter validation).
Task Scheduling
Two functions are implemented: priority determination (maintaining global and per‑environment queues) and environment allocation (communicating with timing controllers, selecting the highest‑priority task for execution).
Timing Control
The controller orders events from multiple plugins as follows:
Create and start containers for required plugins, invoke produceEvent to generate events, and place them in plugin buffers.
After all plugins start, retrieve the earliest event time from each buffer and sort them.
Execute the earliest event; if the current event’s plugin differs from the previous one, ensure all plugin thread pools are idle before proceeding.
After processing, obtain the next earliest event time from the plugin and repeat.
When no events remain and all thread pools are idle, the simulation task completes, containers stop, and the environment becomes idle.
Platform Dependencies
Container Orchestration
Enables rapid provisioning of multiple simulation environments and CI/CD pipelines. Each simulation task uses only the plugins it needs, reducing resource consumption and ensuring clean state after container termination.
Service Governance
Allows parallel deployment of multiple independent simulation environments using the same code base.
Data Warehouse
Collects and processes simulation data for three purposes: exporting default configuration templates, generating simulated events from historical inputs, and computing evaluation metrics.
File Storage
Large or irregular business configurations (e.g., courier routes and pricing) are stored in a file‑storage service; the download link is placed in pluginParam for retrieval.
Supply Chain Simulation Solution Comparison
We surveyed mainstream industry solutions and identified their strengths and weaknesses. Our design combines the advantages of commercial simulation software, offline data analysis, and algorithm testing while addressing their shortcomings, resulting in a low‑learning‑cost, low‑deployment‑cost, highly reusable solution for the Yanxuan supply chain.
Conclusion and Outlook
Simulation offers unique advantages over AB‑testing and stress testing by enabling precise, full‑link evaluation detached from real‑time constraints, though it introduces greater workflow complexity. Our complete Yanxuan supply‑chain simulation system provides modeling, optimization, evaluation, and risk control with strong extensibility. Future work will enhance intelligent, automated evaluation and explore applications beyond supply‑chain scenarios.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Yanxuan Tech Team
NetEase Yanxuan Tech Team shares e-commerce tech insights and quality finds for mindful living. This is the public portal for NetEase Yanxuan's technology and product teams, featuring weekly tech articles, team activities, and job postings.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
