Next Article in Journal
Conditional Coherent and Convex Risk Measures Under Uncertainty
Previous Article in Journal
Federated Learning for Heterogeneous Multi-Site Crop Disease Diagnosis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Trusted Web Service Discovery Based on a Swarm Intelligence Algorithm

by
Zhengwang Ye
1,
Hehe Sheng
2 and
Haiyang Zou
3,*
1
School of Computer Science, Tonghua Normal University, Tonghua 134002, China
2
Beijing Huawei Digital Technology Co., Ltd., Beijing 100077, China
3
School of Computer Science, China West Normal University, Nanchong 637009, China
*
Author to whom correspondence should be addressed.
Mathematics 2025, 13(9), 1402; https://doi.org/10.3390/math13091402
Submission received: 24 March 2025 / Revised: 14 April 2025 / Accepted: 21 April 2025 / Published: 25 April 2025
(This article belongs to the Section E1: Mathematics and Computer Science)

Abstract

:
The number of services on the internet has experienced explosive growth, and the rapid and accurate discovery of required services among a vast array of similarly functioning services with differing degrees of quality has become a critical and challenging aspect of service computing. In this paper, we propose a trusted service discovery algorithm based on an ant colony system (TSDA-ACS). The algorithm integrates a credibility-based trust model with the ant colony search algorithm to facilitate the discovery of trusted web services. During the evaluation process, the trust model employs a pseudo-stochastic proportion to select nodes, where nodes with higher reputation have a greater probability of being chosen. The ant colony uses a voting method to calculate the credibility of service nodes, factoring in both credibility and non-credibility from the query node’s perspective. The algorithm employs an information acquisition strategy, a trust information merging strategy, a routing strategy, and a random wave strategy to guide ant search. To evaluate the effectiveness of the TSDA-ACS, this paper introduces the random walk search algorithm (RW), the classic max–min ant colony algorithm (MMAS), and a trustworthy service discovery based on a modified ant colony algorithm (TSDMACS) for comparison with the TSDA-ACS algorithm. The experiments demonstrate that this method can achieve the discovery of trusted web services with high recall and precision rates. Finally, the efficacy of the proposed algorithm is validated through comparison experiments across various network environments.

1. Introduction

The P2P network is an open, dynamic, distributed system where nodes can communicate directly with each other, eliminating the need for a centralized server. In these networks, services are provided by peers; the nodes in the network are anonymous and autonomous. However, due to the openness and anonymity of the distributed network environment, malicious service providers can easily infiltrate the network to obtain improper benefits, thereby affecting the quality of services available to users. To effectively avoid the false and malicious services provided by these internal threats, it is crucial to identify malicious nodes among service providers and ensure the provision of trusted web services to maintain service quality. Consequently, establishing a trust management system is essential to encourage the sharing of resources within the network [1].
In P2P networks, due to the structural characteristics of the distributed network, traditional network security mechanisms such as encryption and authentication, which are heavily reliant on central nodes, struggle to identify malicious nodes within the distributed network. The credit-based trust model is applied to a distributed system to manage the trust relationships between nodes and calculate the credit value of nodes, achieving good results in identifying malicious nodes within the self-organized distributed network [2]. Therefore, the study of the trust mechanism in distributed systems is essential [3] for finding trusted web services, establishing trusted connections [4], and ensuring service quality [5]. Currently, most studies regarding trust models in P2P networks rely on user feedback for trust calculations, which are typically divided into local trust models [6] with smaller global trust and less computational complexity, e.g., EigenTrust [7], PeerTrust [8], and that presented in the work of Ref. [9], among others. Many emerging studies have focused on trust management systems in P2P networks [10,11,12]. In the realm of web service discovery, a multitude of research outcomes employ diverse methods to achieve effectiveness and accuracy. The goal is to enhance the user experience during the service discovery process. For example, the authors of Reference [13] proposed a Quality of Service (QoS)-aware service discovery method that leverages the whale optimization algorithm and the genetic algorithm. A service discovery method based on the elephant swarm optimization algorithm was proposed in Reference [14]. While numerous studies have explored bio-inspired approaches [15] or machine learning [16], they have not addressed the security of services. Furthermore, to the best of our knowledge, all proposed bio-inspired trust management algorithms are based on metaheuristics, also known as problem-independent heuristics, such as ant colony optimization (ACO) [17,18] and the artificial bee colony algorithm.
In P2P networks, path selection based on ant colony optimization (ACO) offers significant advantages over other biological heuristic methods, particularly in dynamic and decentralized environments. The ant colony algorithm has demonstrated excellent performance in numerous NP-hard combinatorial optimization problems, including routing, scheduling, data mining, machine learning, and bioinformatics [19]. Meanwhile, ants make path selection based on local pheromone concentration, without the need for a global network state, which is suitable for the distributed nature of P2P networks [20]. Flooding is a typical routing algorithm used in traditional unstructured P2P networks for resource lookup. However, its method of blind message forwarding leads to substantial communication overhead. In large-scale P2P networks, even employing TTL-restricted broadcast methods can result in significant waste of network resources. The ant colony algorithm [21], due to its excellent adaptability and dynamic self-organizing capabilities, can effectively address routing issues in large-scale P2P networks.
This paper presents a novel algorithm for discovering trusted web services, which integrates a credibility-based trust model with the ant colony search algorithm. The proposed system facilitates the identification of reliable service providers by simulating the behavior of real ants in an ant colony. In summary, the primary contributions of this paper are as follows:
1. This study proposes a trust mechanism that leverages the characteristics of distributed P2P networks, grounded in social credibility, to facilitate trust evaluation among unreliable service nodes, as previously suggested [22]. In our earlier proposed trust evaluation model, we have confirmed the mechanism’s ability to identify various attacks, such as Sybil and collusion attacks. This approach enables the distributed storage and computation of trust information. The analysis reveals that the mechanism incorporates its own incentive structure designed to encourage nodes to deliver authentic services.
2. In the search for trusted web services, a group intelligent algorithms is utilized, and an ant colony algorithm is proposed as a method for discovering trusted web services. The ant information collection strategy, trust information merging strategy, routing strategy, and random fluctuation strategy, respectively, are established to guide the ant search.
3. Through experimental simulation of various attack types across different network environments, the results demonstrate that this method achieves high recall and precision in discovering trusted web services and effectively identifies trusted nodes. This ensures that trusted services are recognized promptly and efficiently.
The paper is organized as follows: Section 2 reviews the main trust and reputation models related to this paper. Section 3 describes the research question, while Section 4 introduces the algorithm’s design. Section 5 presents and discusses the theoretical analysis of the algorithm. Section 6 presents and discusses the experimental results. Lastly, Section 7 summarizes the conclusions and suggests possible future directions for this research.

2. Related Works

