Page 53 - 《软件学报》2025年第5期
P. 53
胡强 等: 融合潜在联合词与异质关联兼容的 Web API 推荐 1953
荐过程中融入不同的辅助信息, 如服务之间的协作、调用、位置等要素. 这些方法为研究 Mashup 服务需求的组
件 Web API 推荐提供了有益的参考. 然而, 在构建 Mashup 服务时, Web API 与需求之间不仅需要功能匹配, 更需
要应用场景的契合. 此外, 现有方法缺乏对推荐服务多样性的考量. 为此, 本文在构建 Web API 推荐方法时, 将应
用场景信息融入到功能匹配中, 同时, 利用异质关联图将 Web API 的功能关联与协作关联进行融合度量, 增加推
荐的多样性.
2 预备知识与研究框架
2.1 相关定义
本节给出 Web 服务、Mashup 服务以及异质服务关联的相关定义, 并介绍研究框架.
定义 1. Web API. Web API 为一个三元组 s = (n, L, d), 其中, n 为 Web API 的名称, L 为 Web API 的标签集合,
d 为 Web API 的描述信息.
定义 2. Mashup 服务. Mashup 服务为一个四元组 m = (n, L, d, S). 其中, n 为 Mashup 服务的名称, L 为 Mashup
服务的标签集合, d 为 Mashup 服务的描述信息, S 为组件 Web API 集合.
图 2 和图 3 分别是 ProgrammableWeb 上发布的 Web API 和 Mashup 服务示例. 二者均具有服务名称、标签、
服务功能描述. 此外, Mashup 服务还包含一组相关 Web API 集合.
Echobox API
Social Machine Learning Tools
Echobox offers machine learning driven publishing tools including social media
automation and email newsletter automation. The Echobox Social API offers
programmatic access to a posting and analysis tool for social media outlets including
Facebook, Twitter, Instagram and Linkedln. The API enables developers to integrate
the service into applications and manage permissions, properties, shared media,
individual media data and more.
图 2 Web API 示例
Fabric Twitter Kit for iOS
Tweets Activity 5treams Authentication
Social Text Edring
The Twitter Kit for iOS, supported by Twitter as part of the Fabric developer suite,
helps developers create iOS applications that integrate various Twitter functionalities.
The SDK can be used to implement easy Twitter login, compose tweets, display
tweets, and authenticate all from a third-party application. The iOS Twitter Kit
includes “Login” for standard login, “Twitter API” for iOS-driven API requests,
“Tweet Views” for displaying a user’s Twitter stream, “Tweet Compose” for
composing and posting new tweets, and “Digits,” a new way for users to verify with
Twitter via their mobile phone number using SMS-based authentication.
Related APIs: Twitter REST API, Twitter FEED API
图 3 Mashup 服务示例
定义 3. 功能关联. 若存在标签 l, 使得 l ∈ s i .L∩s j .L, 则称服务 s i 与 s j 存在功能关联, 记作: s i ~s j .
定义 4. 协作关联. 存在 Mashup 服务 m, 使得 s i ∈ m.S∧s j . ∈ m.S, 则称服务 s i 与 s j 存在协作关联, 记作: s i ↔s j .
定义 5. Web API 异质关联图. Web API 异质关联图为一个无向加权图 HAG = (V, E, W), 其中,
(1) V = {v 1 , v 2 , …, v n }为节点集合, 节点 v i 表示 Web API s i .
(2) E = {Ef, Ec}, Ef 和 Ec 分别为功能关联边集合与协作关联边集合.
1) e = (v i , v j ) ∈ Ef 中的节点 v i 与 v j 所对应的 s i 和 s j 满足 s i ~s j .
2) e = (v i , v j ) ∈ Ec 中的节点 v i 与 v j 所对应的 s i 和 s j 满足 s i ↔s j .
(3) W = {w ij }为边的权值集合, 对∀e = (v i , v j ) ∈ Ef, w ij = Nl(s i , s j ); ∀e = (v i , v j ) ∈ Ec, w ij = Nc(s i , s j ).