Page 353 - 《软件学报》2026年第6期
P. 353
2672 软件学报 2026 年第 37 卷第 6 期
“detection and defense” strategy, which utilizes detection algorithms to filter out malicious users before model training to mitigate the
influence of the attacks. However, due to the performance limitations of detection algorithms, it is inevitable that malicious users cannot be
completely filtered out. To this end, this study proposes a continuous defense method against poisoning attacks on the QoS-aware cloud
API recommendation system from a “learning to defense by attacks” perspective with trusted data augmentation. First, this study
establishes a defense framework against poisoning attacks based on trusted data augmentation and enhances the robustness of the
recommendation system by generating high-quality trusted user data for model training. Second, the study designs a trusted user generation
algorithm based on the diffusion model, which employs iterative denoising to learn real-world QoS data distribution related to cloud APIs
and generate high-quality trusted user vectors, thus mitigating the influence of data subjected to poisoning attacks on training models.
Finally, extensive experiments are conducted based on real-world cloud API QoS datasets, and 11 recommendation algorithms from three
categories are utilized to comprehensively evaluate the effectiveness and universality of the proposed defense method. Experimental results
indicate that the proposed framework of continuous defense against poisoning attacks based on trusted data augmentation is effective, and
the generated trusted user can significantly improve the robustness of the cloud API recommendation system.
Key words: recommendation system; cloud API; poisoning attack; continuous defense; data augmentation; diffusion model
应用程序编程接口 (application programming interface, API) 是一组预先定义的网络接口, 通过互联网或者私
有云网络为应用程序、开发人员提供访问一组数据和计算资源的服务能力 [1] . 进入软件定义一切的云时代, 软件
逐渐成为经济社会发展的基础设施, 云 API 也逐渐成为当今世界软件驱动创新的基础元素. 云 API 凭借网构化、
跨平台和可扩展等优势将迄今为止一直隐藏在企业与组织背后的数据、算法和算力等核心资产便捷地提供给合
作伙伴和对其感兴趣的开发人员, 有力促进了云 API 提供者和使用者的双赢 [2,3] . 一方面, 云 API 提供者利用云 API
对外开放其竞品资源和释放数据要素价值. 当前, 国内外科技巨头如阿里、谷歌和 OpenAI 等纷纷布局云 API 的
生产和治理, 以汇聚其生态中的合作伙伴, 挖掘新的价值源泉 [4] . 例如, 阿里采用云 API 提供在线支付服务, 谷歌利
用云 API 共享地图服务, OpenAI 基于云 API 开放 GPT 大语言模型应用. 另一方面, 由于云 API 成功解决了不同
编程语言和开发平台导致的软件开发巴别塔难题, 开发人员只需关心云 API 对外暴露的接口, 无需重写底层实现
代码, 吸引了众多开发人员采用开放网络中的云 API 作为数字胶水, 便捷地将数据、服务和应用紧密地联系在一
起, 营造了优质的用户体验. 可见, 云 API 作为应用程序、人工智能算法和物联网设备之间数据交换、能力复制和
服务交付的最佳载体, 已成长为当今面向服务软件开发与运行不可或缺的新型数字基础设施.
如今, 随着企业和组织数字化转型与业务创新对快速接入云端服务以及开放自身竞品资源的日渐重视, 网络
中可用的云 API 数目和开发人员数目急剧增长 [5] . 例如, 全球最大的云 API 开放平台 RapidAPI 目前支持超过 40k
个 API, 超过 12 000 个 API 发布者, 超过 20 万的月活跃订阅者, 数百万的注册开发者, 以及每月超过 5B 的 API 请
求, 并且云 API 数目也正在以每年 30% 以上的增速增长, 由此导致了日益严重的云 API 过载问题. 尽管国内外云
API 开放平台如聚合数据、RapidAPI 和 APIList 纷纷通过构建云 API 仓库, 提供基于关键字匹配、类别浏览等功
能来提升云 API 的检索效率, 但功能高度同质化的云 API 严重阻碍了云 API 的选择及其推广应用. 例如,
RapidAPI 中仅提供天气预报功能的云 API 数量已高达 117. 这些对于领域知识相对匮乏的用户而言, 快速识别并
选择满足其个性化需求的云 API 是极其困难的, 而且云 API 的反复搜索也将大大影响软件的开发效率.
为了解决云 API 功能同质化问题, 研究人员引入服务质量 (quality of service, QoS) 的概念, 用来描述云 API 非
功能侧的属性特征, 如响应时间、吞吐量和可靠性等, 进而利用 QoS 数据评估云 API 在特定方面的质量信息 [6] .
由于 QoS 能够有效差异化功能相似云 API 之间的性能, 以及推荐系统在解决信息过载问题方面的显著优势, 研究
者们随之提出了将 QoS 感知云 API 推荐系统应用于解决功能同质化的高质量云 API 选择难题 [7,8] . 值得注意的是,
面对海量云 API, 单一用户只使用过其中有限的云 API, 对大部分云 API 的服务质量是未知的, 而测试所有候选云
API 的服务质量将耗费巨大的时间、资源和费用开销, 因此 QoS 感知云 API 推荐系统能够有效运行的一个基本
前提是实现准确的云 API QoS 预测, 以支持 QoS 感知的个性化云 API 推荐.
针对 QoS 感知云 API 推荐任务, 研究人员提出了一系列服务质量预测方法, 如基于协同过滤、基于矩阵分解
和基于深度学习的预测方法, 以保障高质量云 API 的选择. 协同过滤是最早的云 API QoS 预测技术之一, 其主要
通过计算相似性、识别相似近邻和协同预测这 3 个步骤实现 QoS 个性化预测 [9] . 矩阵分解技术则从用户-云 API