Currently, trust models and reputation models can be categorized into traditional systems and bio-inspired systems. Trust models in P2P networks are based on feedback information and can be roughly divided into global trust models and local trust models. Traditional systems encompass any trust management system that is not based on biological systems. For instance, the EigenTrust [11] trust model is a global trust model that calculates local trust based on the transaction history of the nodes. It then computes a unique global trust value for each node in the network through an iterative process of mutual trust among neighbors. Similarly, the trust model proposed by Dou [23] also calculates a global trust value for each node based on their historical behavior with uploaded files. On the other hand, PeerTrust [8] introduces a local trust model which considers various credit evaluation factors from different perspectives to assess the credibility of the P2P network structure. However, it has been noted that this method does not effectively penalize the malicious behavior of nodes nor provide reasonable convergence rates for large-scale P2P systems. PowerTrust [24], a reputation system that leverages a trust overlay network (TON), employs regular random walks to capture initial reputation values and forward random walks to update reputation values from power nodes. TrueTrust [25], on the other hand, calculates service responder credibility as a function of all feedback collected, without implementing any feedback filtering mechanism. It is important to note that this calculation heavily relies on service requester feedback towards service responders, conceptually reflecting the principle of retribution justice. Additionally, Ref. [26] presents an algorithm that aggregates local trusts using weighted averaging and scaling techniques before calculating global trusts through best linear unbiased estimation methods. In Ref. [27], a system is proposed that utilizes best linear unbiased estimation to account for the uncertainty of input variables in defining the trust estimation method. Trust values are calculated based on request and actual transfer rates, as well as other relevant parameters. In Ref. [28], another system is proposed that gathers statistics on the activities of participating partners within the network. This system defines two factors (local contribution and credibility) based on the collected statistics. Each counterpart is then assigned a rank depending on these credibility factors, with this rank being propagated to all participating counterparts within the network.
Compared to the multitude of trust management systems that adhere to traditional methods, only a few have looked to nature for inspiration to tackle the trust issue. In Ref. [29], a trust management system for P2P networks, which is based on a genetic algorithm, was introduced. This algorithm identifies abnormal behavior by comparing it against peer profiles and determines the trustworthiness of peers through anomaly detection, using the behaviors of reliable peers as historical data. Each peer maintains a distinct profile of others’ behaviors, derived from direct interactions within the network. TrustIs [30] is a trust model inspired by the human immune system (IS), integrating concepts from the body’s defense mechanisms against viral infections. This model combines peer reputation and object reputation to prevent the spread of corrupted files and communication with malicious peers. AntRep [12] employs ants to gather evidence about a peer’s reputation and relays this information to the requester. TACS [10] utilizes ants that follow pheromone trails, in conjunction with heuristic values, to locate trustworthy service providers. AntPS [31], on the other hand, selects trustworthy providers based on resource and trust similarity pheromone values. In another study [17], a trust management system inspired by ant colonies is proposed, utilizing problem-specific heuristics to locate trustworthy peers in a reasonable amount of time. It locates trustworthy file providers based on current trust, recommendation, feedback, and collective trust factors. In Ref. [18], a trustworthy service discovery method based on a modified ant colony algorithm (TSDMACS) is proposed. The authors significantly enhance the algorithm’s global search capability and the accuracy of credibility evaluation by introducing dynamic volatility coefficients, implementing reward and punishment strategies, and optimizing the probability model for path selection. This optimization includes the integration of trustworthy factors such as quality of service (QoS) and node reputation. Furthermore, the authors of Ref. [32] proposed an efficient neighboring selection process and multi-pheromone distribution method named enhanced flying ant colony optimization for optimization algorithms searching for the best combinations of web services to achieve workflow task functionality.

3. Question Description

Employing the ant colony algorithm for trusted web service discovery in P2P necessitates the creation of an appropriate search model for the algorithm. In a P2P network, the entire system can be envisioned as a colony network composed of numerous nests, food sources, and pathways that connect them (Figure 1). Within this network, the service query node is analogous to an ant nest, and the service provider node is akin to a food source. Each node has the potential to serve as both a service requester and a provider.
During the search process, ants symbolize messages traversing the network; they seek out specific services that meet the demand. The food source symbolizes nodes providing matching web services. The discovery process of trusted web services involves ants starting from a service query request node, collecting reputation information and web services through neighboring nodes, and returning with information from destination nodes. Ants can record their search paths to prevent circling.
Ants possess the remarkable ability to identify the most efficient routes between their nests and food sources, taking into account not only the distance but also the reliability of the nodes along these paths. This is accomplished through the release of pheromones along their search paths. As they progress, ants deposit pheromones on their trail, influencing the likelihood of other ants selecting that path based on the current concentration of the pheromone. As additional ants traverse a specific route, more pheromones are deposited, creating a positive feedback loop.
Based on the characteristics of unstructured P2P networks, and by employing ant colony algorithms and trust models, the relevant data structures within the networks are established as follows:
1. Local Service Directory (LocSdir)
The node stores and maintains information about the web services it can provide and offers a keyword vector to represent the service, facilitating the ant search. Each entry in the directory is a two-tuple {service keyword vector (kws), service description information (des)}. The keyword vector is utilized by the ant to match the service, while the service description information primarily includes the service implementation platform, functionality, call mode, and parameters. If LocSdir equals the empty set ( ), it signifies that the node does not offer any services; conversely, if LocSdir is not equal to the empty set ( ), it indicates that the node is a Service Provider (SP).
2. Neighbor Service Directory (NbrSdir)
The neighbor service directory caches the web service description information published by neighboring nodes. Each entry in this directory is a triplet { P u , des, kws}, where P u represents the neighbor of the node, des describes the services that P u can provide, and kws represents the keyword vector for those services. The neighbor service directory is generated by collecting cached service information from neighboring nodes.
3. Pheromone table ( T i )
Each node in the network must maintain a pheromone table ( T i ), where each entry consists of a pair { P u ,   τ i u }. Here, P u represents the neighbor node of P i , while τ i u indicates the intensity of the pheromone concentration on the path from node P i to its neighboring node P u . All pheromones in this initial stage table are set to a minimum value ( τ m i n ).
4. Neighbor table ( N i )
Each node in the P2P network maintains a neighbor table, where each entry is a triplet { P u , R u , m }. Here, R u signifies the reputation of node P u as recorded by node P i , and m denotes the count of evaluations node P i . Initially, the reputation of all neighbors for each node is set to 0.1, and the evaluation count is set to 1.
5. Direct reputation table ( D R i )
This table records the credibility of nodes with direct trust relationships with itself. It is accessible only by the node itself; other nodes cannot access it. Each entry in this table consists of a pair { P k , R k }, where P k represents node P i observed for another node, and R k denotes cumulative evaluation of node P k .
6. Recommended reputation table ( R R i )
This table primarily serves to record the credibility of target nodes, as determined by transaction evaluations from other nodes. Each item in this table is a triplet P j , R j , m , where the latter two components share similar meanings with those in the neighbor table. It is important to note, however, that node P j is not necessarily a neighbor of P i . The recommended reputation table R R i does not require initialization.
7. Node ( P i )
Nodes must be uniquely identified within the P2P network to facilitate user search and interaction. Furthermore, each node P i should contain six data structures, i.e., the node table is a septuple { i d ,   L o c S d i r i ,   N b r S d i r i ,   N i ,   D R i , R R i ,   T i } .
8. Ant ( A i )
Ants are message packets generated by a service request node and can be transferred between nodes to discover web services and collect the reputation information of the service node. To prevent the message from lingering in the network for too long, each ant sets a record path length (TTL). When the ant takes a step forward in its search, TTL will increase by 1. If the ant’s search exceeds the set limit, it will return along its original path. Each ant also utilizes a taboo search table (tb) with a stack structure to sequentially record its search path. The bottom node of tb is the service query node. Additionally, each ant has a target node set (tp), which is initialized by the service query node before each round of search. This set records the service provider nodes and remains unchanged throughout the searching process. As ants “crawl” during their search, they gather reputation information about their target nodes which is stored in an ant node reputation table (tpr). Both tpr and the recommended reputation table (RR) utilize data structures to record the searched nodes, their reputations, and evaluation quantities. The rlt is used to document matching service information discovered during an ant’s crawl; each entry in rlt consists of {sp, des}, where sp represents the service provider node, and des denotes service description information. In this paper, ants are defined as a septuple {id, kws, tb, tp, tpr, rlt, TTL}.
9. Ant colony (AC)
Colony refers to a group of ants residing in a nest node. In this article, it is defined as a quad group {Ants, C, c, Srlt}. The term Ants represents the collection of ants in the current iteration, while C denotes the total number of iterations of the colony. The variable c represents the current number of iterations. Additionally, Srlt stands for the result set of the service that matches the keyword. Each item in the Srlt is represented as a quad {sp, des, T, UT}. Herein, sp signifies the service provider node, and des represents service description information. Furthermore, T reflects the credibility of sp, and UT indicates its non-credibility. Both T and UT are calculated through a voting process based on credibility information about sp searched by ants in each round. In summary, T and UT serve to reflect both credibility and untrustworthiness regarding service delivery from different perspectives.

