6G Network Slicing and Traffic Optimization Based on Federated Learning