def METHOD_NAME(self):
    # 准备排序好的资产信息数据
    infos = []
    for node in self.nodes:
        assets = self.nodekey_assetsid_mapper.get(node.key, set())
        info = NodeAssetsInfo(key=node.key, assets_amount=0, assets=assets)
        infos.append(info)
    infos = sorted(infos, key=lambda i: [int(i) for i in i.key.split(':')])
    # 这个守卫需要添加一下，避免最后一个无法出栈
    guarder = NodeAssetsInfo(key='', assets_amount=0, assets=set())
    infos.append(guarder)
    stack = Stack()
    for info in infos:
        # 如果栈顶的不是这个节点的父祖节点，那么可以出栈了，可以计算资产数量了
        while stack.top and not info.key.startswith(f'{stack.top.key}:'):
            pop_info = stack.pop()
            pop_info.assets_amount = len(pop_info.assets)
            self.nodekey_assetsinfo_mapper[pop_info.key] = pop_info
            if not stack.top:
                continue
            stack.top.assets.update(pop_info.assets)
        stack.push(info)