Preamble
Two (unbounded) self-adjoint operators $A, B$ on a Hilbert space $\mathcal{H}$ are said to (strongly) commute if the unitary groups they generate commute or equivilantely if all the projections in their associated spectral measures commute. This implies in particular, that $AB = BA$ (where it makes sense). The converse is not true even under reasonable additional assumptions, which can be seen from the following explicit counter-example due to Nelson (which is also contained in a little more detail in Simon and Reed's book, section VIII.5). Now, although the associated unitary groups in Nelson's example do not commute, they do satisfy a weaker condition, which in spite of a better notion I am going to describe by saying that they 'commute locally'.
Nelson's Example
Nelson constructs a manifold $M$ with a measure on it and two vector fields $X, Y$ on $M$, such that the corresponding flows $\Phi^X, \Phi^Y$ are defined almost everywhere and such that $$ U(t)f(p) := f(\Phi^X_t(p)), \qquad V(s)f(p) := f(\Phi^Y_s(p))$$ define strongly continous unitary grous on $L^2(M)$ with generators (the closures of) $X, Y$. Moreover, he arranges that $\Phi^X, \Phi^Y$ commute locally in the sense that for all $p \in M$ there exists an open neighbourhood $U \subset M$ such that $$\Phi^X_t(\Phi^Y_s(q)) = \Phi^Y_s(\Phi^X_t(q))$$ for all $q \in U$ and all $s, t$ sufficiently small but he also arranges that the flows do not commute globally (in this case they are not even defined for all $s, t$). This implies that $XY = YX$ as differential operators on the space of smooth functions with compact support (i.e. their Lie-bracket vanishes) but $U(t)V(s) \neq V(s)U(t)$ (note that in fact equality does not hold for any $s,t \neq 0$).
It is a basic fact in differential gemeometry, that the Lie-bracket of two vecor fields vanishes (i.e. the corresponding differential operators commute on the space of smooth functions with compact support) if and only if the corresponding flows commute locally (in the sense above). Thus, it seems reasonable to me to ask if their is actually something more general going on here. More concretely, my question is: If $A, B$ are self-adjoint operators on a Hilbert space $\mathcal{H}$, such that $A, B$ are essentially self-adjoint on a common dense domain $D$ which both of them map to itself and if $AB = BA$ on $D$, is it true, that the associated unitary groups $U(t), V(s)$ commute locally, where 'to commute locally' is to be defined in a suitable sense? Is there some hope for a converse?
Idea for a definition
One possible idea of mine of how to define 'local commutativity' in a more abstract setting is as follows: In Nelsons example there exists a second Hilbert space $\mathcal{K}$ (namely $L^2(U))$ and a non-expanding, surjective linear map $\pi_U: \mathcal{H} \rightarrow \mathcal{K}$ such that $$\pi_UU(t)V(s) = \pi_UV(s)U(t)$$ at least for small $s, t$. Thus, maybe a more concrete formulation of my question would be: Given $\mathcal{H}, A, B, D$ as above, does there exist a collection of Hilbert spaces $\mathcal{K}_n$ and non-expanding, surjective linear maps $\pi_n: \mathcal{H} \rightarrow \mathcal{K}_n$ such that for all $n$, $$\pi_nU(t)V(s) = \pi_nV(s)U(t)$$ for all sufficiently small $s,t$ (where the meaning of 'sufficiently small' may depend on $n$) and such that $$\mathcal{H} \rightarrow \bigoplus_n \mathcal{K}_n$$ is isometric onto its image. What about the converse (i.e. does this imply, that $AB = BA$ on $D$)?
I would be very grateful, if somebody would have some ideas, references,... and would also gladly accept similar suggestions for definitions of 'local commutativity' if they enable us to prove one of the implications. Feel free to add some additional assumptions if needed.
At the end of the day I am looking for a result in the same spirit as the above mentioned result that the unitary groups generated by $A, B$ commute iff the projections in their projection valued measures commute. Bonus points if your answer does not make use to heavily of $*$-representations since I am not really comfortable with those yet.
Many thanks in advance!