CN-116939020-B - Service online determination method, device, equipment, medium and product
Abstract
The embodiment of the application discloses a service online determination method, device, equipment, medium and product. The service online determining method is characterized in that based on service state information of a first service node reported by N clients, a first client and a second client are determined, and then a first online result of the first service node is determined according to a first trust value of the first client and a second trust value of the second client. The service online determining method is determined by all clients when determining whether the first service node is online or not, namely, the situation of all clients is comprehensively considered, so that the accuracy of the result is improved.
Inventors
- YANG MENG
- LIU JINGYU
Assignees
- 中国移动通信集团辽宁有限公司
- 中国移动通信集团有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20220331
Claims (10)
- 1. A method for online service determination, comprising: receiving service state information of a first service node reported by N clients, wherein N is an integer not smaller than 1, and the service state information is used for indicating whether the first service node is online or not; Determining a first client and a second client according to the service state information, wherein the first client is a client for reporting the online of the first service node by the N clients, and the second client is a client for reporting the offline of the first service node by the N clients; And determining a first online result of the first service node according to a first trust value of the first client and a second trust value of the second client, wherein the first trust value and the second trust value are determined based on a second online result of a predetermined second service node, and the second service node is a service node except the first service node.
- 2. The method of claim 1, wherein prior to receiving service state information of a first service node reported by N clients, the method further comprises: determining a trust value mathematical expectation according to a third trust value of a third client and a fourth trust value of a fourth client, wherein the third client is a client with the service state information of the second service node being consistent with the second online result and reported by the N clients, and the fourth client is a client with the service state information of the second service node being inconsistent with the second online result and reported by the N clients; Determining a fifth trust value of the third client according to the third trust value and the trust value mathematical expectation; determining a sixth trust value of the fourth client according to the fourth trust value and the trust value mathematical expectation; and determining a first trust value of the first client and a second trust value of the second client according to the fifth trust value of the third client and the sixth trust value of the fourth client.
- 3. The method of claim 2, wherein the determining a fifth trust value for the third client based on the third trust value and a trust value mathematical expectation comprises: determining the third trust value and a mathematically expected sum of the trust values as a seventh trust value; and normalizing the seventh trust value to obtain a fifth trust value of the third client.
- 4. The method of claim 2, wherein said determining a sixth trust value for the fourth client based on the fourth trust value and a trust value mathematical expectation comprises: determining the difference between the fourth trust value and the mathematical expectation of the trust value as an eighth trust value; and normalizing the eighth trust value to obtain a sixth trust value of the fourth client.
- 5. The method of claim 1, wherein the determining the first online result for the first service node based on the first trust value for the first client and the second trust value for the second client comprises: determining the online rate of the first service node according to the first trust value of the first client and the second trust value of the second client; Determining that the first service node is online under the condition that the online rate is not smaller than a set threshold value; and determining that the first service node is offline under the condition that the online rate is smaller than a set threshold value.
- 6. The method of claim 1, wherein after determining the first online result for the first service node based on the first trust value for the first client and the second trust value for the second client, the method further comprises: And sending a first online result of the first service node to a service registration node so that the service registration node updates a pre-stored service available list according to the first online result of the first service node, wherein the service available list is used for storing node information of the online service node.
- 7. The service online determining device is characterized by comprising a receiving module and a determining module; The receiving module is used for receiving service state information of a first service node reported by N clients, wherein N is an integer not smaller than 1, and the service state information is used for indicating whether the first service node is online or not; The determining module is configured to determine a first client and a second client according to the service status information, where the first client is a client that the N clients report that the first service node is online, and the second client is a client that the N clients report that the first service node is offline; the determining module is further configured to determine a first online result of the first service node according to a first trust value of the first client and a second trust value of the second client, where the first trust value and the second trust value are determined based on a predetermined second online result of a second service node, and the second service node is a service node other than the first service node.
- 8. An electronic device, comprising: A processor; A memory for storing computer program instructions; the computer program instructions, when executed by the processor, implement the method of any of claims 1-6.
- 9. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1-6.
- 10. A computer program product, characterized in that instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the method of any of claims 1-6.
Description
Service online determination method, device, equipment, medium and product Technical Field The present application relates to the field of computer networks, and in particular, to a method, apparatus, device, medium, and product for online service determination. Background At any time the Internet age comes, the demands of users show new, quick and plentiful trends, namely, the demands of the users are novel and personalized, the demands are quick to respond, the number of the users is more and more, and based on the characteristics, the micro-service architecture is in a proper state. The micro-service splits a single application into a series of small services, each service operates in an independent process, and the services are coordinated and matched with each other to provide the final value for the user. In the micro service architecture, since one application is split into a plurality of services, how to efficiently register services, discover services, and manage services is the core of the micro service architecture. Wherein a service is discovered, i.e., whether the service is online is determined. The existing scheme has lower accuracy when determining whether a certain service is online or not, and is easy to influence the normal operation of the micro-service architecture. Disclosure of Invention The embodiment of the application provides a service online determining method, device, equipment, medium and product, which can improve the accuracy of a result when determining whether a certain service is online. In a first aspect, an embodiment of the present application provides a service online determining method, including: Receiving service state information of a first service node reported by N clients, wherein N is an integer not smaller than 1, and the service state information is used for indicating whether the first service node is online or not; Determining a first client and a second client according to the service state information, wherein the first client is a client for reporting the online of the first service node by N clients, and the second client is a client for reporting the offline of the first service node by N clients; and determining a first online result of the first service node according to the first trust value of the first client and the second trust value of the second client, wherein the first trust value and the second trust value are determined based on a predetermined second online result of the second service node, and the second service node is a service node except the first service node. In a second aspect, an embodiment of the present application provides a service online determining apparatus, including a receiving module and a determining module; The receiving module is used for receiving service state information of a first service node reported by N clients, wherein N is an integer not less than 1, and the service state information is used for indicating whether the first service node is online or not; the determining module is used for determining a first client and a second client according to the service state information, wherein the first client is a client for reporting the first service node to be online by N clients, and the second client is a client for reporting the first service node to be offline by N clients; the determining module is further configured to determine a first online result of the first service node according to a first trust value of the first client and a second trust value of the second client, where the first trust value and the second trust value are determined based on a predetermined second online result of the second service node, and the second service node is a service node other than the first service node. In a third aspect, an embodiment of the present application provides an electronic device, including: A processor; A memory for storing computer program instructions; the computer program instructions, when executed by a processor, implement the method as described in the first aspect. In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement a method as described in the first aspect. In a fifth aspect, embodiments of the present application provide a computer program product, instructions in which, when executed by a processor of an electronic device, cause the electronic device to perform the method according to the first aspect. The service online determining method, device, equipment, medium and product provided by the embodiment of the application are used for determining the first client and the second client based on the service state information of the first service node reported by the N clients, and then determining the first online result of the first service node according to the first trust value of the first client and the second trust value of the second clie