4. The Design of the Algorithm

Based on the credibility model of unstructured P2P networks, a trusted service discovery algorithm based on an ant colony system (TSDA-ACS) is proposed. TSDA-ACS incorporates various strategies, including ant routing, pheromone updating, and credit information merging. The specific content is as follows:
1. Initialization Strategy for New Nodes
In the credit mechanism, credit information is stored and distributed. For newly added nodes, or Newcomers, in the network, there is no reputation information about their neighbors, and the same applies to the neighbors regarding the Newcomers. When a Newcomer initializes its neighbor table, all credit information within is set to 0.1, accompanied by an evaluation number of 1. Likewise, the neighbor node assigns a basic credit value of 0.1 to the Newcomer in its neighbor table, also with an evaluation number of 1. The Newcomer operates as a Service Provider (SP) node, whereas its neighboring nodes act as evaluation nodes. The network model includes several scenarios.
Initially, when the network is established, nodes populate their neighbor tables according to a new node initialization policy designed to establish fundamental trust information.
During the operation of the network, when a new node joins, neighboring nodes are required to store the trust information of this Newcomer using an appropriate trust initialization strategy for Newcomers.
Upon receiving service transaction evaluation data (including the evaluation node, target node, and evaluation result), if a node lacks reputation information about the evaluation node, it will treat that evaluation node as a Newcomer to calculate the reputation for the target node.
In instances where ants are conducting searches for service information and encounter an SP node that matches their search criteria but lacks an associated trust value, this SP should be treated as a Newcomer.
2. Node Service Publishing Policy
When a service provider node has a new service for other nodes to discover and invoke, it is necessary to publish the description information and keyword vectors of the new service it offers to its neighboring nodes. As depicted in Figure 2, when a node P i creates a new service WS, it generates the service release message ( P i , WS.des, kws) and transmits it to all its neighbors. The neighbor node of P i will then be included in the neighbor service directory (NbrSdir). This method enables ants to reduce message costs during their search for web services and facilitates the discovery of more matching services.
3. Ant Information Collection Strategy
During the process of service discovery, when ant A k reaches node P i , P i is added to the taboo table A k . t p . The ant will then search for the required information in node P i , based on the carried query service keyword vector A k . k w s and the target node collection A k . t p . Ants primarily search for two types of information in P i : node reputation information in A k . t p and service description information matching with A k . k w s .
First, A k searches the recommended reputation table P i . R R and the neighbor table P i . N of the node P i . For each node P u in A k . t p , if a reputation record { P u ,   r u , m } related to node P u is present in either P i . R R or P i . N , it is added to the ant’s node reputation table A k . t p r .
Next, A k searches for the local service directory P i . L o c S d i r of the node P i . If there is a service WS in P i . L o c S d i r where W S . k w s   m a t c h e s   A k . k w s and satisfies P i A k . t p , then the service information { P i , W S . d e s } is added to A k . r l t . This indicates that Node P i provides a service meeting the ant’s requirements, without any previous iteration.
Finally, ant A k searches the neighbor’s services directory P i . N b r S d i r of Node P i . If Node P n provides a Service W S existing at P i . N b r S d i r where W S . k w s matches A k . k w s and satisfies P n A k . t p , then this Service Information { P n , W S . d e s } is added to A k . r l t . This shows that Neighbor P n of the node P i provides the Service meeting demands, without any previous iterations.
Whether ant A k searches for matching Service Information at P i . L o c S d i r or P i . N b r S d i r , in this situation, called a hit, we call ant A k the Hit ant. If an ant does not search for Matching Service Information during its life time, it is called a Missed Ant.
4. Ant Routing Selection Strategy
In the TSDA-ACS algorithm, two types of ants are utilized: ordinary ants and abnormal ants. The only difference between these two types of ants lies in the different rules of routing selection. Based on the principles of the ant colony algorithm, ant routing selection is influenced by two types of information: pheromone τ and heuristic information μ . In the network model, nodes not only store pheromones to neighboring edges but also maintain records of their neighbors’ reputation values. Therefore, in the TSDA-ACS algorithm, ant routing is associated with both pheromones and reputation. The probability that ant A k selects neighbor P s at node P c can be expressed using Equation (1), as follows:
P k c , s = [ τ c s ] α [ r s ] β u J k ( c ) [ τ c u ] α [ r u ] β ,   i f   s J k c 0 ,   o t h e r w i s e
where r s represents the reputation value of the neighbor node P s in P c . N , while jc represents the set of neighbor nodes not previously visited and whose reputation is greater than 0. Additionally, r u represents the reputation of the neighbor node P u in P c . N , and s is the node that ant k will choose next. In ACS, ants use the pseudo-stochastic proportion rule to select the moving node in the next step. The variable s uses the node selected by the probability proportion of Equation (2), as follows:
s = argmax u J k ( c ) [ τ c u ] α [ r u ] β ,   i f   q q 0 S ,   o t h e r w i s e
where s is the node to be selected by the ant k for its next move, q is a random number evenly distributed over [0, 1], and q 0 determines the probability of selecting a node most promising to visit, with q 0 0 , 1 . The value of q 0 is dynamically determined as the number of ant colony iterations increases, as shown in Equation (3):
q 0 = 1 c Q m a x C ( 1 + C c )
Here, C represents the total number of ant colony iterations, c represents the number of current round iterations, and Q m a x represents a constant used to adjust the range of q 0 (where Q m a x = 0.999 [18]).
The function curve of q 0 is illustrated in Figure 3. At the beginning of the colony iteration, when there are fewer pheromones in the network, selection depends on the reputation of neighbor nodes. As the iteration progresses and the ant colony gradually converges, it becomes important to increase randomness in ant routing and search for more service and reputation information to prevent premature convergence into a local optimal solution.
The above describes the routing rules for ordinary ants. In addition to these rules, an abnormal ant is specially set up to provide opportunities for exploration. These ants tend to choose neighbor nodes with low pheromone concentration and high credibility. Therefore, Equation (4) shows how A k s probability of choosing neighbor P s of node P c is calculated:
P k c , s = [ 1 τ c s ] α [ r s ] β u J k ( c ) [ 1 τ c u ] α [ r u ] β ,   i f   s J k c 0 ,   o t h e r w i s e
The atypical ant mechanism can increase the likelihood of subsequent visits to new nodes in the ant colony iteration. Here are the specific steps of the ant routing selection algorithm (Algorithm 1).
Algorithm 1: Ant Routing Selection Strategy.
Input: ant A k , node P c and P2P network.
Output: The next neighbor node P s that the ant A k will visit.
Method:
(1) Ant A k utilizes locally stored reputation information to access the reputation of its neighboring nodes;
(2) Ant A k uses the collected reputation information to evaluate the reputation of the current node’s neighboring nodes in P c . N . If there are unvisited high-reputation nodes, it returns; otherwise, it proceeds to Step 3.
(3) The reputation of the neighboring nodes of the current node is evaluated, and any malicious service nodes with low reputation are detected and subsequently excluded.
(4) The pseudo-stochastic selection parameter q 0 is calculated according to Formula (3);
(5)  Generate a random number rank between [0,1];
(6)  if ( r a n d q 0 )
    {
         A k selects the next neighbor node based on Formula (2) pseudorandom proportion and returns;
        return nextNode;}
    else
    {
         A k determines the next neighbor node following the Formula (4) probability rule and returns;
        return nextNode;
    }
