Bialgebraic foundations for the operational semantics of string diagrams