Ex 31:12-17 contains a statement of the Lord. The main thesis lies in the words "You shall keep my sabbaths".
Apparently, a connection with the fourth commandment is emphasised here. The commandment specifies a particular way of keeping the Shabbat.
In other words, it explains how to keep it. Only two sentences are quoted from the Decalogue.
These two sentences offer a summary, a basic pronouncement, two vital pillars, a focus of the commandment. The connection can be described by a two-fold statement.
You shall work for six days and rest on the seventh day, because the Lord works for six days and rests on the seventh day. Ex 31:12-17 shows a close bond between a human Shabbat and the divine Shabbat.
Humans do the same as the Lord does. Humans are in harmony with the Lord, they are the same rhythm.
Through the human Shabbat we can observe (is revelaed) the divine Shabbat. The fourth commandment intends to highlight this harmovy, or to emphasise the bond between the Lord and his follower.
This specific union with the Lord is according to this text, a particular sign of the Shabbat. Keeping the rest on the seventh day is an expression of this harmony, a covenant of the Lord, as well as mutual allegiance to the covenant.