5. The Pheromone Update Strategy
To prevent the premature search convergence of ant colonies, the classic max–min ant colony algorithm (MMAS) [33] is utilized in this paper to limit the range of pheromones on each path in the network to [ τ m i n , τ m a x ] ; if the path pheromone τ < τ m i n , then set τ = τ m i n ; if τ > τ m a x , then set τ = τ m a x . Upon creation of the network, the pheromone on each path is initially set to τ m i n .
During each iteration of the TSDA-ACS algorithm, ant A k conducts a search within the maximum number of search steps in two cases: when it hits a service and when it misses a service. If A k misses the service, it participates in pheromone update; if A k hits the service, then during its return process, the pheromone on its path needs to be updated. When A k returns from node P j to node P i , update τ i j at node P i . T i , as follows:
τ i j t + 1 = 1 ρ · τ i j t + τ i j k
τ i j k = D j k L k ( L k + 1 )
where ρ represents the pheromone volatilization rate, τ i j k represents ant A k releasing pheromone on < i , j > , L k represents ants A k traveling through path length, and D j k denotes the distance from node P j along the access path of A k to query node service. The greater D j k , the closer it is to the service provider and the higher the concentration of released pheromones on that path, functioning as an uneven pheromone update mechanism. According to Equations (5) and (6), shorter search paths lead to a greater release of pheromones, and paths that are closer to the service providers have higher concentrations of these pheromones. This strategy prevents ants from converging prematurely on neighboring nodes and ensures that they can locate nearby service providers during their search.
6. Ant Information Merging Strategy
Before the new iteration of the ant colony search begins, when all ants return to the service query node, each ant will summarize the reputation information and service information of the searched target node and update the service result set of the ant colony. This process can be specifically divided into five steps:
First, the ants will summarize their respective searched credit records. Each ant will calculate the reputation value of the target node based on the searched credit information about that node.
For a target node P i in the target node set A k . t p of ant A k , if there are n credit records { r s 1 ,   r s 2 , ,   r s n } about P i in A k . t p r , then for each record about P i , ant A k s credit calculation method is shown in Equation (7). The trust values from all n records are then added together, as shown in Equation (8).
R i k = 1 M j = 1 n ( r s j . m ) ( r s j . R )
M = j = 1 n r s j . m
where r s j . R and r s j . m represent the credibility and number of evaluations of the j-th records, respectively.
Second, the voting method is utilized to compute the credibility and reliability of the target nodes in this round.
Assume that in this iteration, there are w ants { A 1 , A 2 , , A w } which have conducted searches regarding the reputation of P i . After these ants have calculated their findings, including x ants determining a reputation greater than 0.1 and y ants determining a reputation is less than 0.1, the reliability ( T i c = x / w ) and non-credibility ( U T i c = y / w ) of the node P i are determined for the current iteration rounds (where c represents the current iteration).
Third, trust information obtained from this round’s search regarding target nodes is consolidated into the ant colony.
After calculating the reliability and unreliability of node P i s , denoted as T i and U T i respectively, within A C . S r l t , the values are updated accordingly. If both T i and U T i equal 0, indicating that P i is a service provider newly discovered in the round c − 1 search, then directly set T i = T i c , U T i = U T i c ; otherwise, the direct trust value is calculated using Formula (9), and the indirect trust value is calculated using Formula (10):
T i = γ T i + ( 1 γ ) T i c
U T i = γ U T i + ( 1 γ ) U T i c
where γ [0, 1], this article takes γ = 0.6, indicating that the algorithm focuses more on the service reputation information collected by ants in their history.
Fourth, in this round, all the successful ants will add the searched service information to the ant nest node service result set.
The search results of all successful ants in this round are merged to obtain the service information set R l t = i = 1 n A i . r l t found by this round of ants, where n indicates the number of ants that successfully hit the service in this round. Subsequently, each service information in Rlt is added to A C . S r l t , and the T and U T in the newly added service record are initialized to 0.
Fifth, recycle the ants and regenerate new ones for the next iteration to start a new round of search.
If A C . c A C . C , increase A C . c by 1 and generate m new ants. Then add all the service provider nodes in A C . S r l t to the target node t p of each ant, add the ant nest node to the taboo search table t b of each ant, add search keywords to the ant’s k w s field, and initiate a new round of search. If A C . c > A C . C , then terminate the TSDA-ACS algorithm. Based on search results from A C . S r l t , select the services provided by nodes with greater credibility than non-credibility and a larger reliability–non-credibility difference.
By integrating an ant routing strategy, an information acquisition strategy, and a pheromone update strategy, we present a trusted web service discovery algorithm based on an ant colony algorithm within an unstructured P2P network. The trusted service discovery algorithm is described as follows (Algorithm 2):
Algorithm 2: The trusted service discovery algorithm.
Input: Service query node QueryPeer, query keyword vector kws, ant colony AC, total iterations C, P2P network.
Output: Service Information Table SIT.
for c = 1 to C do
Step 1: Initialize Ant Colony Parameters
     Initialize ant colony AC with:
             Total iterations AC.C = C
             Number of ants NAnt
             Current iteration AC.c = 1
             Maximum search path length TTLmax
             Pheromone evaporation rate ρ
             Pheromone bounds [ τ m i n , τ m a x ]
             Weight factors for pheromone ( α ) and reputation ( β )
Step 2: Generate and Initialize Ants
        if AC.c > C then
            goto Step 5                             // End if iterations complete
    else
            Generate NAnt ants, including one abnormal ant
            for each ant in AC do
                    ant.tp = AC.Srlt             // Add service provider node
                    ant.tb = QueryPeer        // Start from QueryPeer
                    ant.kws = kws                // Set query keywords
                    ant.TTL = 0                     // Initialize TTL
                    ant.tpr = 0                        // Initialize pheromone
                    ant.rlt = ∅                     // Initialize result set
         end for
Step 3: Ant Search and Path Update
for each ant in AC do
         while ant.TTL < TTLmax do
                    Pi = ant.current_node                    // Current node
                    ant.tb.add(Pi)                                 // Add Pi to visited nodes
                    if Pi contains service matching kws then
                         ant.rlt.add(Pi)                            // Add Pi to result set
                         ant.return_to_QueryPeer()    //Return to QueryPeer
                         update_pheromone(ant)        //Update pheromone
                                break
                    else
                            ant.TTL += 1
                            if ant.TTL >= TTLmax then
                                 ant.return_to_QueryPeer()
                                 update_pheromone(ant)    // Update pheromone
                                 break
                            else
                                 next_node = ant.select_next_node()    // Routing strategy
                                 ant.move_to(next_node)                     // Move to next node
                                end if
                        end if
                end while
        end for
Step 4: Merge Results and Prepare for Next Iteration
        merge_ant_results(AC)     // Merge results from all ants
        destroy_ants(AC)                // Destroy returned ants
        AC.c += 1                             // Increment iteration counter
end for
  Step 5: Finalize and Return Results
SIT = generate_service_info_table(AC)    // Generate service info table
sort(SIT) by:
        Node credibility (descending)
        If credibility is equal, sort by incredibility (ascending)
return SIT

5. Theoretical Analysis of TSDA-ACS Algorithm

In unstructured P2P networks, the complexity of service discovery mainly stems from search strategies, pheromone update mechanisms, and path selection methods. Building on random walk (RW) [34] and the MMAS algorithm, our proposed algorithm enhances these strategies by incorporating several novel approaches, such as a pheromone update strategy, an ant routing strategy, and an information merging strategy. In this section, the computational complexity of TSDA-ACS is compared and analyzed against that of RW, MMAS, and TSDMACS.

5.1. Comparative Analysis of Time Complexity

In the MMAS algorithm, the time complexity mainly stems from two components: path construction and pheromone update. During path construction, each ant traverses N nodes and computes the probability O(N) for all candidate nodes at each step, resulting in a total time complexity of O(N2). Consequently, for M ants, this leads to a complexity of O(M·N2). The pheromone update process requires consideration of all edges O(E), where E represents the number of edges. Therefore, the overall time complexity can be expressed as O(C·(M·N2 + E)).
By contrast, the RW algorithm, which is associated with a single search step size L, allows each ant to randomly choose its next hop node and may traverse up to N nodes. Therefore, the total time complexity over multiple iterations is expressed as O(C·M·L).
The TSDMAC algorithm enhances MMAS by integrating a trust evaluation mechanism; as a result, pheromone updates require additional computations that include dynamic weights. Hence, the total time complexity over several iterations is represented as O(C·(M·N2 + E·T)).
Similarly, TSDA-ACS introduces a dynamic trust evaluation mechanism based on MMAS, which enables trusted services through pheromone updates. Its total time complexity across multiple iterations is identical to that of TSDMAC: O(C·(M·N2 + E·T)). A comparative analysis of the time complexities for these four algorithms is presented in Table 1.

