Getty Images AsiaPac
Here's how the system works, according to the patent: If your iPhone can't connect to the internet for some reason, then it will search for nearby iPhones. It'll look for iPhones on the same WiFi network, as well as via Bluetooth and NFC.
If your iPhone detects that someone you know is nearby (using your contacts or a pre-approved buddy list) then it will send them a notification. Your friend can then choose to help you back up your data by temporarily transferring it to their iPhone. Any photos or notes that weren't already saved to your iCloud account will be encrypted and sent to your friend, whose phone will then back them up for you.
There are some technicalities involved, though. Apple's patent, which was first filed in February 2014, makes it clear that it's only going to use iPhones to back up data when they have enough battery, and when they have a good enough internet connection. There's no use sending all your data to someone else's iPhone if it's not going to be more useful than your own.
Apple's patent also says that your data will expire after enough time, so there's a smaller risk of someone gaining access to your data. The patent suggests one week as an example of how long your data might sit on someone else's iPhone
Just because Apple has patented something doesn't mean that it's actually going to happen. It patents lots of different ideas and systems, but only releases a very small amount as actual products. An Apple patent could also be used to stop its rivals developing something, or as a marketing tool.
We contacted Apple for comment on this story, and we'll update this article when we hear back.