Construction of hierarchical functional nanomaterials for energy conversion and storage