It is sad and horrible. Similarly, I know an MTF TG who several years ago had a gang of 7 men break into her house. Her roomate decided to simply open the door when someone knocked without actually looking and in stormed the gang, several who were armed. This was a burglary and robbery and one of the criminals had threatened to rape the girl who was in bed at the time but did not go ahead with it. Needless to say, she owned a shotgun the next day.
Fighting 7 men is difficult but not impossible. As far as I'm concerned, society is getting pretty bad if it is getting to the point where gangs this large are attacking people. I honestly think the largest piece to the puzzle for self-defense is being aware of your surroundings and being tactical in your activities. In order for 7 men to attack you, they obviously have to be close enough to do so. Simple things like not opening the door or keeping it locked could help. The OP's incident occurred when they were opening their door to enter meaning that either they were already there standing in front of the door or were hiding behind plants or other obstructions.
It pays to vary routines, times, directions, and not be distracted. It also makes sense to have a full 360 degree awareness at all times as well. Using your eyes accomplishes about 180 degrees and your ears should accomplish the remainder that is out of vision. Even smell can save your life. A freshly lit cigarette odor quickly tells you that you aren't the only one in a parking garage. If it does happen that a large group of people is hanging around and appearing suspicious, there are ways of dealing with them. First, I would treat one person as ten. The nice gentleman knocking on your front door could mean nine more not-so-nice people are hiding out of view. I don't open the door to strangers, I don't linger around in public while appearing distracted, I don't count cash in view, and I don't make it publically known when I'm leaving, returning, or where I'm going. I want my house, car, and person to be an unknown variable to a criminal who may not know if someone is there, not there, how many, if they are awake, asleep, when they are getting back, leaving, etc.
If all else fails, I have the tools to get the job done. Anyone who makes a direct attempt to rob me or burglarize my property better hope that I'm caught off-guard and unready (which is unlikely) because otherwise they will be leaving in a body bag. Be a tough target.