A decentralized service combination method considering node selfishness
Patent Information
- Application Number
- CN202310248327.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-03-15
AI Technical Summary
[0005]本发明目的是为了克服当前去中心化服务组合技术效率较低、构建方案质量不足、较少考虑服务提供商间数据隐私和自私性等问题,提出了一种考虑节点自私性的去中心化服务组合方法
[0028]为了克服当前去中心化服务组合技术效率较低、构建方案质量不足、较少考虑服务提供商间数据隐私和自私性等问题,本发明提供了一种考虑节点自私性的去中心化服务组合方法。方法首先对服务提供商的自私性进行建模。然后,为了提高组合效率和解决方案的质量,在历史组合中利用了经验规则,提出了需求模式、服务模式和关联矩阵来挖掘历史组合中的共性,并设计了一个多标签分类模型提取特性,缩小了候选服务的规模。基于这些服务,设计了一个服务组合算法和服务协调协议来协调各服务提供商并构建服务解决方案。为了保护服务提供商之间的隐私,基于一个成熟的联邦学习框架来训练模型,并在算法和协议设计中避免隐私泄露。
Smart Images

Figure CN116471281B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of service computing technology, and in particular to a decentralized service composition method that takes into account node selfishness. Background Technology
[0002] With the rapid development of theories and technologies such as big data and cloud computing, a large number of software services have emerged on the internet. Various physical resources and human services are also accessing the internet through virtualization and the Internet of Things (IoT) technologies, establishing collaboration and integration with software services. This has led to increasingly complex user demands, which are difficult to meet with single services or pre-defined service solutions. Therefore, it is necessary to dynamically aggregate various services to provide users with composite service solutions that not only meet their functional needs but also optimize their non-functional needs such as quality and value.
[0003] As a countermeasure, researchers have proposed service composition and designed a series of methods. These methods are optimized for centralized service repositories and can aggregate multiple services into a single service solution. However, these methods often fall short in application, mainly because services are distributed differently in reality, exhibiting the following characteristics: (1) Services are usually distributed across different third-party service platforms or suppliers (nodes). These platforms are distributed in decentralized service networks without a centralized service resource repository for service composition; (2) In decentralized service networks, a single platform often lacks the capacity to provide a service solution independently, requiring collaboration between platforms; (3) Complete data, such as user requirements and complete service repositories, are not shared between platforms due to trade secrets or competition. Furthermore, platforms are self-serving, such as refusing to provide services to other platforms due to insufficient resources. This invention refers to this type of service composition, where platforms both collaborate and compete in a decentralized environment, as decentralized service composition.
[0004] Currently, some researchers are attempting to address the decentralized service composition problem from different perspectives, such as extending traditional service composition methods to decentralized environments, designing middleware to ensure data security during interactions, or designing decentralized algorithms to directly solve the problem. However, these methods generally suffer from the following problems: (1) they generally perform poorly in terms of execution efficiency and solution quality, making it difficult to achieve performance comparable to traditional methods; (2) they rarely consider the imperfect data sharing between service providers, with most research focusing on privacy between users and service providers; (3) they do not consider the selfishness of service providers, but in reality, service providers cannot be completely selfless. Therefore, existing methods struggle to support the rapid and accurate construction of service solutions in decentralized environments. Summary of the Invention
[0005] The purpose of this invention is to overcome the problems of low efficiency, insufficient quality of construction schemes, and lack of consideration for data privacy and selfishness among service providers in current decentralized service composition technologies. It proposes a decentralized service composition method that takes into account the selfishness of nodes.
[0006] This invention is achieved through the following technical solution: This invention proposes a decentralized service composition method that considers node selfishness, the method specifically being:
[0007] Step S1: Model the selfishness of service providers; In a decentralized service network, when other service providers (i.e., service nodes) request a certain node to use a certain service, and that node is unwilling to provide the service for some reason, it is said that the node is selfish towards that service; The selfishness of a node towards each service is different, and it is evaluated by the selfishness degree; Using the selfishness degree definition formula, the service provider calculates the selfishness degree of each service and updates it in a timely manner at runtime;
[0008] Step S2: Select appropriate candidate service patterns; use demand patterns, service patterns, and association matrices to extract commonalities from historical combinations; nodes first use demand patterns to match demands, called demand matching. Demand matching decomposes demands into a set of matching demand patterns and a set of unmatched sub-demands; then, based on the current environment, these demand patterns are mapped to service patterns through the association matrix, which gives the association probability of each service pattern. Service patterns with high association probabilities are used for subsequent combinations.
[0009] Step S3: Reduce the search space for candidate services; train a multi-label classification model under the federated learning framework to find suitable services for unmatched sub-requirements from step S2;
[0010] Step S4: Coordinate all nodes to build a service solution; use a centralized service composition method to optimize the candidate service patterns and services in steps S2 and S3, build an initial service solution, and make service usage requests to other nodes. Other nodes selectively provide services according to their selfishness. The responses of other nodes are divided into three types: agree to provide, disagree but provide other services, and disagree to provide. The nodes receiving the requests reconstruct the initial service solution according to the responses. When all services in the initial service solution are available, the final service solution is obtained.
[0011] Furthermore, the selfishness degree includes objective selfishness and subjective selfishness, wherein objective selfishness is affected by the objective conditions of the node, and subjective selfishness follows the subjective will of the node; the selfishness degree S is defined as follows:
[0012] S=f(S R S P ,ω)
[0013] Among them, S R ∈(0,1) are available service resource factors, S P ∈[0,1] represents the service execution benefit factor, ω represents the node's subjective willingness factor, and f is a linear function; the first two factors are defined as follows:
[0014]
[0015] Where R is the number of available service resources, ω R κ and ω are parameters that measure the impact of R on selfishness, P is the service execution revenue, and ω is the service execution revenue. P P0 and P0 are parameters that measure the impact of P on selfishness.
[0016] Furthermore, each node sets a selfishness threshold. When the selfishness of a service is less than this threshold, the node is willing to provide the service.
[0017] Furthermore, when services in a service network collaborate to meet needs, they often form fixed combinations, known as service patterns. There are two types of service patterns: one is designed by domain experts, and the other is a potential service pattern that needs to be discovered through historical combinations or service knowledge graphs.
[0018] Furthermore, we define pairs to represent the relationship between demand patterns and service patterns. By bringing all pairs together, we obtain a three-dimensional matrix containing demand patterns, service patterns, and context, which is called the association matrix.
[0019] Furthermore, the multi-label classification model consists of three parts:
[0020] Requirements section: First, extract the functional and non-functional requirements from the user requirements and model them as a constraint graph. Then, use a graph convolutional network to learn the requirement representation.
[0021] Service component: First, service features are extracted and services are modeled as service vectors. Then, a multilayer perceptron is used to represent the services, and a transformer encoder is used to discover the dependencies between services to obtain service embeddings.
[0022] Transformer part: Using the cross-attention module in the transformer decoder, the service embedding is used as a query to detect service-related features from the demand representation and predict the probability that each service will be used to satisfy the demand.
[0023] Furthermore, the result of demand matching consists of two parts: a set of matched demand patterns and a set of unmatched sub-demands; for each demand pattern, a service pattern with a high probability of association is found from the association matrix based on the current user context; for the sub-demand set, the search space will be further reduced through step S3.
[0024] Furthermore, the centralized service composition method is a centralized service composition method based on genetic algorithms.
[0025] This invention proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the decentralized service composition method that considers node selfishness.
[0026] This invention proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of a decentralized service composition method that considers node selfishness.
[0027] The beneficial effects of this invention are:
[0028] To overcome the problems of low efficiency, insufficient quality of constructed solutions, and insufficient consideration of data privacy and selfishness among service providers in current decentralized service composition techniques, this invention provides a decentralized service composition method that considers node selfishness. The method first models the selfishness of service providers. Then, to improve composition efficiency and solution quality, empirical rules are utilized from historical compositions to propose demand patterns, service patterns, and association matrices to mine commonalities in historical compositions, and a multi-label classification model is designed to extract features, narrowing down the size of candidate services. Based on these services, a service composition algorithm and a service coordination protocol are designed to coordinate service providers and construct service solutions. To protect the privacy among service providers, a mature federated learning framework is used to train the model, and privacy leaks are avoided in the algorithm and protocol design. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0030] Figure 1 This is a flowchart of a decentralized service composition method considering node selfishness as described in this invention;
[0031] Figure 2This is a flowchart illustrating the overall concept of a decentralized service composition method considering node selfishness as described in this invention. Detailed Implementation
[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] Combination Figures 1-2 This invention proposes a decentralized service composition method that considers node selfishness, the method specifically being:
[0034] Step S1: Model the selfishness of service providers. In a decentralized service network, when other service providers (service nodes) request a certain node to use a service, if that node is unwilling to provide the service for some reason, it is said that the node is selfish towards that service. The selfishness of a node towards each service is different because the node's willingness to provide each service is different. It is evaluated through selfishness degree. Using the selfishness degree definition formula, the service provider calculates the selfishness degree of each service and updates it in real time at runtime.
[0035] Selfishness includes objective and subjective selfishness. Objective selfishness is influenced by the node's objective conditions, such as available service resources and service execution benefits. The fewer available service resources and the smaller the service execution benefits, the higher the node's selfishness towards services. Subjective selfishness follows the node's subjective will, such as being more selfless when entering into cooperation agreements with other nodes. Referring to the epidemiological model and hyperbolic selfish behavior, the selfishness S is defined as follows:
[0036] S=f(S R S P ,ω)
[0037] Among them, S R ∈(0,1) are available service resource factors, S P ∈[0,1] represents the service execution benefit factor, ω represents the node's subjective willingness factor, and f is a linear function. The weights are determined by the importance of the above three influencing factors. The first two factors are defined as follows:
[0038]
[0039] Where R is the number of available service resources, ω R ω and κ are parameters that measure the effect of R on selfishness; a larger κ and a smaller ω RThis represents a more selfless node, i.e., a node with lower selfishness. P is the service execution reward, ω P P0 and P are parameters that measure the effect of P on selfishness. A smaller ω P A smaller P0 represents a more selfless node.
[0040] In practice, each node has a set selfishness threshold. When the selfishness of a service is less than this threshold, the node is willing to provide that service. Furthermore, when a node does not want to cooperate with another node, it increases its subjective selfishness, ω.
[0041] Step S2: Select appropriate candidate service patterns. To improve combination efficiency and solution quality, demand patterns, service patterns, and association matrices are used to extract commonalities from historical combinations. Nodes first use demand patterns to match demands, a process called demand matching. Demand matching decomposes demands into a set of matching demand patterns and a set of unmatched sub-demands. Then, based on the current environment, these demand patterns are mapped to service patterns through the association matrix, which gives the association probability of each service pattern. Using these service patterns with high association probabilities for subsequent combinations can effectively reduce the problem size and improve combination efficiency.
[0042] Historical user needs reveal connections between sub-needs. For example, the goal of travel is often to visit tourist attractions, and the needs related to these attractions are frequently linked to surrounding needs such as transportation, food, and accommodation. These sub-needs often appear together within a set of user needs, which can be identified and characterized as demand patterns.
[0043] When services in a service network collaborate to meet needs, they often form fixed combinations, known as service patterns. Service patterns essentially express the "prior knowledge" accumulated during the execution of the service network and represent the implicit rules for service combinations within or between specific domains. There are two types of service patterns: one is designed by domain experts, such as a travel agency publishing a tour plan; the other is latent service patterns, which need to be discovered through historical combinations or service knowledge graphs.
[0044] To reduce search size by using patterns in combinations, it's necessary to further explore the relationships between service patterns and demand patterns. These relationships are many-to-many, meaning multiple service patterns can match a single demand pattern, and one service pattern can match multiple demand patterns. Pair pairs are defined to represent the relationships between demand patterns and service patterns. The probability of this relationship varies across different contexts. Common contextual elements include user contexts such as age, gender, and relationship, as well as environmental contexts such as time, date, location, and season. Combining all pair pairs yields a three-dimensional matrix containing demand patterns, service patterns, and contexts, called the association matrix. The calculation of association probabilities primarily considers the number of successful matches between demand patterns and service patterns, the temporal relevance of historical combinations, the constraint satisfaction of service patterns, and the predicted service provision probabilities of other nodes.
[0045] Step S3: Reduce the search space for candidate services; train a multi-label classification model under the federated learning framework to find suitable services for unmatched sub-requirements from step S2;
[0046] The multi-label classification model consists of three parts:
[0047] Requirements section: First, extract the functional and non-functional requirements from the user requirements and model them as a constraint graph. Then, use a graph convolutional network (GCN) to learn the requirement representation.
[0048] Service component: First, service features are extracted and services are modeled as service vectors. Then, a multilayer perceptron (MLP) is used to represent the services, and a transformer encoder is used to discover the dependencies between services to obtain service embeddings.
[0049] Transformer part: Using the cross-attention module in the transformer decoder, the service embedding is used as a query to detect service-related features from the demand representation and predict the probability that each service will be used to satisfy the demand.
[0050] Selecting high-probability services for subsequent combination can reduce the size of candidate services and further improve combination efficiency. This multi-label classification model is trained within a federated learning framework to effectively protect node data privacy.
[0051] Step S4: Coordinate all nodes to build a service solution; Utilize a centralized service composition method to optimize the candidate service patterns and services in Steps S2 and S3, construct an initial service solution, and submit service usage requests to other nodes. Other nodes selectively provide services based on their selfishness. The responses of other nodes are divided into three types: agree to provide, disagree but provide other services, and disagree to provide. The node receiving the request (the initial node) reconstructs the initial service solution based on the response. When all services in the initial service solution are available, the final service solution is obtained.
[0052] Example
[0053] This invention provides a decentralized service composition method that considers node selfishness; the method flow is described below. Figure 1 For the overall approach, please refer to Figure 2 The method includes the following steps:
[0054] Step S1: Model the selfishness of service providers.
[0055] Using a selfishness definition formula, service providers calculate the selfishness of each service and update it in real time during runtime.
[0056] Step S2: Select a suitable candidate service mode
[0057] Demand patterns, service patterns, and correlation matrices are constructed based on the service provider's historical service portfolio records.
[0058] To apply bilateral patterns and association matrices to decentralized service composition, it is necessary to use demand patterns to cover user needs, i.e., demand matching. In demand matching, "a demand pattern can cover a part of the demand" requires the following conditions to be met: (1) the sub-demands and processes in the demand pattern are the same as the part of the demand; (2) the constraints in the demand pattern can include all the constraints of the part of the demand. There are many results of demand matching, and the following two rules are introduced to evaluate these results: (1) the solution using fewer demand patterns and with higher sub-demand coverage is better; (2) the solution with a higher average usage frequency of the demand pattern is better.
[0059] This problem is similar to the set covering problem. This step uses a demand matching method based on a greedy strategy, as shown in Algorithm 1. The greedy strategy of this method prioritizes demand patterns with more sub-demands and higher usage frequency.
[0060]
[0061] The result of demand matching consists of two parts: a set of matched demand patterns and a set of unmatched sub-demands. For each demand pattern, service patterns with high correlation probabilities are found from the association matrix based on the current user context. For the sub-demand sets, the search space is further reduced in step S3.
[0062] Step S3: Narrow the search space for candidate services
[0063] This step designs a multi-label classification model to predict the probability that each service can satisfy the unmatched subset of requirements in step S2. The entire model can be divided into three parts: the requirement part, the service part, and the transformer decoder part.
[0064] For the requirements section, given the advantage of constraint graphs in linking functional and non-functional requirements, they are used to model the requirements. The constraint graph consists of nodes and edges. Nodes include sub-requirement nodes and constraint nodes. When a constraint restricts a sub-requirement that includes another sub-requirement, there is an edge between the constraint node and that sub-requirement node. Considering that the constraint graph will not be too large, a Graph Convolutional Network (GCN) is chosen to extract the requirement features. Let a node in the graph be n. i GCN updates nodes using the following formula:
[0065]
[0066] in, Θ is the trainable parameter matrix, and D is the dimension of the GCN hidden layer. After obtaining the output of the last layer of the GCN, sub-demand nodes in the graph are extracted to form demand features F. This part will be trained together with the service part in the transformer decoder.
[0067] Regarding the service component, it's noted that some studies have designed service relationship graphs and used graph neural networks (GNNs) to extract service embeddings. However, considering that unmatched subsets of needs are often not satisfied by commonly used services, the relationships between them are relatively rare in historical combinations. Therefore, this invention does not use this approach. Instead, it directly encodes services as vectors, uses a multilayer perceptron (MLP) to obtain service embeddings, and employs a transformer encoder to discover dependencies between services.
[0068] First, define the service vector. The service vector consists of two parts: the first part is the service function, occupying one dimension; the second part is the Quality of Service (QoS), with each normalized QoS occupying one dimension. Then, using an MLP, project the encoded service vector onto a D-dimensional vector, matching it with the requirement dimension. Finally, to obtain the dependencies between services, use a transformer encoder defined as follows to embed all service embeddings S′∈R. k×DPractice self-awareness:
[0069]
[0070] Where k is the number of services. These are intermediate variables. MultiHead(query, key, value) and FFN(x) are functions defined in the standard transformer encoder.
[0071] After obtaining the demand and service features, the service features are used as queries, and cross-attention is applied. A multi-layer transformer decoder is then used to aggregate service-related features from the demand features. The transformer decoder consists of a self-attention mechanism, a cross-attention mechanism, and a positional feedforward network. Each decoder layer i receives information from its preceding layer Q. i-1 Updated, defined as follows:
[0072]
[0073] in and These are two intermediate variables. It's worth noting that in the cross-attention module, the key and value are requirement features. Each service feature examines the areas of focus within the requirement features and selects features of interest for combination. Thus, Q... i-1 It will be updated layer by layer, and the required information will be gradually injected through cross-attention.
[0074] Assume the encoder has L layers, and the output of the L-layer encoder is Q. L ∈R k×D For multi-label classification problems, a linear layer and a sigmoid function are used to Q-factor each service feature. L,j The probability p projected to the prediction j To address the imbalanced sample problem, asymmetric loss was used as the loss function during training.
[0075]
[0076] Where y j =1 indicates that in the optimal service plan corresponding to the demand, y = 1. j =0 indicates the opposite. Since mature federated learning frameworks are available, the method described in this invention chooses FATE (Federated AI Technology Enabler) to train the model. This framework enables data collaboration while protecting data security and privacy.
[0077] The predicted high-probability services will be used in step S4 in conjunction with the high-association-probability service patterns from step S2 to construct a service solution.
[0078] Step S4: Coordinate all nodes to build a service solution
[0079] This step consists of two parts: centralized service composition and node coordination.
[0080] For the first part, the results of the first two steps are processed first. For the demand patterns obtained after demand matching in step S2, the top k service patterns SP with the highest association probability are selected from the association matrix. match For each unmatched sub-demand obtained after demand matching, select the top k services S with the highest prediction probability from the multi-label classification model. match Then, a centralized service composition method is designed to construct the initial service scheme. Many optimization methods are available, including metaheuristics and reinforcement learning. Considering the complex constraints and the variable action space, a metaheuristic algorithm is chosen for optimization. Comparing various metaheuristic algorithms, the Genetic Algorithm (GA) is found to perform well on this problem. The centralized service composition method based on the Genetic Algorithm is shown in Algorithm 2.
[0081]
[0082] The algorithm first initializes the population size (pop) and the maximum number of iterations (t). max And randomly generate pop service solutions P. Then, for each service solution sol i Crossover and mutation are performed based on probabilities. The crossover step refers to the algorithm randomly selecting a service solution. j At a randomly selected location, it is compared with sol i Split and swap the right side. The mutation step means sol i Each service in the process is replaced by another service based on its mutation probability. The crossover and mutation results in a single solution. i Added to the new group P′ and the optimal service plan sol is updated based on P′. * P′ will also undergo a selection step to generate the population for the next iteration. This step uses a roulette wheel selection algorithm to select from P′ sequentially. When the total number of iterations exceeds t... max When the time comes, the algorithm stops. At this point, sol * This is the initial service plan obtained.
[0083] For the second part, since the solution obtained in the previous part... * It may include services from other nodes, so the node n receiving the request... i It is necessary to send these services to node nj Initiate a usage request. i Initiate a request and from n j The process of receiving a response is called the node coordination protocol. This protocol is designed based on the following reputation principle: when a node requests a service from another node, that service must appear in the final service solution unless the node refuses.
[0084] When n j When a service request is received, it has three ways to respond.
[0085] • Agree to provide: based on the selfishness defined in step S1, n j I agree to provide the service.
[0086] • Refuse but offer other services: Based on the selfishness defined in step S1, n j It refuses to provide services, but can provide services with similar QoS.
[0087] • Refuse to provide: Based on the selfishness defined in step S1, n j Service refused.
[0088] The similarity of "QoS-similar services" is evaluated using Euclidean distance. In n i After receiving all responses, if any services are unavailable, it will re-find high-probability services corresponding to these sub-requirements from the candidate service reduction results (excluding unavailable services). If n j Other services are provided and will be added to the high-probability service set. This high-probability service set will be repeated in step S4 and used as input for optimization the next time.
[0089] When all nodes agree to use these services, so * It refers to the final service solution.
[0090] This invention proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the decentralized service composition method that considers node selfishness.
[0091] This invention proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of a decentralized service composition method that considers node selfishness.
[0092] The memory in this application embodiment can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM). It should be noted that the memory used in the methods described in this invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0093] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0094] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0095] It should be noted that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuitry in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above methods.
[0096] The above provides a detailed description of a decentralized service composition method considering node selfishness proposed in this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A decentralized service composition method considering node selfishness, characterized in that: The method is specifically as follows: Step S1: Model the selfishness of service providers; In a decentralized service network, when other service providers (i.e., service nodes) request a certain node to use a certain service, and that node is unwilling to provide the service for some reason, it is said that the node is selfish towards that service; The selfishness of a node towards each service is different, and it is evaluated by the selfishness degree; Using the selfishness degree definition formula, the service provider calculates the selfishness degree of each service and updates it in a timely manner at runtime; Step S2: Select suitable candidate service patterns; extract commonalities from historical combinations using demand patterns, service patterns, and association matrices; nodes first use demand patterns to match demands, called demand matching, which decomposes demands into a set of matching demand patterns and a set of unmatched sub-demands; then, based on the current environment, these demand patterns are mapped to service patterns through the association matrix, which gives the association probability of each service pattern. For each demand pattern, based on the current user context, high association probability service patterns with association probabilities higher than preset values are found from the association matrix; use these high association probability service patterns for subsequent centralized service combination; for sub-demand sets, the search space will be further reduced in step S3; Step S3: Reduce the search space for candidate services; train a multi-label classification model under the federated learning framework to find suitable services for unmatched sub-requirements from step S2; Step S4: Coordinate all nodes to build a service solution; Utilize a centralized service composition method to optimize the candidate service patterns and services in Steps S2 and S3, construct an initial service solution, and submit service usage requests to other nodes. Other nodes selectively provide services based on their selfishness. The responses of other nodes are divided into three types: agree to provide, disagree but provide other services, and disagree to provide. The node receiving the request reconstructs the initial service solution based on the response. When all services in the initial service solution are available, the final service solution is obtained. The selfishness degree includes objective selfishness and subjective selfishness, where objective selfishness is influenced by the objective conditions of the node, and subjective selfishness follows the node's subjective will; the selfishness degree S is defined as follows: in, This refers to available service resources. It is a factor of service execution interest. It is a factor of the node's subjective will. It is a linear function; the first two factors are defined as follows: in, It represents the number of available service resources. and It is a measure Parameters affecting selfishness It is the revenue from service execution. and It is a measure Parameters affecting selfishness; The multi-label classification model consists of three parts: Requirements section: First, extract the functional and non-functional requirements from the user requirements and model them as a constraint graph. Then, use a graph convolutional network to learn the requirement representation. Service component: First, service features are extracted and services are modeled as service vectors. Then, a multilayer perceptron is used to represent the services, and a transformer encoder is used to discover the dependencies between services to obtain service embeddings. Transformer part: Using the cross-attention module in the transformer decoder, the service embedding is used as a query to detect service-related features from the demand representation and predict the probability that each service will be used to satisfy the demand.
2. The method according to claim 1, characterized in that: Each node has a selfishness threshold set. When the selfishness of a service is less than this threshold, the node is willing to provide the service.
3. The method according to claim 1, characterized in that: When services in a service network collaborate to meet needs, there are fixed combinations, called service patterns. There are two types of service patterns: one is designed by domain experts, and the other is a potential service pattern that needs to be discovered through historical combinations or service knowledge graphs.
4. The method according to claim 1, characterized in that: We define pairs to represent the relationship between demand patterns and service patterns. By bringing together all pairs, we obtain a three-dimensional matrix containing demand patterns, service patterns, and context, which is called the association matrix.
5. The method according to claim 1, characterized in that: The centralized service composition method is a centralized service composition method based on genetic algorithms.
6. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-5.
7. A computer-readable storage medium for storing computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-5.
