I’m sure they’re ships’ official numbers that are given British ships when first registered. As long as it remains British registered vessel the number never changes even if it’s name or owner changes.
I know the Crew List Indexing Project has an online database for obtaining a vessels number from it’s name but I don’t know of one going the other way; perhaps they do. You will find more details about ships numbers etc., on the Crew List guide page of CLIP at http://www.crewlist.org.uk/findingoncrewlists.html
and there are links to other useful sites like the one below too.
The numbers can be found in Lloyds Register of Shipping; see the Southampton pages from the Port Cities Gateway at http://www.portcities.org.uk/
for more details.