5.2. Comparative Analysis of Spatial Complexity

In the MMAS algorithm, the spatial complexity is associated with the storage of the pheromone matrix (N × N) and the paths that each ant must store (M·N), resulting in a total spatial complexity of O(N2 + M·N). In contrast, for the random walk (RW) algorithm, each ant only needs to store its own path, leading to a total space complexity of O(L). The TSDMAC algorithm requires not only an information matrix but also dynamic parameters to be stored; thus, its total space complexity is O(N2 + N + M·N). Similarly, TSDA-ACS exhibits a total space complexity of O(N2 + N + M·N), identical to that of TSDMAC. A comparative analysis of the spatial complexities among these four algorithms is presented in Table 2.
From this analysis, it becomes evident that the time complexities of MMAS, TSDMACS, and TSDA-ACS are comparable and primarily depend on factors such as the number of ants (M), nodes (N), edges (E), and iterations (C). The random walk algorithm demonstrates the lowest time complexity due to its lack of pheromone updates and complex path selection strategies. MMAS is particularly well-suited for static or semi-static optimization problems. Conversely, random walk excels in scenarios requiring rapid searches with extremely limited resources and minimal quality requirements for solutions. Both TSDMACS and TSDA-ACS are designed for environments characterized by dynamic changes while incorporating real-time trust assessments.
Notably, MMAS exhibits the lowest spatial complexity, as it does not require storing reputation values or accounting for time sensitivity. In contrast, both TSDMACS and TSDA-ACS exhibit relatively high spatial complexities due to their need for additional storage related to reputation values or both reputation values and time sensitivity, thus demanding significant computational and storage resources. From this analysis, it can be concluded that although our proposed algorithm increases resource consumption during dynamic evaluation processes and path searches within complex environments compared to that of similar algorithms, it does so without incurring additional overheads.

6. Results and Discussions

The experiment detailed in this paper utilizes Stanford University’s open-source P2P Simulator Query Cycle Simulator [35] to implement the algorithm and record the experimental data. The TSDA-ACS algorithm involves ants searching not only for the target service but also for the reputation information of the service node within the P2P network. Consequently, it is essential to invoke the service to generate the associated reputation information. Prior to executing the TSDA-ACS algorithm on the newly created P2P network, multiple threads are initiated to run concurrently. Each thread randomly selects a service caller node from the network and invokes the service of a randomly chosen service provider node with each execution. Upon completion of a service call, the evaluation of the service pair is disseminated throughout the network, updating the node’s reputation. As multiple threads operate over a period, the accumulation of certain node reputations in the P2P network begins, marking the initiation of the TSDA-ACS algorithm.
As previously mentioned, only a few studies have concentrated on reputation and trust management systems within P2P networks, utilizing bio-inspired heuristics.
To validate the efficacy of the TSDA-ACS algorithm, this paper presents a comparison with the RW, MMAS, and TSDMACS algorithms. The RW algorithm selects a neighbor of the current node at random as the search node, without employing pheromone or node reputation information. The MMAS algorithm utilizes pheromone information and heuristic information, but disregards reputation information; it employs basic local pheromone update methods, as well as global pheromone update methods. Our algorithm, based on MMAS, has enhanced these strategies by incorporating new ones, such as a pheromone update strategy, an ant routing strategy, and an information merging strategy. The TSDMACS algorithm is a trusted service discovery method that combines the ant colony algorithm with a P2P network. A horizontal comparison with this algorithm highlights the performance enhancement achieved by the TSDA-ACS algorithm. The feasibility of the TSDA-ACS algorithm can be ascertained through comparison with the RW algorithm, and the effectiveness of the new strategy can be affirmed by comparing it with the MMAS algorithm.
In P2P networks, services are distributed and stored across each node. Hence, the service recall rate of an algorithm is a critical metric for evaluating its performance. Moreover, P2P networks encompass a variety of services, some of which may be malicious. To reduce exposure to malicious services, nodes and services that fail to meet certain requirements are filtered out. The accuracy rate of services is also a significant factor in measuring algorithm performance. The relevant evaluation indicators for the algorithm are defined as follows:
Definition 1.
Trusted Service Recall Rate refers to the proportion of trusted web services discovered by the algorithm to the total number of trusted web services in the network so far (e.g., Equation (11), where TSResult represents the number of different trusted services discovered by the algorithm). This total number (allTSInP2P) is unpredictable within an unstructured P2P network but needs to be set during experimentation to test efficiency.
T S R e c a l l = T S R e s u l t a l l T S I n P 2 P
Definition 2.
Trusted Service Precision (TSPrecision) refers to the proportion of trusted services searched by the algorithm in the total number of services searched up to the current iteration. All services searched by the algorithm, including malicious and trusted types, are considered. In Equation (12), |AC.Srlt| represents the total number of services searched by the algorithm up to this point. If A C . S r l t = 0 ,  it indicates that no service node has yet been found.
T S P r e c i s i o n = T S R e s u l t | A C . S r l t | ,   | A C . S r l t | > 0 0 ,   A C . S r l t = 0
Definition 3.
Trusted Service Single-Hop Recall (TSRSingleHop) refers to the ratio of trusted service recall obtained by the algorithm in the current iteration to the total number of queried messages. In Equation (13), af = 100 represents the amplification factor and totalMessages represents the total number of messages in the network, equivalent to the TSRecall message acquisition cost.
T S R S i n g l e H o p = a f × T S R e c a l l t o t a l M e s s a g e s
Definition 4.
Trusted Service Single-Hop Precision (TSTSingleHop) is defined as a ratio between trusted service precision and the total number of queried messages. In Equation (14), af = 100 is again used as an amplification factor, while totalMessages represents the overall message count within the network.
T S P S i n g l e H o p = a f × T S P r e c i s i o n t o t a l M e s s a g e s
In this paper, the recall rate and precision rate from the field of information retrieval are used as evaluation metrics to reflect the success rate of the TSDA-ACS algorithm in searching for trusted web services within unstructured P2P networks and its ability to filter out malicious service nodes. The single-hop recall rate and single-hop precision rate for trusted services are employed to evaluate the algorithm’s efficiency, considering the message cost during single-hop queries.

6.1. Static Environment Experiment

