def get_cache(method, mask, default=None):
    """获取方法结果缓存，在识别码变更时清除缓存"""
    if hasattr(method, 'im_self'):
        instance = method.im_self
        method_cache = getattr(instance, '_method_cache_', {})
        cache = method_cache.get(method.__name__, {})
        if cache.get('mask', None) == mask:
            return cache.get('result', default)
        method_cache.pop(method.__name__, None)
    elif hasattr(method, '_mask_'):
        if method._mask_ == mask:
            return method._result_
        del method._mask_
        del method._result_
    return default
