Forecasting for Grid and Cloud Computing On-Demand Resources Based on Pattern Matching