The static experiment refers to a scenario where the network size and structure remain constant throughout the service discovery process. In this experiment, the scale (n) of the unstructured P2P network is set to 10,000, with the proportion of trusted service nodes and malicious service nodes both at 0.5%, resulting in 50 nodes each. The total number of iterations for the ant colony (C) is set to 20, and the number of ants (m) is 10, including one abnormal ant. In this article, we employ a mixed method that combines theoretical analysis with experimental verification to determine the parameters. Firstly, we establish the parameter range based on the convergence theory of ACO and previous research experiences. Secondly, we conduct parameter optimization using the control variable method and the orthogonal experimental method. The upper limit and lower limit of pheromone change are τ m a x = 0.999 and τ m i n = 0.001, respectively; the maximum number of steps sought by ants was T T L m a x = 30, with an impact factor for pheromone (α) set at 1.0 and an impact factor for reputation information (β) at 1.0 [18]. Through experimental comparison, when the volatilization rate of pheromones is ρ = 0.177, a balance is achieved between convergence speed and solution mass.
Given the inherent randomness within ant colony algorithms, results from a single experiment may not be representative. Consequently, this experiment is repeated ten times, and the average value of evaluation indicators across all experiments is utilized for plotting purposes.
The trusted service recall rate and trusted service accuracy rate from experimental data using four algorithms (RW, MMAS, TSDMACS, and TSDA-ACS) are presented in Figure 4 and Figure 5. As depicted in Figure 4 and Figure 5, throughout the iteration process, both the recall rate and precision rate for trusted services using the TSDA-ACS algorithm consistently outperform those achieved by other comparison algorithms. TSRecall reaches as high as 77% after just seven iterations, indicating early success for the TSDA-ACS algorithm. At the conclusion stage, TSRecall stands at impressive levels, reaching up to 82%, while TSPrecision achieves a remarkable level, reaching 91%. Thus, it can be seen that the recall rate of the TSDA-ACS algorithm is higher than that of the TSDMACS algorithm, and the recall rate of the MMAS algorithm is better than that of the RW algorithm. This indicates that the pheromone and heuristic information of the ant colony algorithm exert a good guiding effect, guiding ants to discover services as soon as possible. Dynamic trust assessment has been introduced into the TSDMACS and TSDA-ACS algorithms, resulting in a high success rate in the early stages of iteration. Through this set of experiments, it can be verified that TSDA-ACS exhibits a high ability to discover trusted services.
The TSRecall metric primarily assesses the service discovery capabilities of the algorithm and does not adequately reflect its ability to filter out malicious services. As illustrated in Figure 5, the precision rates of the four algorithms indicate that TSDA-ACS exhibits a significantly higher accuracy during the iterative process compared to RW, MMAS, and TSDMACS. This disparity arises because neither MMAS nor RW incorporate node reputation information in their search processes, whereas TSDA-ACS and TSDMACS leverage this critical data for routing selection. Furthermore, TSDA-ACS demonstrates superior accuracy over TSDMACS. The TSDA-ACS algorithm employs a reputation evaluation mechanism; when an ant selects a route at its current node, it first assesses the reputations of neighboring nodes, based on historical service call data. If it identifies any malicious nodes with low reputations among these neighbors, it actively avoids them and subsequently selects a route using traditional ant colony optimization techniques. This approach significantly enhances the accuracy of trusted service lookups. In contrast, the TSDMACS algorithm implements a pheromone punishment mechanism aimed at malicious nodes, which provides some capability to differentiate between good and bad services. Its precision rate for trusted services is markedly higher than that of both the MMAS and RW algorithms. However, both MMAS and RW lack an effective reputation evaluation mechanism for trusted services, which makes it challenging to accurately differentiate between various types of reputational standings among target service provider nodes. As a result, their accuracy rates for reliable services have plateaued at around 50%, impeding potential enhancements in performance.
To assess the efficacy of malicious service detection, a comparative analysis was conducted on the number of malicious services identified by various algorithms. Figure 6 illustrates how the quantity of malicious services detected by each algorithm evolves as iterations progress. The number of malicious services uncovered by both the MMAS and RW algorithms gradually increases with ongoing searches. In contrast, the TSDA-ACS and TSDMACS algorithms do not exhibit an increase in detected malicious service nodes with additional iterations. Notably, TSDA-ACS identifies fewer malicious service nodes than does the TSDMACS algorithm. This discrepancy can be attributed to the incorporation of a dynamic trust model [18] within TSDA-ACS, along with an initialization strategy for new nodes. Through trust evaluation mechanisms, nodes exhibiting low reputation can be effectively isolated; consequently, as ants deposit more pheromones along trusted paths, they cease to discover new malicious service nodes in subsequent iterations. Experimental results demonstrate that this algorithm possesses a robust capability for identifying malicious nodes. Furthermore, different types of attacks, e.g., Sybil or collusion, have been validated in reference [18].
To verify the execution efficiency and message cost of the algorithm, a comparative analysis was conducted on the single-hop recall and precision of the algorithm in searching for trusted services. Figure 7 and Figure 8, respectively, display variation curves for single-hop recall rates and precision rates for trusted services throughout iterative processes. The TSDA-ACS algorithm consistently demonstrates higher single-hop query efficiency than do the RW, MMAS, and TSDMACS algorithms, indicating that the routing of the TSDA-ACS algorithm follows a pseudo-random ratio rule. During the initial iteration, the algorithm prioritizes nodes with high reputation for access, resulting in a high recall rate of single-hop trusted services. However, as the ant colony matures over subsequent iterations, fewer new trusted services are discovered, leading to a decline in single-hop query efficiency. Through this implementation, it can be proven that TSDA-ACS exhibits high single-hop precision, and the ant routing selection strategy of this algorithm plays a key role in reducing system computation and network transmission overhead without the need for multiple iterations or complex steps.
Figure 8 illustrates that the single-hop accuracy rate of the TSDA-ACS algorithm surpasses that of the RW, MMAS, and TSDMACS algorithms, particularly when the ant colony has not yet converged during iteration. In later stages, as convergence occurs within the ant colony and new trusted services become scarce, ants primarily focus on collecting reputation information rather than discovering new services, which causes a decline in the single-hop accuracy rate.
In conclusion, a comparison reveals that the TSDA-ACS algorithm surpasses the RW, MMAS, and TSDMACS algorithms in terms of recall rate and precision rate. Additionally, it demonstrates superior performance in single-hop query efficiency. This indicates that integrating a reputation model with an ant colony algorithm is not only viable but also beneficial. The query efficiency of this hybrid approach exceeds that of both RW and MMAS algorithms. From the analysis presented, it is evident that the trusted service algorithm in this article achieves a balance between coverage and accuracy in single-hop scenarios, validates the trust evaluation model within the algorithm, and decreases system computation and network overhead.

6.2. Static Environment Experiment with Different Scales

To verify the scalability of the algorithm, 10 independent experiments were conducted, each with a different network scale. In the experiments, the network scale increased from 10,000 to 28,000 in increments of 2000, while maintaining a constant number of malicious and trusted services. Each experiment was repeated 10 times, and the average value of the index at the completion of each iteration from these repetitions was used as the index value for that experiment.
Figure 9 and Figure 10 illustrate the recall rate and precision rate for trusted services in networks of varying scales, respectively. The recall rates of various algorithms have exhibited a certain downward trend, which is attributed to the expansion of the network scale, while the absolute number of services remains constant, thereby diluting the density of services and increasing the difficulty for ant colonies to discover new services. However, despite this trend, the TSDA-ACS algorithm has demonstrated an average retrieval rate for trusted services of 70.52% across these 10 independent experiments, with an accuracy rate at 91.02%. This indicates that even amidst varying network scales, our algorithm consistently maintains relatively high service recall and accuracy rates, highlighting its robustness. The adaptability and scalability demonstrated by our reputation model and algorithm are crucial, given the ever-evolving nature of P2P networks. Furthermore, both tabulated data and graphical indicators clearly show that our proposed algorithm model possesses distinct advantages over the RW, MMAS, and TSDMACS algorithms. Compared to RW algorithms, the TSDA-ACS algorithm exhibits more directed, faster, and accurate search capabilities. Additionally, when compared to MMAS, it excels in filtering out malicious nodes due to its incorporation of service node reputation for routing purposes. In contrast to TSDMACS, the TSDA-ACS algorithm introduces an anomalous ant mechanism that enhances the likelihood of newly added nodes being accessed during later stages of ant colony iteration. In conclusion, the TSDA-ACS algorithm proves effective across various network scale environments.

6.3. Dynamic Environment Experiment

