def dict_struct_compare(d1, d2):
    """
    This helper function compares structure of recursive dictionaries, returning `None` if it's identical.

    Here is a study case of usage:
    d1 = {"a":{"b": 1,"c": 1},"e":1,"f":1}
    d2 = {"a":{"b": 1,"d": 1},"f":1}
    d3 = {"a":{"b": 1,"c": 1},"e":1,"f":1}
    d4 = {"a":{"b": {"g":1},"c": 1},"e":1,"f":1}
    d5 = {"a":{"b": {"h":1},"d": 1},"f":1}
    print(dict_struct_compare(d1,d3))
    print(dict_struct_compare(d1,d2))
    print(dict_struct_compare(d4,d5))
    >>None
    >>{'added': {'e'}, 'removed': set(), 'inner structure': {'a': {'added': {'c'}, 'removed': {'d'}, 'inner structure': {}}}}
    >>{'added': {'e'}, 'removed': set(), 'inner structure': {'a': {'added': {'c'}, 'removed': {'d'}, 'inner structure': {'b': {'added': {'g'}, 'removed': {'h'}, 'inner structure': {}}}}}}
    """
    d1_keys = set(d1.keys())
    d2_keys = set(d2.keys())
    intersect_keys = d1_keys.intersection(d2_keys)
    added = d1_keys - d2_keys
    removed = d2_keys - d1_keys
    struct_dict = {}
    for o in intersect_keys:
        # compare dictionaries recursively
        if ((type(d1[o]) == dict) and (type(d2[o]) == dict)):
            struct_dict_diff = {}
            struct_dict_diff = dict_struct_compare(d1[o], d2[o])
            if (struct_dict_diff != None):
                struct_dict[o] = struct_dict_diff

    if (added == set() and removed == set() and (struct_dict == None or struct_dict == {})):
        return None
    return {"added": added, "removed": removed, "inner structure": struct_dict}