A dynamic network is characterized by nodes that can leave at any moment, while new nodes may join at any time. This node behavior results in dynamic changes to the network’s scale and topology. The aim of this experiment is to verify the stability of the TSDA-ACS algorithm within dynamic P2P networks. The reputation mechanism in TSDA-ACS depends on reputation information that is distributed and stored across the network. If all nodes that hold reputation information depart from the network and no new service evaluation records are created during the iterative process, it becomes evident that the query efficiency of the TSDA-ACS algorithm will be comparable to that of the MMAS algorithm. In this experiment, the network’s topology and nodes underwent dynamic changes throughout the algorithm’s operation. The network size was set to 10,000 nodes, with 20 iterations conducted by an ant colony while maintaining a constant number of services within the network. Prior to each iteration, 500 service consumption nodes were randomly selected for removal, while 500 new service consumption nodes were added. Initially, newly added nodes and isolated nodes that have just joined the network do not generate any new service call log information. Therefore, the reputation evaluation of these nodes is based on initial values for network activity, while all other parameters related to both networking and ant colony optimization remain consistent with those used in static network experiments.
The recall rate and precision rate of trusted services are illustrated in Figure 11 and Figure 12, respectively. It is evident from the figures that, compared to the results in a static network environment, the TSDA-ACS algorithm experiences a decrease in both the recall rate and precision rate of trusted services when there is frequent joining and leaving of nodes in the network. This indicates that service discovery becomes increasingly challenging in dynamic network environments characterized by constant changes and growing scale. The observed decline in accuracy can be attributed to the loss of reputation information resulting from the departure of numerous nodes from the network. Nevertheless, despite this challenge, the TSDA-ACS algorithm continues to achieve a high level of reliability in regards to service accuracy, reaching 79.5% at the end of its iterations, owing to its robust distributed storage mechanism for reputation information. In comparison with other algorithms, TSDA-ACS demonstrates enhanced performance under these conditions. This improvement is largely due to the effective application of relevant routing strategies tailored for dynamic network environments. The initialization strategy for new nodes facilitates local processing of information, while the node service publishing strategy restricts publications to neighboring nodes, thereby reducing message costs and aiding in the search for more compatible services. The ant routing strategy employs a pseudo-random proportional rule for selecting subsequent mobile nodes, ensuring both accuracy and reliability in next-hop node selection. Additionally, the pheromone update mechanism incorporates both local and global updates to optimize resource efficiency within the algorithm. These strategies collectively enhance the distributed execution efficiency of TSDA-ACS. Consequently, it remains capable of delivering high levels of accuracy and query efficiency for trusted services within dynamic network environments—demonstrating effective strategies specifically designed for such scenarios.

7. Conclusions

This paper tackles the problem of detecting malicious services within unstructured networks and introduces a reliable web service discovery algorithm based on the ant colony algorithm. The algorithm’s efficacy is confirmed through experiments that include the reputation assessment of service nodes and a group-based search strategy to aid in the identification of trusted services. The algorithm’s performance is measured using several metrics: the recall ratio of trusted services to evaluate efficiency, the accuracy rate of trusted services to gauge filtering capabilities, and the single-hop recall rate and accuracy rate of trusted services to assess the efficiency of single-hop service discovery. Three distinct experimental settings are taken into account, i.e., a static network environment, a static network environment of varying scales, and a dynamic network environment. The findings indicate that the proposed algorithm performs effectively in dynamic P2P network settings. Compared to classical random walk algorithms and max–min ant colony algorithms, our method demonstrates superior precision and recall rates for trust service discovery, highlighting its efficacy in complex network scenarios.

Author Contributions

Z.Y. made the greatest contribution. He is the main contributor to this work, including determining the method scheme of the paper, providing the overall organization and implementation, completing the inference and proof of the algorithm, verifying the scheme and designing the experiment, and writing the paper. H.S. completed the experimental part of the algorithm in this article, including providing code completion, debugging, and the final conclusion. H.Z. made significant contributions to the research presented in this manuscript and to the experimental comparison in this revision process, as well as to the performance analysis and experimental implementation of the previous three algorithms. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Natural Science Foundation Project of Jilin Province (20220101140 JC); the Scientific Research Project of the Education Department of Jilin Province (JJKH20210544KJ, JJKH20210543KJ); and the School–Enterprise Joint Technology Innovation Laboratory of Identifying Polypeptide Anticancer Function of Jilin Province, Tonghua 134000, China.

Data Availability Statement

The original contributions presented in the study are included in the article; further inquiries can be directed to the corresponding author.

Conflicts of Interest

Author Sheng Hehe was employed by the company Beijing Huawei Digital Technology Co. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

References

  1. Bhise, A.M.; Kamble, S.D. Detection and Mitigation of Sybil Attack in Peer-to-peer Network. Int. J. Comput. Netw. Inf. Secur. 2016, 8, 56–63. [Google Scholar] [CrossRef]
  2. Barclay, I.; Simpkin, C.; Bent, G.; La Porta, T.; Millar, D.; Preece, A.; Taylor, I.; Verma, D. Trustable service discovery for highly dynamic decentralized workflows. Future Gener. Comput. Syst. FGCS 2022, 134, 236–246. [Google Scholar] [CrossRef]
  3. Zhang, D.G.; Gao, J.X.; Liu, X.H.; Zhang, T.; Zhao, D.X. Novel approach of distributed & adaptive trust metrics for MANET. Wirel. Netw. 2019, 25, 3587–3603. [Google Scholar]
  4. Paul, A.; Dhar, S.; Roy, S. Applying interrater reliability measure for user credibility assessment in reputation-oriented service discovery. Web Intell. 2022, 21, 167–180. [Google Scholar] [CrossRef]
  5. Desai, S. Nene Mult hop Trust Evaluation Using Memory Integrity in Wireless Sensor Networks. IEEE Trans. Inf. Forensics Secur. 2021, 16, 4092–4100. [Google Scholar] [CrossRef]
  6. Ding, S.; Yue, Z.; Yang, S.; Niu, F.; Zhang, Y. A novel trust model based overlapping community detection algorithm for social networks. IEEE Trans. Knowl. Data Eng. 2020, 32, 2101–2114. [Google Scholar] [CrossRef]
  7. Kurdi, H.A. HonestPeer: An enhanced EigenTrust algorithm for reputation management in P2P systems. J. King Saud Univ.-Comput. Inf. Sci. 2015, 27, 315–322. [Google Scholar] [CrossRef]
  8. Xiong, L.; Liu, L. PeerTrust: Supporting Reputation-Based Trust for Peer-to-Peer Electronic Communities. IEEE Trans. Knowl. Data Eng. 2004, 16, 843–857. [Google Scholar] [CrossRef]
  9. Marti, S.; Garcia-Molina, H. Limited Reputation Sharing in P2P Systems. In Proceedings of the 5th ACM Conference on Electronic Commerce, New York, NY, USA, 17–20 May 2004; ACM Press: New York, NY, USA, 2004. [Google Scholar]
  10. Mármol, F.G.; Pérez, G.M.; Skarmeta, A.F.G. TACS, a Trust Model for P2P Networks. Wirel. Pers. Commun. 2008, 51, 153–164. [Google Scholar] [CrossRef]
  11. Kamvar, S.D.; Schlosser, M.T.; Garcia-Molina, H. The eigentrust algorithm for reputation management in P2P networks. In Proceedings of the 12th International Conference on World Wide Web, Budapest, Hungary, 20–24 May 2003; ACM: New York, NY, USA, 2003; pp. 640–651. [Google Scholar]
  12. Wang, W.; Zeng, G.; Yuan, L. Ant-based Reputation Evidence Distribution in P2P Networks. In Proceedings of the 2006 Fifth International Conference on Grid and Cooperative Computing (GCC′06), Changsha, China, 21–23 October 2006. [Google Scholar]
  13. Liu, X.; Deng, Y. A new QoS-aware service discovery technique in the Internet of Things using whale optimization and genetic algorithms. J. Eng. Appl. Sci. 2024, 71, 4. [Google Scholar] [CrossRef]
  14. Avval, D.B.; Heris, P.O.; Navimipour, B.Y.S. A new QoS-aware method for production scheduling in the industrial internet of things using elephant herding optimization algorithm. Clust. Comput. 2023, 26, 3611–3626. [Google Scholar] [CrossRef]
  15. Bayona, E.; Sierra-García, J.E.; Peñas, M.S. Improving Safety and Efficiency of Industrial Vehicles by Bio-Inspired Algorithms. Expert Syst. 2025, 42, e13836. [Google Scholar] [CrossRef]
  16. Wang, Y.; Mahmood, A.; Sabri, M.F.M.; Zen, H.; Kho, L.C. MESMERIC: Machine Learning-Based Trust Management Mechanism for the Internet of Vehicles. Sensors 2024, 24, 863. [Google Scholar] [CrossRef] [PubMed]
  17. Al-Otaiby, N.; Alhindi, A.; Kurdi, H. AntTrust: An Ant-Inspired Trust Management System for Peer-to-Peer Networks. Sensors 2022, 22, 533. [Google Scholar] [CrossRef]
  18. Sheng, G.; Wen, T.; Guo, Q.; Song, X. Trustworthy service discovery based on a modified ant colony algorithm. J. Commun. 2013, 34, 37–48. [Google Scholar]
  19. Lin, B.C.; Mei, Y.; Zhang, M. Automated design of state transition rules in ant colony optimization by genetic programming: A comprehensive investigation. Memetic Comput. 2025, 17, 2. [Google Scholar] [CrossRef]
  20. Deng, Y.; Wang, F.; Ciura, A. Ant colony optimization inspired resource discovery in P2P Grid systems. J. Supercomput. 2009, 49, 4–21. [Google Scholar] [CrossRef]
  21. Dorigo, M.; Gambardella, L.M. Ant colony system: A cooperative learning approach to the traveling salesman problem. IEEE Trans. Evol. Comput. 1997, 1, 53–66. [Google Scholar] [CrossRef]
  22. Zhengwang, Y.; Hehe, S. A Trust Evaluation Model Based on Social Rules in a Distributed Network Environment. In Proceedings of the 2023 15th International Conference on Communication Software and Networks (ICCSN), Shenyang, China, 21–23 July 2023; pp. 137–142. [Google Scholar]
  23. Wen, D.; Wang, H.M.; Yan, J.; Zou, P. A Recommendation-Based Peer-to-Peer Trust Model. J. Softw. 2004, 15, 571–583. [Google Scholar]
  24. Zhou, R.; Hwang, K. PowerTrust: A Robust and Scalable Reputation System for Trusted Peer-to-Peer Computing. IEEE Trans.Parallel Distrib. Syst. 2007, 18, 460–473. [Google Scholar] [CrossRef]
  25. Meng, X.; Zhang, G. TrueTrust: A feedback-based trust management model without filtering feedbacks in P2P networks. Peer-to-Peer Netw. Appl. 2020, 13, 175–189. [Google Scholar] [CrossRef]
  26. Awasthi, S.K.; Singh, Y.N. Absolute Trust: Algorithm for Aggregation of Trust in Peer-to-Peer Networks. IEEE Trans. Dependable Secur. Comput. 2016, 19, 176–189. [Google Scholar] [CrossRef]
  27. Gupta, R.; Singh, Y.N.; Goswami, A. Trust estimation in peer-to-peer network using BLUE. Peer-to-Peer Netw. Appl. 2021, 14, 888–897. [Google Scholar] [CrossRef]
  28. Singh, S.K.; Kumar, C.; Nath, P. Local Contribution (LC) and Trustworthiness Factors to Induce Fairness in P2P Networks. Wirel. Pers. Commun. 2019, 107, 303–323. [Google Scholar] [CrossRef]
  29. Selvaraj, C.; Anand, S. Peer profile-based trust model for P2P systems using genetic algorithm. Peer-to-Peer Netw. Appl. 2011, 5, 92–103. [Google Scholar] [CrossRef]
  30. Xu, X. A Trust-based Immune Strategy for File Pollution in P2P Networks. Int. J. Secur. Its Appl. 2015, 9, 271–280. [Google Scholar] [CrossRef]
  31. Li, J.; Pan, Q.; Xie, S. Research on Peer Selection in Peer-to-Peer Networks using Ant Colony Optimization. In Proceedings of the Fourth International Conference on Natural Computation, Jinan, China, 18–20 October 2008. [Google Scholar]
  32. Dahan, F.; El Hindi, K.; Ghoneim, A.; Alsalman, H. An Enhanced Ant Colony Optimization Based Algorithm to Solve QoS-Aware Web Service Composition. IEEE Access 2021, 9, 34098–34111. [Google Scholar] [CrossRef]
  33. Stützle, T.; Hoos, H.H. MAX-MIN ant system. Future Gener. Comput. Syst. 1999, 16, 889–914. [Google Scholar] [CrossRef]
  34. Gkantsidis, C.; Mihail, M.; Saberi, A. Random walks in peer-to-peer networks: Algorithms and evaluation. Perform. Eval. 2006, 63, 241–263. [Google Scholar] [CrossRef]
  35. Stanford University. Stanford P2P Sociology Project. Available online: http://p2p.stanford.edu/www/publications.htm (accessed on 20 May 2003).
Figure 1. P2P ant colony search model.
Figure 1. P2P ant colony search model.
Mathematics 13 01402 g001
Figure 2. Node service publishing.
Figure 2. Node service publishing.
Mathematics 13 01402 g002
Figure 3. q 0 curve.
Figure 3. q 0 curve.
Mathematics 13 01402 g003
Figure 4. Recall of a trusted service.
Figure 4. Recall of a trusted service.
Mathematics 13 01402 g004
Figure 5. Trusted service precision.
Figure 5. Trusted service precision.
Mathematics 13 01402 g005
Figure 6. Number of malicious services.
Figure 6. Number of malicious services.
Mathematics 13 01402 g006
Figure 7. Trusted service single-hop recall.
Figure 7. Trusted service single-hop recall.
Mathematics 13 01402 g007
Figure 8. Trusted service single-hop precision.
Figure 8. Trusted service single-hop precision.
Mathematics 13 01402 g008
Figure 9. Recall rate of trusted services at different scales.
Figure 9. Recall rate of trusted services at different scales.
Mathematics 13 01402 g009
Figure 10. The precision of trusted service for different network scales.
Figure 10. The precision of trusted service for different network scales.
Mathematics 13 01402 g010
Figure 11. Recall rate of trusted service under dynamic networks.
Figure 11. Recall rate of trusted service under dynamic networks.
Mathematics 13 01402 g011
Figure 12. Trusted service precision in dynamic networks.
Figure 12. Trusted service precision in dynamic networks.
Mathematics 13 01402 g012
Table 1. Comparison of time complexity.
Table 1. Comparison of time complexity.
AlgorithmTime ComplexityCritical Factor
MMASO(C·(M·N2 + E))Ant count M, node count N, edge count E, iteration count C
RWO(C·M·L)Step length L
TSDMACSO(C·(M·N2 + E·T))Dynamic parameter T
TSDA-ACSO(C·(M·N2 + E·T))Dynamic parameter T
Table 2. Comparison of spatial complexity.
Table 2. Comparison of spatial complexity.
AlgorithmSpace ComplexityCritical Factor
MMASO(N2 + M·N)Pheromone matrix O(N2), ant path O(M·N)
RWO(L)Path history O(L)
TSDMACS O(N2 + N + M·N)Pheromone matrix O(N2), dynamic parameter O(N), ant path O(M·N)
TSDA-ACS O(N2 + N + M·N)Pheromone matrix O(N2), dynamic parameter O(N), ant path O(M·N)
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ye, Z.; Sheng, H.; Zou, H. Trusted Web Service Discovery Based on a Swarm Intelligence Algorithm. Mathematics 2025, 13, 1402. https://doi.org/10.3390/math13091402

AMA Style

Ye Z, Sheng H, Zou H. Trusted Web Service Discovery Based on a Swarm Intelligence Algorithm. Mathematics. 2025; 13(9):1402. https://doi.org/10.3390/math13091402

Chicago/Turabian Style

Ye, Zhengwang, Hehe Sheng, and Haiyang Zou. 2025. "Trusted Web Service Discovery Based on a Swarm Intelligence Algorithm" Mathematics 13, no. 9: 1402. https://doi.org/10.3390/math13091402

APA Style

Ye, Z., Sheng, H., & Zou, H. (2025). Trusted Web Service Discovery Based on a Swarm Intelligence Algorithm. Mathematics, 13(9), 1402. https://doi.org/10.3390/math13091402

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop